Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Sql > Re: link to Jsp
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 3373 of 3717
Post > Topic >>

Re: link to Jsp

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
 




 2 Posts in Topic:
link to Jsp
shavonne.marietta@[EMAIL   2008-03-27 15:47:51 
Re: link to Jsp
craig@[EMAIL PROTECTED]   2008-03-28 03:02:31 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Oct 12 21:00:23 CDT 2008.