易截截图软件、单文件、免安装、纯绿色、仅160KB

oracle连接数据库测试代码

oracle连接数据库测试代码
/**
*
* 说明:
* (1)本例使用JDBC_ODBC桥进行数据库连接,故此需要ODBC数据源
* (2)本例中SQL为更新语句,故此使用载体的executeUpdate方法,并且返回受影响记录数
* (3) 配置连接ORACLE的odbc数据源ora
*/
//导入所需类包
import java.sql.*;
public class JdbcTestOra2 {
public static void main(String args[]) {
    try {
      //装载驱动程序
      Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
     
      //建立数据库连接
      Connection con =
DriverManager.getConnection("jdbc:odbc:ora","scott","tiger");
     
      //创建SQL语句载体
      Statement st = con.createStatement();
     
      //执行SQL语句,接收执行结果
      int rs = st.executeUpdate("update emp set
comm=1000");
           
      //处理结果
      System.out.println("修改记录数:"+rs);
     
      //释放数据库资源,注意顺序
      st.close();
      con.close();           
    }
    catch (Exception e) {
      e.printStackTrace(System


相关文档:

windows 启动 oracle 批处理脚本

 Oracle安装后,会把4个服务设为自动启动,分别为:
1. OracleOraHome90Agent
2. OracleOraHome90HTTPServer
3. OracleOraHome90TNSListener
4. OracleServiceORA
         其中第二个不是必须的,可以在服务里把它禁用。其他三个在Oracle运行时都要启动。
   ......

oracle日期函数集锦


一、 常用日期数据格式
1.Y或YY或YYY 年的最后一位,两位或三位
SQL> Select to_char(sysdate,'Y') from dual;
TO_CHAR(SYSDATE,'Y')
--------------------
7
SQL> Select to_char(sysdate,'YY') from dual;
TO_CHAR(SYSDATE,'YY')
---------------------
07
SQL> Select to_char(sysdate,'YYY') from ......

Oracle Waits event:DB File Scattered Read

The DB File Scattered Read wait event generally indicates waits related to full table scans or fast
full index scans. As full table scans are pulled into memory, they are scattered throughout the
buffer cache, since it is usually unlikely that they fall into contiguous buffers. A large numb ......

Oracle waits event:DB File Sequential Read

The DB File Sequential Read wait event generally indicates a single block read (an index read,
for example). A large number could indicate poor joining orders of tables or unselective indexing.
This number will certainly be large (normally) for a high-transaction, well-tuned system. You ......

如何开发ORACLE存储过程

在我的上一个银行项目中,我接到编写ORACLE存储过程的任务,我是程序员,脑袋里只有一些如何使用CALLABLE接口调用存储过程的经验,一时不知如何下手,我查阅了一些资料,通过实践发现编写ORACLE存储过程是非常不容易的工作,即使上路以后,调试和验证非常麻烦。简单地讲,Oracle存储过程就是存储在Oracle数据库中的一个程序 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号