Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
ahmadiq
5 Post subject: connecting to MSAccess DB  PostPosted: Jun 13, 2006 - 08:43 AM



Joined: Jun 07, 2006
Posts: 2

Hi. I'm new to MyEclipse.

I'm trying to connect to an MS Access DB (resident on the local machine) through a servlet.

Code:

url = "jdbc:odbc:db";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection(url);


however i get :

Quote:

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


when i deploy it and access it.

the same url however seems to work fine with DBexplorer.

do i need to change my code? or do i need to access the table through DBexplorer? if so, how.

--
Ahmad
 
 View user's profile Send private message  
Reply with quote Back to top
support-snpe
Post subject:   PostPosted: Jun 13, 2006 - 01:33 PM
Moderator
Moderator


Joined: Feb 03, 2006
Posts: 1117

Ahmad,

Your code is correct, but driver can't find alias 'db' - What you think that it work in Db Explorer ?

If it work in Db Explorer then it have to work in yoour example.You have to add user and password, probably and define odbc alias

However, you can't work with hibernate and MS Access, because it doesn't exists dialect

Best regards
 
 View user's profile Send private message  
Reply with quote Back to top
ahmadiq
7 Post subject: issue resolved  PostPosted: Jun 13, 2006 - 02:22 PM



Joined: Jun 07, 2006
Posts: 2

the issue has been resolved. there was some problem with apache tomcat.

tomcat is installed as a service and I don't have administrative rights on the machine. One or both of these reasons need me to manually shutdown and startup the server once. My application runs fine afterwards.

thankyou for your help.

--
Ahmad
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits