Hi,
I have written a simple server program that allows users to log in and register for a class using client.
The server connects to a database and is run on a server at my uni. Everything worked fine until I tried to create a .jar file for the server and run it on the remote server. I get a classNotFoundException: org.postgresql.Driver I stress everything worked fine until I tried to use the jar.
Is there something different I need to do when specifying the drivers for the DB if it is within a .jar? Like I would need to if I was including data files.
Current DB connection code below:
public void connect() throws Exception{ Class.forName("org.postgresql.Driver"); connect = DriverManager.getConnection("jdbc:postgresql://igor.gold.ac.uk:5432/database","username", "password"); st = connect.createStatement(); System.out.println("connected"); connected = true; }
Thanks for your help.
M