Ciao a tutti ho creato questa semplice connessione:
codice:
Connection con = null;
try {
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
Connection conn = DriverManager.getConnection("jdbc:sqlserver://192.168.1.3//KERNELSERVER/kernelSQLEXPRESS;database=dbprova;user=sa;password=password");
Statement stmt = conn.createStatement();
if (!con.isClosed()) {
Statement cmd = con.createStatement();
cmd.executeUpdate(qry);
}
} catch (Exception e) {
String h = "Exception: " + e.getMessage();
} finally {
try {
if (con != null) {
con.close();
}
} catch (SQLException e) {
String s = "Expception:" + e.getSQLState();
}
}
}
ma mi restituisce questo errore:
La connessione TCP/IP ALL'HOST 192.163.1.3//KERNELSERVER/kernelSQLEXPRESS port 1433 non è riuscita: Errore null; verificare le proprietà di connessione
Sapete qualcosa?
KERNELSERVER/kernelSQLEXPRESS è il nome dell'istanza sql