20145109 《Java程序设计》第九周学习总结

JDBC

1 . DriverManager

Class.forName("oracle.jdbc.driver.OracleDriver").newInstance(); 

2 . Connection

Connection conn=DriverManager.getConnection(url,user,password); 

3 . Statement (execute SQL)

Statement stmt=conn.createStatement(); 

String sql="select * from user where userName=? and password=?"; 
PreparedStatement pstmt=Conn.prepareStatement(sql); 

pstmt.setString(1,"admin"); 
pstmt.setString(2,"liubin");

关于安装:

原文地址:https://www.cnblogs.com/Christen/p/5451570.html