Hi all,
Can some ona help me with some examples of how to connect a PostgreSQL
databas via an java Applet anything would be more then welcome.
Thanks in forward,
Jesse
AFAIU...
i haven't tried connecting to an external resource from an applet. You
might find all kinds of nasties in java permissions and html source
tainting.
assuming none of those apply, you could do this...
1) define a Driver class. get the jdbc driver from the postgres site
and install it in your classpath
2) set a driver class for the postgres jdbc driver
try{
Class.forName("org.postgresql.Driver");
}
catch (ClassNotFoundException cnfe){
// crash and burn
}
3) make a connection to that driver passing your db credentials in
try {
Connection =
DriverManager.getConnection("jdbc
ostgresql:<dbname>", <uid>,
<passwd>);
catch (SQLException sqle) {
// crash and burn
}
you should be able to access the db given all of the nasties haven't
got you.
HTH
kev.