This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes Code to creat a Data Source Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Code to creat a Data Source" Watch "Code to creat a Data Source" New topic

Code to creat a Data Source

Aran King

Joined: Dec 10, 2001
Posts: 4
I am using an Access database for an application and I am wanting to make it as easy to set up on a windows machine as possible
Is there any way to set up a data source for a database using code instead of having to go to control panel and set it up manually.
any pointers much appreciated
Thanks Aran
Roy Ben Ami
Ranch Hand

Joined: Jan 13, 2002
Posts: 732
when u create a database in windows (like u do in access) you use the control panel thingie to describe a DSN which is just a name to refer to that database.
in most databases there is an option to use somthn called DSN-less connection that dont require u to set the DSN (but are mor complicated).
however access cant have a dsn-less connection so u have to do that thing in control panel (no other way).
for other databases visit this link
It is sorta covered in the JavaRanch Style Guide.
subject: Code to creat a Data Source
Similar Threads
how to set the the URL of database directly from the file
Hibernate - Database IP changes daily
Oracle JDBC connection using JNDI lookup
Servlet action is not available
Connect to MySql with JDBC