我以前发现过这个问题,但没有一个答案对我有用!运行后出现此错误:
SQLException: 找不到适合 jdbc:derby://localhost:1527//RIHANNA-PC/Users/javadb 的驱动程序
我已将 derbyclient.jar 添加到库中。但我没有得到任何不同的结果。我也不想创建新数据库。
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
String userid="a", password = "a";
// "jdbc:derby://localhost:1527//RIHANNA-PC/Users/javadb"
String url = "jdbc:derby://localhost:1527//RIHANNA-PC/Users/javadb";
Statement stmt;
Connection con;
String createString="select * from tbl_operator where user_id='" + jTextField1.getText() + "' and pwd='" + jTextField2.getText() + "'";
ResultSet rs;
try {
con=DriverManager.getConnection(url,userid, password);
stmt = con.createStatement();
rs=stmt.executeQuery(createString);