Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 06-30-2004, 11:15 PM   #1
Registered: Sep 2003
Location: India
Distribution: redhat linux 9.0
Posts: 46

Rep: Reputation: 15
jdbc connection in java


Connection conn = DriverManager.getConnection("jdbcdbc:<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??
Old 07-01-2004, 04:07 AM   #2
LQ Newbie
Registered: Aug 2003
Posts: 1

Rep: Reputation: 0
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)

Old 07-01-2004, 06:42 AM   #3
Registered: Mar 2003
Location: UK
Distribution: gentoo
Posts: 67

Rep: Reputation: 15
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...


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Java JDBC driver mickeyboa Fedora 2 07-23-2005 07:53 AM
JDBC connection in java balanagireddy Programming 1 06-30-2004 07:34 AM
JDBC PROBLEM (JAVA using JCreator) keikun_naruchan Programming 3 06-04-2004 02:02 AM
I was working with jdbc in java in which we need navalarora Linux - Software 0 12-05-2003 06:41 AM
java.lang.NullPointerException in JDBC test chr15t0 Programming 2 07-07-2003 11:08 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:20 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration