This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JDBC and the fly likes Alternative method of Connecting to database 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 "Alternative method of Connecting to database" Watch "Alternative method of Connecting to database" New topic
Author

Alternative method of Connecting to database

amit smal
Greenhorn

Joined: Mar 17, 2005
Posts: 10
Hi all,
Is there any way to connect to database without using class.forName("...")??

Regards,
Amit.
Ram Kumar Subramaniam
Ranch Hand

Joined: Jan 17, 2003
Posts: 68
you could configure a DataSource and use it to get a connection to connect to the database.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Class.forName() doesn't connect to a database, it loads the driver. You can also load the driver using -Djdbc.driver=<driver class>
amit smal
Greenhorn

Joined: Mar 17, 2005
Posts: 10
Will be this be defined in system properties file??

Regards,
Amit.
Neeraj Dheer
Ranch Hand

Joined: Mar 30, 2005
Posts: 225
either in system properties file or at command line while running the app(if applicable)
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Alternative method of Connecting to database
 
Similar Threads
Sharing data between web app's
Large Files
share data
Tech Word Game
Shopping Cart - Part 2