This week's book giveaway is in the JDBC forum.
We're giving away four copies of Make it so: Java DB Connections & Transactions and have Marcho Behler on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Data source name not found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Data source name not found" Watch "Data source name not found" New topic

Data source name not found

ankur tyagi
Ranch Hand

Joined: Apr 01, 2009
Posts: 49
I ran this program to check the connection between my tomcat and JDBC
as i was having some problems in my web application..

result is
Good till now
SQLException is this: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified SQLState : IM002 VendorError: 0
Hello World. Sun... 1.4
can someone explain what to do??
Vijitha Kumara

Joined: Mar 24, 2008
Posts: 3901

What driver are you using? And did you check the correct URL for your for the DB in the documentation?

[How to ask questions] [Twitter]
Devaka Cooray
ExamLab Creator

Joined: Jul 29, 2008
Posts: 3794

moving to JDBC forum.

Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- Home -- Twitter -- How to Ask a Question
him jain
Ranch Hand

Joined: Feb 05, 2010
Posts: 56
No, I don't think there's any mistake with the URL. There is problem of system configuration definitely.
I have kept a working code along with configuration here:

Hope it helped..
Would like to help if still any problem exists.
Also, check your configuration for jdbc if you're using windows.

--Himanshu Jain
ankur tyagi
Ranch Hand

Joined: Apr 01, 2009
Posts: 49
the connection with jdbc was working fine when called from a class..
the problem started only when i started servlet.
previously a servlet was calling a class that had the code to get data from database but because of the problem
i tried putting all the code in the servlet only...
but still there is problem..
Jan Cumps

Joined: Dec 20, 2006
Posts: 2562

1: check if you made a system data source, not a user data source
2: switch to Oracle jdbc driver. I don't reccomend using the jdbcodbc driver to connect to Oracle.

OCUP UML fundamental and ITIL foundation
ankur tyagi
Ranch Hand

Joined: Apr 01, 2009
Posts: 49
problem is solved ..
i was using user dsn but after creating a system dsn , its working
thanks every one...
I agree. Here's the link:
subject: Data source name not found
It's not a secret anymore!