File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Alternative method of Connecting to database

 
amit smal
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Is there any way to connect to database without using class.forName("...")??

Regards,
Amit.
 
Ram Kumar Subramaniam
Ranch Hand
Posts: 68
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you could configure a DataSource and use it to get a connection to connect to the database.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Will be this be defined in system properties file??

Regards,
Amit.
 
Neeraj Dheer
Ranch Hand
Posts: 225
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
either in system properties file or at command line while running the app(if applicable)
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic