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
.

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.

You can't just do it with

<%
DB access code here
%>

?

No idea, I never tried. I manage my database connections with Hibernate (persistence framework), and put only view code in the jsp's.

Anyway, what's the Java code for accessing the DB?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.