The sqljdbc4.jar isn't loaded or recognized even after following the steps from: java.sql.SQLException: No suitable driver found for jdbc:derby:
With this command the application does not start outside netbeans. Starting it only with: java -jar FXProductWatcher.jar # does not load the driver .jar
PS C:\Documents and Settings\User1\Meus documentos\x\workspace\FXProductWatcher\dist> java -classpath 'C:\Documents and Settings\User1\Meus documentos\x\workspace\FXProductWatcher\dist\lib\sqljdbc4.jar;FXProductWatcher.jar' FXProductWatcher
Results in> Error not able to locate or load main class FXProductWatcher
I'm using netbeans the manifest file is being generated automatically. I tried placing Class-Path: lib/sqljdbc4.jar but with no positive result.
The manifest from netbeans has:
JavaFX-Application-Class: fxproductwatcher.FXProductWatcher
JavaFX-Class-Path: lib/sqljdbc4.jar
Created-By: JavaFX Packager
Main-Class: com/javafx/main/Main
My connection code
try {
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
} catch (ClassNotFoundException ex) {
Logger.getLogger(DbConnection.class.getName()).log(Level.SEVERE, null, ex);
}
String sDbUrl = "jdbc:sqlserver://remoteIP;databaseName=test";
conn = DriverManager.getConnection(sDbUrl, username, password);
return conn;
Thanks for any help or sugestion.