-   Programming (
-   -   jdbc connection in java (

balanagireddy 06-30-2004 11:15 PM

jdbc connection in java

Connection conn = DriverManager.getConnection("jdbc:odbc:<DSN NAME>")

I gave the DSN Name I Have in the control panel but how to give the DSN of
the data source located in some other PC.

What shuld above statement then??

tangleb1 07-01-2004 04:07 AM

Using the host name of your other machine (String hostName) and the database name (String databaseName), your URL will take the form (using postgres on port 5432 as an example):


Your other machine's database must be configured to accept external users, and you may need to supply username and password using:

DriverManager.getConnection(String url,
String user,
String password)


Galik 07-01-2004 06:42 AM

I think you have to make the (local) datasource in the ODBC configurator point to the (remote) maching running the database. I'm a bit rusty on this though...

All times are GMT -5. The time now is 08:01 PM.