aspose file tools*
The moose likes JDBC and the fly likes Data source name not found and no default driver specified Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Data source name not found and no default driver specified" Watch "Data source name not found and no default driver specified" New topic
Author

Data source name not found and no default driver specified

siddharth das
Ranch Hand

Joined: Aug 17, 2007
Posts: 124
Hi,

I wrote a java program to connect database

The code is

But the connection is not happened, showing error
after loading....
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcConnection.initialize(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at TestJDBC.main(TestJDBC.java:18)

The database Oracle 11.2.0 Express edition.
I am not able to understand what exactly the problem.
Please suggest.

Thanks in advance,
Siddharth
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18669
    
    8



This looks like a JDBC URL which refers to an ODBC driver. But you don't want to use ODBC, you want to use Oracle's JDBC driver (which is a good choice). So check the documentation for your version of the JDBC driver and find out how to format the JDBC URL for that driver.
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3610
    
  60

Our Oracle FAQ contains links to a description of JDBC URL formats of Oracle drivers. Links to driver documentation are there too.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Data source name not found and no default driver specified