pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Postgresql-JDBC connectivity
7+ messages / 5 participants
[nested] [flat]

* Postgresql-JDBC connectivity
@ 2005-06-16 06:46  Minal <minalac@yes2etl.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Minal @ 2005-06-16 06:46 UTC (permalink / raw)
  To: pgsql-jdbc

Hi...
I am novice user of Postgresql8.0.3. I managed to export the database 
from sql server. We have all our application in JSP. I want to install 
the org.postgresql.driver..
I completed the following steps...
1.Downloaded the jar file from http://jdbc.postgres.org
2. Copied it in the lib folder of Jakarta..
3. Edited the pages to use the Driver..am still not able to connect...

Where am I going wrong??
Minalac



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Postgresql-JDBC connectivity
@ 2005-06-16 09:43  Dave Cramer <pg@fastcrypt.com>
  parent: Minal <minalac@yes2etl.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Dave Cramer @ 2005-06-16 09:43 UTC (permalink / raw)
  To: minalac@yes2etl.com; +Cc: pgsql-jdbc

Hi,

How are you trying to connect, what is the error message,  
specifically which lib directory of jakarta did you copy it into?

Dave
On 16-Jun-05, at 2:46 AM, Minal wrote:

> Hi...
> I am novice user of Postgresql8.0.3. I managed to export the  
> database from sql server. We have all our application in JSP. I  
> want to install the org.postgresql.driver..
> I completed the following steps...
> 1.Downloaded the jar file from http://jdbc.postgres.org
> 2. Copied it in the lib folder of Jakarta..
> 3. Edited the pages to use the Driver..am still not able to connect...
>
> Where am I going wrong??
> Minalac
>
> ---------------------------(end of  
> broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
>               http://www.postgresql.org/docs/faq
>
>




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Postgresql-JDBC connectivity
@ 2005-06-16 10:20  Minal <minalac@yes2etl.com>
  parent: Dave Cramer <pg@fastcrypt.com>
  0 siblings, 2 replies; 7+ messages in thread

From: Minal @ 2005-06-16 10:20 UTC (permalink / raw)
  To: Dave Cramer <pg@fastcrypt.com>; +Cc: pgsql-jdbc

I set the classpath, copied in the lib folder of web-inf. If I try to 
run a simple java program shown below:
import java.sql.*;

public class Example1
{
public static void main(String[] argv)
{
   System.out.println("Checking if Driver is registerd");
   try
   {
   Class.forName("org.postgresql.Driver");
   }
   catch(ClassNotFoundException cnfe)
   {
   System.out.println("Couldn't find the Driver");
   cnfe.printStackTrace();
   System.exit(1);
   }
   System.out.println("registered the Driver OK, so lets make a 
connection");
   Connection c = null;
     try
   {
   c= 
DriverManager.getConnection("jdbc:postgresql://localhost/trainneedcorp","postgres","admin"); 

   }
   catch(SQLException se)
   {
   System.out.println("Couldnt connect");
   se.printStackTrace();
   System.exit(1);
   }
   if(c != null)
   System.out.println("WE CONNECTED");
   else
   System.out.println("Reaching here is not done");
   }
   }
   I get the following error:

java.lang.ClassNotFoundException: org.postgresql.Driver
       at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
       at java.security.AccessController.doPrivileged(Native Method)
       at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
       at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
       at java.lang.Class.forName0(Native Method)
       at java.lang.Class.forName(Class.java:141)
       at Example1.main(Example1.java:10)


Dave Cramer wrote:

> Hi,
>
> How are you trying to connect, what is the error message,  
> specifically which lib directory of jakarta did you copy it into?
>
> Dave
> On 16-Jun-05, at 2:46 AM, Minal wrote:
>
>> Hi...
>> I am novice user of Postgresql8.0.3. I managed to export the  
>> database from sql server. We have all our application in JSP. I  want 
>> to install the org.postgresql.driver..
>> I completed the following steps...
>> 1.Downloaded the jar file from http://jdbc.postgres.org
>> 2. Copied it in the lib folder of Jakarta..
>> 3. Edited the pages to use the Driver..am still not able to connect...
>>
>> Where am I going wrong??
>> Minalac
>>
>> ---------------------------(end of  
>> broadcast)---------------------------
>> TIP 5: Have you checked our extensive FAQ?
>>
>>               http://www.postgresql.org/docs/faq
>>
>>
>
>




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Postgresql-JDBC connectivity
@ 2005-06-16 10:42  Tom Arthurs <tarthurs@jobflash.com>
  parent: Minal <minalac@yes2etl.com>
  1 sibling, 0 replies; 7+ messages in thread

From: Tom Arthurs @ 2005-06-16 10:42 UTC (permalink / raw)
  To: minalac@yes2etl.com; +Cc: pgsql-jdbc

You need to put it in common/lib under jakarta's home directory.  That's 
the only place the class loader can find it.

Minal wrote:
> I set the classpath, copied in the lib folder of web-inf. If I try to 
> run a simple java program shown below:
> import java.sql.*;
> 
> public class Example1
> {
> public static void main(String[] argv)
> {
>   System.out.println("Checking if Driver is registerd");
>   try
>   {
>   Class.forName("org.postgresql.Driver");
>   }
>   catch(ClassNotFoundException cnfe)
>   {
>   System.out.println("Couldn't find the Driver");
>   cnfe.printStackTrace();
>   System.exit(1);
>   }
>   System.out.println("registered the Driver OK, so lets make a 
> connection");
>   Connection c = null;
>     try
>   {
>   c= 
> DriverManager.getConnection("jdbc:postgresql://localhost/trainneedcorp","postgres","admin"); 
> 
>   }
>   catch(SQLException se)
>   {
>   System.out.println("Couldnt connect");
>   se.printStackTrace();
>   System.exit(1);
>   }
>   if(c != null)
>   System.out.println("WE CONNECTED");
>   else
>   System.out.println("Reaching here is not done");
>   }
>   }
>   I get the following error:
> 
> java.lang.ClassNotFoundException: org.postgresql.Driver
>       at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
>       at java.security.AccessController.doPrivileged(Native Method)
>       at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
>       at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
>       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
>       at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
>       at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
>       at java.lang.Class.forName0(Native Method)
>       at java.lang.Class.forName(Class.java:141)
>       at Example1.main(Example1.java:10)
> 
> 
> Dave Cramer wrote:
> 
>> Hi,
>>
>> How are you trying to connect, what is the error message,  
>> specifically which lib directory of jakarta did you copy it into?
>>
>> Dave
>> On 16-Jun-05, at 2:46 AM, Minal wrote:
>>
>>> Hi...
>>> I am novice user of Postgresql8.0.3. I managed to export the  
>>> database from sql server. We have all our application in JSP. I  want 
>>> to install the org.postgresql.driver..
>>> I completed the following steps...
>>> 1.Downloaded the jar file from http://jdbc.postgres.org
>>> 2. Copied it in the lib folder of Jakarta..
>>> 3. Edited the pages to use the Driver..am still not able to connect...
>>>
>>> Where am I going wrong??
>>> Minalac
>>>
>>> ---------------------------(end of  
>>> broadcast)---------------------------
>>> TIP 5: Have you checked our extensive FAQ?
>>>
>>>               http://www.postgresql.org/docs/faq
>>>
>>>
>>
>>
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
>      subscribe-nomail command to majordomo@postgresql.org so that your
>      message can get through to the mailing list cleanly
> 
> 
> 



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Postgresql-JDBC connectivity
@ 2005-06-16 12:38  Dave Cramer <pg@fastcrypt.com>
  parent: Minal <minalac@yes2etl.com>
  1 sibling, 0 replies; 7+ messages in thread

From: Dave Cramer @ 2005-06-16 12:38 UTC (permalink / raw)
  To: minalac@yes2etl.com; +Cc: pgsql-jdbc

Show me the output of echo $CLASSPATH when you run this.

Dave
On 16-Jun-05, at 6:20 AM, Minal wrote:

> I set the classpath, copied in the lib folder of web-inf. If I try  
> to run a simple java program shown below:
> import java.sql.*;
>
> public class Example1
> {
> public static void main(String[] argv)
> {
>   System.out.println("Checking if Driver is registerd");
>   try
>   {
>   Class.forName("org.postgresql.Driver");
>   }
>   catch(ClassNotFoundException cnfe)
>   {
>   System.out.println("Couldn't find the Driver");
>   cnfe.printStackTrace();
>   System.exit(1);
>   }
>   System.out.println("registered the Driver OK, so lets make a  
> connection");
>   Connection c = null;
>     try
>   {
>   c= DriverManager.getConnection("jdbc:postgresql://localhost/ 
> trainneedcorp","postgres","admin");
>   }
>   catch(SQLException se)
>   {
>   System.out.println("Couldnt connect");
>   se.printStackTrace();
>   System.exit(1);
>   }
>   if(c != null)
>   System.out.println("WE CONNECTED");
>   else
>   System.out.println("Reaching here is not done");
>   }
>   }
>   I get the following error:
>
> java.lang.ClassNotFoundException: org.postgresql.Driver
>       at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
>       at java.security.AccessController.doPrivileged(Native Method)
>       at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
>       at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
>       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
>       at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
>       at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
>       at java.lang.Class.forName0(Native Method)
>       at java.lang.Class.forName(Class.java:141)
>       at Example1.main(Example1.java:10)
>
>
> Dave Cramer wrote:
>
>
>> Hi,
>>
>> How are you trying to connect, what is the error message,   
>> specifically which lib directory of jakarta did you copy it into?
>>
>> Dave
>> On 16-Jun-05, at 2:46 AM, Minal wrote:
>>
>>
>>> Hi...
>>> I am novice user of Postgresql8.0.3. I managed to export the   
>>> database from sql server. We have all our application in JSP. I   
>>> want to install the org.postgresql.driver..
>>> I completed the following steps...
>>> 1.Downloaded the jar file from http://jdbc.postgres.org
>>> 2. Copied it in the lib folder of Jakarta..
>>> 3. Edited the pages to use the Driver..am still not able to  
>>> connect...
>>>
>>> Where am I going wrong??
>>> Minalac
>>>
>>> ---------------------------(end of   
>>> broadcast)---------------------------
>>> TIP 5: Have you checked our extensive FAQ?
>>>
>>>               http://www.postgresql.org/docs/faq
>>>
>>>
>>>
>>
>>
>>
>
>
>




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Postgresql-JDBC connectivity
@ 2005-06-17 04:45  Minal Aryamane <minalac@yes2etl.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Minal Aryamane @ 2005-06-17 04:45 UTC (permalink / raw)
  To: pavan@netcore.co.in; +Cc: pgsql-jdbc

i have this jar file and have copied it in /usr/local/tomcat/common/lib
path.....
This is the jar file I am using....
postgresql-8.0-311.jdbc3.jar
I did as you said but am still getting the same error....Am I using the
correct file???

Checking if Driver is registerd
Couldn't find the Driver
java.lang.ClassNotFoundException: org.postgresql.Driver
        at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:141)
        at Example1.main(Example1.java:10)




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Postgresql-JDBC connectivity
@ 2005-06-17 15:15  Prasanth <dbadmin@nqadmin.com>
  parent: Minal Aryamane <minalac@yes2etl.com>
  0 siblings, 0 replies; 7+ messages in thread

From: Prasanth @ 2005-06-17 15:15 UTC (permalink / raw)
  To: minalac@yes2etl.com; +Cc: pavan@netcore.co.in; pgsql-jdbc

Restart tomcat and try it again.

When you add a jar I always have to restart tomcat.

-Prasanth.

Minal Aryamane wrote:
> i have this jar file and have copied it in /usr/local/tomcat/common/lib
> path.....
> This is the jar file I am using....
> postgresql-8.0-311.jdbc3.jar
> I did as you said but am still getting the same error....Am I using the
> correct file???
> 
> Checking if Driver is registerd
> Couldn't find the Driver
> java.lang.ClassNotFoundException: org.postgresql.Driver
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
>         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
>         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Class.java:141)
>         at Example1.main(Example1.java:10)
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
> 
> 



^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2005-06-17 15:15 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-06-16 06:46 Postgresql-JDBC connectivity Minal <minalac@yes2etl.com>
2005-06-16 09:43 ` Dave Cramer <pg@fastcrypt.com>
2005-06-16 10:20   ` Minal <minalac@yes2etl.com>
2005-06-16 10:42     ` Tom Arthurs <tarthurs@jobflash.com>
2005-06-16 12:38     ` Dave Cramer <pg@fastcrypt.com>
2005-06-17 04:45 Re: Postgresql-JDBC connectivity Minal Aryamane <minalac@yes2etl.com>
2005-06-17 15:15 ` Prasanth <dbadmin@nqadmin.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox