• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

postgres connection using jsp

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all I am trying to connect to Postgres database using jsp at tomcat 5.5 server.can anyone help me out in this?I have added the jar file of postgres(postgresql-8.1-408.jdbc3.jar) in tomcat5.5\lib.But still iam gettting this errorIam getting this error when iam running this page.

my error is:

org.postgresql.util.PSQLException: Protocol error. Session setup failed.

my connection lines are:

Class.forName("org.postgresql.Driver");
dbcon = DriverManager.getConnection(loginUrl,loginUser,loginPasswd);

am i doing anything wrong? please Help me in this.

Thanking you,
Keerthi Malyala.
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can you please specify the login url you are using to connect.
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please ask JDBC questions in the JSBC forum. I have moved this post there for you.
 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
You try once with this code...

Class.forName("org.postgresql.Driver");
Connection conn=DriverManager.getConnection("jdbc:postgresql://URL address/databasename","infinity","infinity");
Statement stmt=conn.createStatement();
ResultSet rs = stmt.executeQuery(qry);
 
reply
    Bookmark Topic Watch Topic
  • New Topic