Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Data source name not found and no default driver specified

 
siddharth das
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Pie
Posts: 20771
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
Pie
Posts: 3751
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Our Oracle FAQ contains links to a description of JDBC URL formats of Oracle drivers. Links to driver documentation are there too.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic