I'm training in java J2E perspective (on eclipse) and I would like to make a connection with SQL server.
But even if my driver works (mssql-jdbc-11.2.0.jre17), I can't get a connection in the next line (I have the SQL Exception).
Here is the code :
try {
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); // it works
DriverManager.getConnection("jdbc:sqlserver://localhost"); // not works :(
} catch (ClassNotFoundException e) {
System.out.println("Class doesn't works");
} catch (SQLException e) {
System.out.println("Connection doesn't works");
}
UPDATE Just to say i resolved my problem, in fact, i switched to oracle sql and it worked.