by craig@[EMAIL PROTECTED]
(Craig Ringer)
Mar 28, 2008 at 03:02 AM
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 do***entation for the PostgreSQL JDBC layer, particularly the
part about the JDBC URL. I quote:
------------
The JDBC URL
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:
jdbc:postgresql:database
jdbc:postgresql://host/database
jdbc:postgresql://host:****t/database
where database is the database to connect to, host the server to connect
to, and ****t the ****t number.
If left out, host defaults to localhost (not 127.0.0.1 see applets!) and
****t to 5432 (configurable at build time).
-----------
--
Craig Ringer
--
Sent via pgsql-sql mailing list (pgsql-sql@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql