Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-30-2008, 01:17 PM
tim's Avatar
tim tim is offline
Senior Member
 
Join Date: Dec 2007
Location: South Africa
Posts: 323
tim is on a distinguished road
Setting the DSN
Hello everyone.

I'm self-studying JDBC and in the books and tutorials it says that the DSN for a database system must be set on the operating system, Windows in my case. How can this be done by Java code? I don't think that the end user should be doing this technical work.

Thank you.
__________________
If your ship has not come in yet then build a lighthouse.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 02-14-2008, 10:55 PM
jelly's Avatar
Member
 
Join Date: Jan 2008
Location: Somerset, UK
Posts: 46
jelly is on a distinguished road
Hi Tim, just in case you never found the answer to this. Strictly speaking you cannot set the DSN from Java but what you can do is make a JDBC connect without a DSN, usually referred to as a DSNless connection. In this case you specify from code the details that you would have put in th eDSN, e.g.

Code:
String connectionString = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=C:/dbs/salaries.MDB"; DBConn = DriverManager.getConnection(connectionString);
Masses on the net under dsnless connections if you need more
__________________
-- Hope that helps
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
JTextArea setting newtojava7 New To Java 1 01-29-2008 03:57 AM
Help with setting up Java itmasterw New To Java 6 01-19-2008 12:04 AM
Help with setting up please BlitzA New To Java 6 12-29-2007 01:54 PM
Setting cookies in JSP Java Tip Java Tips 0 12-10-2007 06:33 PM
Setting currency Java Tip Java Tips 0 11-16-2007 03:08 PM


All times are GMT +3. The time now is 07:03 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org