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
posted May 02, 2005 03:56:00
0
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)
subject: Alternative method of Connecting to database