tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aris Javier" <aristotle.jav...@eazix.com>
Subject RE: accessing a database ...
Date Tue, 10 Aug 2004 08:50:34 GMT
conflict arises when you use tomcat as a service and declared both user
and system dsn..
system dsn should prevail. delete user dsn.



-----Original Message-----
From: Vassilis Atlamazoglou [mailto:vatlam@bioacademy.gr] 
Sent: Tuesday, August 10, 2004 4:33 PM
To: Tomcat Users List
Subject: accessing a database ...


Hi,
I have a database in MS Access which has a system DSN (and a user DSN)
in ODBC Data Source Administrator of Windows XP. I can access the data
with
      Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
      Connection c = DriverManager.getConnection("jdbc:odbc:odbc_exmp");

with a simple executable java file. But I cannot have access  with the a
simple servlet via tomcat.

BUT when I changed to
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

    Connection
c=DriverManager.getConnection("jdbc:odbc:Driver={Microsoft
Access Driver (*.mdb)};DBQ=C:\\vatlam\\db\\odbc_exmp.mdb");

IT WORKED!

What might be the problem?
AND ESPECIALLY what I must change in order to access a MS SQL database.

Thank you very much in advance for your help!


Vassilis

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message