Skip site navigation (1) Skip section navigation (2)

Re: link to Jsp

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Shavonne Marietta Wijesinghe <shavonne(dot)marietta(at)studioform(dot)it>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: link to Jsp
Date: 2008-03-27 18:02:31
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
Shavonne Marietta Wijesinghe wrote:
> Hello
> I'm trying to connect to my postgresql db from a JSP page but my db is on one computer and the jsp in another.. 
> Has anyone done something like this before??
>  private synchronized Connection getConnection() throws ClassNotFoundException,
>       SQLException {
>     final String DRIVER = "org.postgresql.Driver";
>     final String URL = "jdbc:postgresql:FormAjax";

Read the documentation for the PostgreSQL JDBC layer, particularly the
part about the JDBC URL. I quote:


In JDBC all url's begin with jdbc:protocol: This is the standard. After
this is driver specific, and no two drivers are the same.

So our url? It's one of the following:


where database is the database to connect to, host the server to connect
to, and port the port number.

If left out, host defaults to localhost (not see applets!) and
port to 5432 (configurable at build time).

Craig Ringer

In response to

  • link to Jsp at 2008-03-27 14:47:51 from Shavonne Marietta Wijesinghe

pgsql-sql by date

Next:From: chester c youngDate: 2008-03-27 19:24:05
Subject: returning on inserts
Previous:From: Erik JonesDate: 2008-03-27 15:24:39
Subject: Re: Finding all References to a Primary Key

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group