954,574 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

JSP along database

Hai..

I need to connect a database called "Postgresql" with a jsp code.
how it can be done?
I need the connection procedure for that.
plz reply me..

Thendral
Newbie Poster
14 posts since Feb 2007
Reputation Points: 10
Solved Threads: 0
 

Read the JDBC tutorials at Sun, the JDBC documentation for the PostGreSQL Driver (once you download it), and the J2EE tutorial at Sun.

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

I have postgresql in my system.also i created schema and table there. i need the coding for connecting that database and my JSP program.

Thendral
Newbie Poster
14 posts since Feb 2007
Reputation Points: 10
Solved Threads: 0
 

And I pointed you to resources that will enable you to do that. The first one will teach you how to use JDBC. The second one will provide you the specifics (read Connection URL) for PostGreSQL, the third one will help you integrate that information into JSP (and hopefully you will do it in the proper manner and use a bean or JSTL tag for accessing the DB rather than a scriptlet).

Here are the three resources as links:

http://java.sun.com/docs/books/tutorial/jdbc/index.html
http://jdbc.postgresql.org/doc.html
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/

I am not going to simply give you ready made code. Try it yourself, and if you have problems post your code here and we will help to correct it.

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

and learn proper separation of control. JSP are not meant for that.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You