try{
Class.forName("Weblogic.jdbc.mssqlserver4.Driver");
Connection conn = DriverManager.getConnectio ("jdbc:weblogic:mssqlserver4:localhost:1433","username","password");
conn.setAutoCommit(false);
PreparedStatement pstmt = conn.prepareStatement("select * from table_name");
ResultSet rs = pstmt.executeQuery();
while(rs.next()){
System.out.println(rs.getString(1));
}
}
阅读(1091) | 评论(1) | 转发(0) |