4 Replies Latest reply on Dec 9, 2004 12:08 PM by lords_diakonos

    help with setting up postgres datasource

    lords_diakonos Newbie

      I ama newbie at this and I am trying to set up a postgres as a datasource. Could someone please explain where I am going wrong?
      here is my ds

       <!-- sql to call when connection is created
       <new-connection-sql>some arbitrary sql</new-connection-sql>
       <!-- sql to call on an existing pooled connection when it is obtained from pool
       <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>

      here is the class I am using as a test to call the ds
      package localtest;
      import java.sql.*;
      import javax.*;
      public class NameTest {
       public NameTest(){
       public static String getName() {
      String name = "";
      javax.naming.Context ctx = new javax.naming.InitialContext();
      javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup("java:/PostgresDS");
      Connection con = ds.getConnection();
      PreparedStatement ps = con.prepareStatement("select name from name");
      ResultSet rs = ps.executeQuery();
      name = rs.getString("name");
       catch(Exception e){
       return name;

      here are the errors I am getting :-(
      23:25:03,015 WARN [JBossManagedConnectionPool] Throwable while attempting to ge
      t a new connection: null
      org.jboss.resource.JBossResourceException: Could not create connection; - nested
       throwable: (org.jboss.resource.JBossResourceException: Failed to register drive
      r for: org.postgresql.Driver; - nested throwable: (java.lang.ClassNotFoundExcept
      ion: org.postgresql.Driver))
       at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.c
       at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.cr