Error connecting to SQLServer using JAVA JDBC

0

I'm using the sqlserver lib and my connection class is down here:

public class conexao{

//sqlsever
private static final String USUARIO2 = "usuario";
private static final String SENHA2   = "senha";
private static final String URL2     = "jdbc:microsoft:sqlserver://servidor:1433,usuario,senha";
private static final String DRIVER2  = "com.microsoft.sqlserver.jdbc"; //  JDBC driver


public void ConexaoAbrir(){
    try {  
        Class.forName(DRIVER2);

        Connection conn = DriverManager.getConnection(URL2, USUARIO2, SENHA2);     
    } 
        catch (SQLException e) {
            JOptionPane.showMessageDialog(null,"SQL Exception: "+ e.toString());
    } 
        catch (ClassNotFoundException cE) {
            JOptionPane.showMessageDialog(null,"Class Not Found Exception: "+ cE.toString());
    }
}

}

Class error:

    
asked by anonymous 26.04.2016 / 19:34

0 answers