I am trying to use postgres as database server on a servlet run under
Apache and jserv
Problem is when I isue the Class.forName("postgresql.Driver")
I get an ClassNotFound Exception.
The latest driver for jdbc (jdbc6.5-1.2.jar) is the only path in my
CLASSPATH.
The java-program compiles just fine, and postmaster is started with the -i
option.
I am running the java program for a test without apache and servlet, on the
same machine as postmaster is on, but as a different user.
the config file for postmaster includes
local all trust
Any suggestions????
import java.io.*;
import java.net.*;
import java.sql.*;
public class test {
public static void main (String args[]) {
try { Class.forName("postgresql.Driver"); System.out.println("Class.forName OK!");
String url = "jdbc:postgresql://192.168.1.1/fraggi"; String usr ="root"; String pwd
="";
Connection db = DriverManager.getConnection (url,usr,pwd);
if (db !=null) System.out.println("Connected OK to database"); else
System.out.println("Faildto connect"); }
catch (Exception e) { System.out.println(e.toString()); } }
}
Simu Soft
v/Anders Svensson
Frederikssundsvej 20, 2 th
DK-2400 København NV
e-mail : Anders@simusoft.dk
tlf. : +45 3583 8126