在线急等
用SERVLET从数据库中取得数据,比如数据库的一个表是student
------解决方案--------------------DAO
------解决方案--------------------这问题大
public static void test() {
// 需补充
try {
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
conn = DriverManager.getConnection(
"jdbc:oracle:thin:@boyee:1521:orcl ", "sdfdm ", "sssss ");
Statement stmt = conn.createStatement();
String sql = "insert into sport(sp_no,sp_nm) values(20, '拳击 ') ";
stmt.executeUpdate(sql);
stmt.close();
} catch (
SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}