Error java.sql.sqlexception no suitable driver found for jdbc sqldeveloper

0

Could you help me with this error?

I have a database in sql developer, I have created it with a table that includes users and passwords. Create a program with a login, I have programmed the button, I have created my connection class and I have imported the jdbc library.

// this is my connection class, yes, apparently if it is denoted that not and imported the jdbc but I have done it. Thank you for your answers. and sorry for the inconvenience ...

public class Conexion {     public String user="sa";     public String password="123";   //     public String url="jdbc: sqldeveloper: // localhost: 1521; databaseName = xe";

public Connection conection =null;
public Statement state = null;

public Statement Conectar ()
{ 
    try
    {
       Connection cn = DriverManager.getConnection(url,user,password) ;
       cn.close();
       state = conection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY );
    }
    catch (SQLException e)
    {
      JOptionPane.showMessageDialog(null, e);
    }
    return state;

}
    
asked by Nenton 22.08.2017 в 02:32
source

1 answer

0

You need to add the jar with the sql server driver for java to your project. You can find it here

Here you have official Microsoft documentation with examples.

    
answered by 22.08.2017 в 08:28