DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   JSP (http://www.daniweb.com/forums/forum24.html)
-   -   How do I access a PostgreSQL DB? (http://www.daniweb.com/forums/thread27810.html)

mmiikkee12 Jul 9th, 2005 10:24 pm
How do I access a PostgreSQL DB?
 
I just got a JSP hosting account and I'm wondering how I can connect to the PostgreSQL DB and execute queries. According to the host's FAQ, the database URL is:
jdbc:postgresql://localhost/username,username,password
.

keibi Jul 10th, 2005 7:14 am
Re: How do I access a PostgreSQL DB?
 
You don't access databases through JSP. JSP comes paired up with servlets written in Java. The servlets (and underlying classes) does all the heavy work, while the JSPs just view the results.

mmiikkee12 Jul 10th, 2005 11:51 am
Re: How do I access a PostgreSQL DB?
 
You can't just do it with
<%
DB access code here
%>
?

keibi Jul 10th, 2005 11:59 am
Re: How do I access a PostgreSQL DB?
 
No idea, I never tried. I manage my database connections with Hibernate (persistence framework), and put only view code in the jsp's.

mmiikkee12 Jul 16th, 2005 12:30 am
Re: How do I access a PostgreSQL DB?
 
Anyway, what's the Java code for accessing the DB?


All times are GMT -4. The time now is 2:02 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC