File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes how we can create database connection dynamically. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "how we can create database connection dynamically." Watch "how we can create database connection dynamically." New topic
Author

how we can create database connection dynamically.

ashish jadhav
Ranch Hand

Joined: Nov 20, 2008
Posts: 62
Hi,
i want create one application in that application we read DSN name,table name,url etc. database related information and as per that information i want to create DB connection.means when any user can change only text file data from that data connect to perticular DB. please help me
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2896
    
    1

Use .properties file to load the DSN , user name, etc information from the file. Use Properties class to read file data OR Use java properties file example to get more information.


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
ashish jadhav
Ranch Hand

Joined: Nov 20, 2008
Posts: 62
Thanks sagar..
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2896
    
    1

You're welcome
ashish jadhav
Ranch Hand

Joined: Nov 20, 2008
Posts: 62
Hi sagar,

I have developed a DB application, using this web application we can connect to any DB and TABLE. Just we have to type DB name and TABLE name in the properties file in key-value pair format.
when our web application runs it automatically read table related information from properties file and connect to specified table.
Now i want to create my own API for this application, so we can use this application anywhere through API.
Do you have any idea??please inform me.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: how we can create database connection dynamically.
 
Similar Threads
Programatically Creating Contriggerbean
How create API for DB application.
Reading fields' information of DataBase
Creating connection pool and data source dynamically
dynamic database connection