[英]SEVERE: null in java netbeans 14 java.sql.SQLException: No suitable driver found for error
I tried to make desktop apps in netbeans 14. So, I tried to sort the data into JTable and make a login screen with JTable.我尝试在 netbeans 14 中制作桌面应用程序。因此,我尝试将数据分类到 JTable 并使用 JTable 制作登录屏幕。 I tried to fetch the data via MSSQL.
我试图通过 MSSQL 获取数据。 For this, I downloaded jdbc 10.2.1, installed it, added Tomcat.
为此,我下载了 jdbc 10.2.1,安装它,添加了 Tomcat。 At first I was able to pull data properly and log in. but now " SEVERE: null I am getting error java.sql.SQLException: No suitable driver found for jdbc:sqlserver://DESKTOP-E480QRJ\sqlexpress:1433;databaseName=AracTrackingSystem;user=m;password=150601".
At first I was able to pull data properly and log in. but now " SEVERE: null I am getting error java.sql.SQLException: No suitable driver found for jdbc:sqlserver://DESKTOP-E480QRJ\sqlexpress:1433;databaseName= AracTrackingSystem;用户=m;密码=150601"。 How can I fix this?
我怎样才能解决这个问题? my code this;
我的代码这个;
private void girisActionPerformed(java.awt.event.ActionEvent evt) {私人无效girisActionPerformed(java.awt.event.ActionEvent evt){
// TODO add your handling code here: try { // TODO 在此处添加您的处理代码:try {
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); Class.forName("org.apache.derby.jdbc.ClientDriver").newInstance();
String url=" jdbc:sqlserver://DESKTOP-E480QRJ\\sqlexpress:1433;databaseName=AracTakipSistemi;user=m;password=150601";
//String KullaniciId=kullaniciid.getText();
//String KullaniciSifre=sifre.getText();
Connection con=DriverManager.getConnection(url);
String sql="Select Kullanici from KullaniciId=? and KullaniciSifre=?";
PreparedStatement pst= con.prepareStatement(sql);
pst.setString(1, kullaniciid.getText());
pst.setString(2, sifre.getText());
ResultSet rs=pst.executeQuery();
if(rs.next()){
dispose();
AracTakipIslemler2 n=new AracTakipIslemler2();
n.setVisible(true);
}
else{
JOptionPane.showMessageDialog(null, "eror");
kullaniciid.setText("");
sifre.setText("");
con.close();
}
} catch (ClassNotFoundException | SQLException ex) {
Logger.getLogger(AracTakipLogin2.class.getName()).log(Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
Logger.getLogger(AracTakipLogin2.class.getName()).log(Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
Logger.getLogger(AracTakipLogin2.class.getName()).log(Level.SEVERE, null, ex);
}
Have you added the plugin jar file path to your IDE?您是否将插件 jar 文件路径添加到您的 IDE 中?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.