Connection in Executable not working
-
I'm still pretty new to Java so I'm sure I'm missing something. Basically just trying to update a database here so nothing that should be too difficult. If I run the program in Netbeans it runs fine... however if I run the executable from the commandline I get a error: C:\Users\Derek>java -jar "C:\Path...\dist\BirthDayUpdate.jar" Trying the connection now... Connection Exception: I/O Error: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property. This is the connection code where it's failing:
public Connection openConn() {
try {
System.out.println("Trying the connection now...");
Class.forName("net.sourceforge.jtds.jdbc.Driver");
conn = java.sql.DriverManager.getConnection("jdbc:jtds:sqlserver://localhost:1433/Intranet");
System.out.println("Connection ok.");
} catch (ClassNotFoundException | SQLException e) {
System.out.println("Connection Exception: " + e.getMessage());
//e.printStackTrace();
}
return conn;
}Thanks in advance!