易截截图软件、单文件、免安装、纯绿色、仅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


相关文档:

Oracle按字符截取字符串函数

输入参数:str ——要截取的字符串,  ch——要查找的字符串
截取ch之前(不包括ch)的字符串: substr(str, 0, instr(str, ch) - 1)
截取ch之后(不包括ch)的字符串: substr(str, , instr(str, ch) + 1, length(str)) ......

Oracle RAC 归档 与 非归档 切换


Oracle 的生产库都是启动在归档模式下,RAC下归档非归档的切换和单实例也是一样的,都是在MOUNT模式下执行ALTER DATABASE ARCHIVELOG/NOARCHIVELOG;命令。 不同的是:RAC环境下所有实例都必须处于非OPEN状态,然后在任意一个处于MOUNT状态的实例执行ALTER DATABASE命令,操作成功后,再正常启动 ......

oracle更改字符集

修改oracle 10g的字符集
修改数据库字符集为:ZHS16GBK
首先用scott&tiger&orcl登录到sql/plus
查看服务器端字符集
SQL > select * from
V$NLS_PARAMETERS;
修改:
$sqlplus /nolog
SQL>conn / as sysdba

此时数据库服务器已启动,则先执行 SHUTDOWN IMMEDIATE 命
令关闭数据库服务器,然后执 ......

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 wait problems and potential solutions

Wait Problem Potential Fix Sequential Read Indicates many index reads—tune the code (especially joins) Scattered Read Indicates many full table scans—tune the code; cache small tables ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号