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> </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> </DIV>
<DIV><FONT face=3DArial size=3D2>Has anyone done something like this=20
before??</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> private synchronized Connection=20
getConnection() throws =
ClassNotFoundException,<BR> =20
SQLException {<BR> final String DRIVER =3D=20
"org.postgresql.Driver";<BR> final String URL =3D=20
"jdbc:postgresql:FormAjax";<BR> final String USERNAME =
=3D=20
"postgres";<BR> final String PASSWORD =3D =
"form";<BR> =20
<BR> Class.forName(DRIVER);<BR> =
<BR> =20
return DriverManager.getConnection(URL, USERNAME,=20
PASSWORD);<BR> }</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Shavonne =
Wijesinghe<BR></FONT></DIV></BODY></HTML>
------=_NextPart_000_012D_01C89021.EA38A340--