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 > link to Jsp
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 3373 of 3559
Post > Topic >>

link to Jsp

by shavonne.marietta@[EMAIL PROTECTED] ("Shavonne Marietta Wijesinghe") Mar 27, 2008 at 03:47 PM

This is a multi-part message in MIME format.

------=_NextPart_000_012D_01C89021.EA38A340
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

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..=20

Has anyone done something like this before??

 private synchronized Connection getConnection() throws =
ClassNotFoundException,
      SQLException {
    final String DRIVER =3D "org.postgresql.Driver";
    final String URL =3D "jdbc:postgresql:FormAjax";
    final String USERNAME =3D "postgres";
    final String PASSWORD =3D "form";
 =20
    Class.forName(DRIVER);
 =20
    return DriverManager.getConnection(URL, USERNAME, PASSWORD);
 }

Thanks

Shavonne Wijesinghe

------=_NextPart_000_012D_01C89021.EA38A340
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.6000.16608" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hello</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I'm trying to connect to my postgresql =
db from a=20
JSP page but my db is on one computer and the jsp in another.. =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Has anyone done something like this=20
before??</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;private synchronized Connection=20
getConnection() throws =
ClassNotFoundException,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
SQLException {<BR>&nbsp;&nbsp;&nbsp; final String DRIVER =3D=20
"org.postgresql.Driver";<BR>&nbsp;&nbsp;&nbsp; final String URL =3D=20
"jdbc:postgresql:FormAjax";<BR>&nbsp;&nbsp;&nbsp; final String USERNAME =
=3D=20
"postgres";<BR>&nbsp;&nbsp;&nbsp; final String PASSWORD =3D =
"form";<BR>&nbsp;=20
<BR>&nbsp;&nbsp;&nbsp; Class.forName(DRIVER);<BR>&nbsp; =
<BR>&nbsp;&nbsp;&nbsp;=20
return DriverManager.getConnection(URL, USERNAME,=20
PASSWORD);<BR>&nbsp;}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Shavonne =
Wijesinghe<BR></FONT></DIV></BODY></HTML>

------=_NextPart_000_012D_01C89021.EA38A340--
 




 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
tan13V112 Sun Jul 6 21:44:23 CDT 2008.