Re: link to Jsp

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: link to Jsp
Дата
Msg-id 47EBE137.8060009@postnewspapers.com.au
обсуждение исходный текст
Ответ на link to Jsp  ("Shavonne Marietta Wijesinghe" <shavonne.marietta@studioform.it>)
Список 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:

------------
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:port/database

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 127.0.0.1 see applets!) and
port to 5432 (configurable at build time).
-----------

--
Craig Ringer


В списке pgsql-sql по дате отправления:

Предыдущее
От: Erik Jones
Дата:
Сообщение: Re: Finding all References to a Primary Key
Следующее
От: chester c young
Дата:
Сообщение: returning on inserts