473,651 Members | 2,466 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

java.sql.SQLExc eption: [Microsoft][ODBC Driver Manager] Data source name not found a

19 New Member
I am get this error

java.sql.SQLExc eption: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified


my code for connection is
Expand|Select|Wrap|Line Numbers
  1. {   
  2. Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
  3. con=DriverManager.getConnection("jdbc:odbc:MyDataSource1");
  4. ps=con.prepareStatement("Select * from Reservation where TravelDate=? and FlightNo=?");
  5. ps.setString(1,t1.getText());
  6. ps.setString(2,t2.getText());
  7. rs=ps.executeQuery();
  8. rs.next();
  9. t3.setText(Integer.toString(rs.getInt(3)));
  10. t4.setText(Integer.toString(rs.getInt(4)));
  11. t5.setText(Integer.toString(rs.getInt(5)));
  12. con.close();
  13. }
  14.  
Mar 30 '07 #1
12 31981
r035198x
13,262 MVP
hi,
iam get this error

java.sql.SQLExc eption: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

my code for connection is
Expand|Select|Wrap|Line Numbers
  1. Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
  2. con=DriverManager.getConnection("jdbc:odbc:MyDataSource1");
  3. ps=con.prepareStatement("Select * from Reservation where TravelDate=? and FlightNo=?");
  4. ps.setString(1,t1.getText());
  5. ps.setString(2,t2.getText());
  6. rs=ps.executeQuery();
  7. rs.next();
  8. t3.setText(Integer.toString(rs.getInt(3)));
  9. t4.setText(Integer.toString(rs.getInt(4)));
  10. t5.setText(Integer.toString(rs.getInt(5)));
  11. con.close();
  12. }
  13.  
Just like the error said. You did not create the datasource. What paltform are you using and which database are you trying to connect to?
Mar 30 '07 #2
bhanu08
19 New Member
Just like the error said. You did not create the datasource. What paltform are you using and which database are you trying to connect to?
iam working on windows XP and iam using MS acess
I tried to creat a DSN but having a doubt weather i have to creat USER DSNor SYSTEM DSN
Mar 30 '07 #3
r035198x
13,262 MVP
iam working on windows XP and iam using MS acess
I tried to creat a DSN but having a doubt weather i have to creat USER DSNor SYSTEM DSN
Create a user DSN
Mar 30 '07 #4
bhanu08
19 New Member
Create a user DSN
still getting same error
Mar 30 '07 #5
r035198x
13,262 MVP
still getting same error
Did you complete all the required steps for creating the datasource?
Tell us how you did it.
Mar 30 '07 #6
bhanu08
19 New Member
i clicked ODBC Data Source Adminstrator
then
clicked User DSN
then
clicked Add
then selected
Driver Do Microsoft Access
then
clicked select and then browsed the .mdb file and clicked ok
this is the thing i did
Mar 30 '07 #7
r035198x
13,262 MVP
i clicked ODBC Data Source Adminstrator
then
clicked User DSN
then
clicked Add
then selected
Driver Do Microsoft Access
then
clicked select and then browsed the .mdb file and clicked ok
this is the thing i did
After add, select

Microsoft Acces Driver (*.mdb)
Mar 30 '07 #8
bhanu08
19 New Member
After add, select

Microsoft Acces Driver (*.mdb)
created but getting the same error
Mar 30 '07 #9
bhanu08
19 New Member
created but getting the same error
IS there any 1 to help me
Apr 1 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

1
9474
by: Tim Groulx | last post by:
Hello All, I am getting the following error when attemping to open a table in SQL2kSP3a. ________________________________________ SQL Server Enterprise Manager Database Server: Microsoft SQL Server Version: 08.00.0760 Runtime Error: Invalid time format
10
20999
by: FreeOperator | last post by:
Dear all, On Win2000 server with SP3, I am trying to access a SQL Server 7.0 database, "TestDB", from VB6 via a SQL Server ODBC system DSN using ADO 2.7. In SQL Server Enterprise Manager, there is a login named "Tester". In its property window, NO "Server Roles" was assigned but its "Database Access" was set to "TestDB". This login was also made as the user of "TestDB" with "public", "db_datareader" and "db_datawriter" selected as its...
8
40631
by: Dakkar | last post by:
I wrote a program with c# for connecting mysql and taking data from it but when someone without me try to execute the program they are taking this error ERROR Data source name not found and no default driver
4
47518
by: cipher | last post by:
Hello, I'm creating a webservice that needs to query an Access database (mdb). Here's my code: OdbcConnection *pConnection = new OdbcConnection("Driver={Microsoft Access Driver (*.mdb)};DSN=MyDatasource"); try { pConnection->Open();
0
5910
by: jwtulp | last post by:
Hello all, I receive the following error when updating MSAccess2003 Memo fields using an ODBC connection in ASP.Net 1.1 when the length of the text to be updated exceeds 255 characters. Everything works fine when the length of the text stays below 255 characters. Does anyone have a clue?: ERROR Invalid precision value
0
755
by: bazzer | last post by:
hey, i am using visual basic.net 2003 and have an ASP.NET webform application thats accessing a microsoft access 2003 database. i kept getting the following error when i tried to run it: ERROR General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x8fc Thread 0x934 DBC 0x437b94 Jet'. ERROR Driver's SQLSetConnectAttr failed ERROR General error Unable to open registry key 'Temporary (volatile) Jet DSN...
0
12032
by: bazzer | last post by:
hey, im trying to access a microsoft access database from an ASP.NET web application in visual basic 2003.NET. i get the following error when i try running it: Server Error in '/CinemaBookingSystem' Application. -------------------------------------------------------------------------------- ERROR General error Unable to open registry key 'Temporary (volatile) Jet DSN for process
2
6593
by: MrByte | last post by:
Hi Folks, I'm having a strange situation here between 2 Linked MS SQL 2K servers. One of the servers died recently and I rebuilt it. All seems to be working fine, except that when I create views that access tables on the other (linked) server, I can not modify any data, because I get the Invalid object name server.database.dbo.TableName error. The View does work fine otherwise, ie displays the data in it, I just can't modify. The...
1
4214
by: harsha1302 | last post by:
Hi all i am trying to connect my application written in jsp to the database and i am receiving this exception java.sql.SQLException: Data source name not found and no default driver specified i have tried and added the DSN name kindly help me out please
0
8349
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8795
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8695
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8576
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6157
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4281
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2696
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1585
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.