jdbc connection in java
Hi,
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?? |
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):
"jdbc:postgresql://"+hostName+":5432/"+databaseName 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) tangleb1 |
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 06:57 PM. |