易截截图软件、单文件、免安装、纯绿色、仅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 语句级触发器

先构造一个表:
create table emp2(
id number(2),
name varchar(10),
currdate date,
action varchar2(1)
)
创建触发器:
create or replace trigger d_i_u_emp2
after insert or update or delete on mysort
begin
if inserting then
insert into emp2 values (12,'dog',sysdate,'i');
elsif deleting then ......

Java 依赖注射规范(JSR

JCP SE/EE 执行委员会
正式接受了
JSR 330
—— Dependency Injection for Java。该规范于 今年 5 月 9 日
由 Google 的 Bob Lee 以及 SpringSource 的 Rod Johnson 作为规范领导提交给 JCP,现在已经正式发布,不得不感叹该规范标准化过程之快。在 最终投票结果中
,14 票通过,1 票未投,1 票反对。
J ......

JAVA List to Array,Array to List

 1.List转换成为数组。(这里的List是实体是ArrayList)
调用ArrayList的toArray方法。
例:String[] arr = (String[])list.toArray(new String[size]);
2.数组转换成为List。
调用Arrays的asList方法。
例:List stooges = Arrays.asList("Larry", "Moe", "Curly"); ......

JDK中包含的常用Java调试工具

1  JDK5.0包括的调试工具
我们在这里对JDK5.0的调试工具做大致的概念性的介绍,然后希望通过介绍我自己在实际工作中使用这些工具解决问题的实例来让大家对这些工具有更深入的了解。
 
 JDK5.0里面加入了jstack, jconsole, jinfo, jmap, jdb, jstat, jps, 下面对这些工具做简单介绍:
 jstack -- 如果java程 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号