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 Loading Driver automatically 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 "Loading Driver automatically" Watch "Loading Driver automatically" New topic
Author

Loading Driver automatically

faisal hameed
Ranch Hand

Joined: Jan 19, 2009
Posts: 48
I am using sql DataBase.I create connection using the following code.How can i load driver automatically without makin DSN in DataSources(ODBC).And how can i use my table in my Project Folder instead of in Sql folder, where i install sql server.



Regards, M Faisal Hameed
PUCIT, Pakistan
Ashwin Bangar
Greenhorn

Joined: Jul 02, 2009
Posts: 10
Hello Faisal,
You are using Type-1 Driver for JDBC connection, instead of that try to use thin driver i.e. Type-3 driver. in that you have to specify the "vendor related url".
One more thing is that you are using sql, what does that mean, MS-Sql server or MySql or Oracle or something else...
so depending on the Sql you are using you have to specify the url in
String conURL = "jdbc:Odbc:dBServlet";



SCJP 5
Now Moving for SCWCD and then for OCA & OCP
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Loading Driver automatically
 
Similar Threads
SQL server weird connection problem-Pls help
Java Database Connectivity
File Dsn Problem?
Event in jButton
how to convert .csv files into sql server files using java