File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes postgres connection using jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "postgres connection using jsp" Watch "postgres connection using jsp" New topic

postgres connection using jsp

keerthi malyala

Joined: Jul 14, 2006
Posts: 5
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:

dbcon = DriverManager.getConnection(loginUrl,loginUser,loginPasswd);

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

Thanking you,
Keerthi Malyala.
Kamesh Rao
Ranch Hand

Joined: Dec 24, 2006
Posts: 35
can you please specify the login url you are using to connect.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63542

Please ask JDBC questions in the JSBC forum. I have moved this post there for you.

[Asking smart questions] [About Bear] [Books by Bear]
siva sankar
Ranch Hand

Joined: Jul 13, 2006
Posts: 68
You try once with this code...

Connection conn=DriverManager.getConnection("jdbc:postgresql://URL address/databasename","infinity","infinity");
Statement stmt=conn.createStatement();
ResultSet rs = stmt.executeQuery(qry);
Don't get me started about those stupid light bulbs.
subject: postgres connection using jsp
It's not a secret anymore!