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

Oracle 与在Java中的链接

转帖处:http://dong-java.javaeye.com/blog/375150 
1。推荐使用Oralce比较新的10.2.0.3 JDBC Drivers。这个版本对比9.2的最大的好处是DriverManager.setLoginTimeout函数是起作用的。设置了这个参数,在恶劣的网络环境中就不会有连接数据库的函数长时间不返回的情况。
2。JDBC Developer!ˉs Guide and Reference 10g Release 2 (10.2)
给出的连接数据库的示例:
import java.sql.*;
import oracle.jdbc.pool.OracleDataSource;
class JdbcTest {
       public static void main (String args []) throws SQLException {
          // Create DataSource and connect to the local database
          OracleDataSource ods = new OracleDataSource();
          ods.setURL("jdbc:oracle:thin:@//myhost:1521/orcl");
          ods.setUser("scott");
          ods.setPassword("tiger");
          Connection conn = ods.getConnection();
          // Query the employee names
          Statement stmt = conn.createStatement ();
          ResultSet rset = stmt.executeQuery ("SELECT ename from emp");
          // Print the name out
          while (rset.next ())
             System.out.println (rset.getString (1));
   
          //close the result set, statement, and the connection
          rset.close();
          stmt.close();
    &n


相关文档:

oracle 表空间操作

oracle表空间操作详解
  1
  2
  3作者:   来源:    更新日期:2006-01-04 
  5
  6 
  7建立表空间
  8
  9CREATE TABLESPACE data01
 10DATAFILE '/ora ......

有关java中resultSet的问题

//打印出mess表的列数是多少
public static void main(String[] args){
  String sql="select count(*) from mess";
  ResultSet set=null;
  try {
   Object paramValues[] = new Object[0];
         set = DBUtil.preExec ......

java 调用命令 备份mysql数据库

 代码如下:
  1  String command  =   " cmd /c C:/Program Files/MySQL/MySQL Server 5.0/bin>mysqldump -h localhost -u root -p aijia > E:/aijia.dmp " ;
  2      try    {
  3     Process process& ......

java设计模式

1、FACTORY(工厂模式)
2、BUILDER(建造模式)
3、FACTORY METHOD(工厂方法模式)
4、PROTOTYPE(原始模型模式)
5、SINGLETON(单例模式)
6、ADAPTER(适配器模式)
7、BRIDGE(桥梁模式)
8、COMPOSITE(合成模式)
9、DECORATOR(装饰模式)
10、FACADE(门面模式)
11、FLYWEIGHT(享元模式) ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号