文件名称:Java数据库访问工具JDBC
文件大小:520KB
文件格式:PDF
更新时间:2014-09-21 11:00:42
jdbc
String driver = "Oracle.jdbc.driver.OracleDriver"; String strUrl = "jdbc:Oracle:thin:@10.87.66.30:1521:oshr"; Statement stmt = null; ResultSet rs = null; Connection conn = null; CallableStatement proc = null; try { Class.forName(driver); conn = DriverManager.getConnection(strUrl, "oshr", "q1w2e3r4"); proc = conn.prepareCall("{ call dev.P_GetEmpInfo(?,?,?,?)}"); proc.setString(1, "100"); proc.setString(2, "TestOne"); proc.execute(); } catch (SQLException ex2) { ex2.printStackTrace(); } catch (Exception ex2) { ex2.printStackTrace();