LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


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

Rep: Reputation: 15
jdbc connection in java


Hi,

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
tangleb1
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):

"jdbcostgresql://"+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
 
Old 07-01-2004, 06:42 AM   #3
Galik
Member
 
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...
 
  


Reply



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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

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