【发布时间】:2020-10-07 21:37:07
【问题描述】:
我正在为 Oracle (OJDBC6.jar) 的 JDBC 连接编写 junit 测试用例。下面是我的代码
public void insertCard(){
Properties prop= new Properties();
properties.put("user","user");
properties.put("password","password");
properties.put("driver","com.oracle.OracleDriver")
Connection con = DriverManager.getConnection (
"jdbc:oracle:thin:@localhost:1521:orcl",properties);
PreparedStatement insertCardValues = con.prepareStatement(
"insert into card values(?,?,?)");
insertCardValues.setInt(1,123);
insertCardValues.setName(2,"Raja");
insertCardValues.setAddress(3, "Lucknow");
insertCardValues.executeUpdate();
}
}
谁能帮我测试下面的代码
Connection con = DriverManager.getConnection (
"jdbc:oracle:thin:@localhost:1521:orcl","properties);
【问题讨论】:
标签: junit