tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vassilis Atlamazoglou" <vat...@bioacademy.gr>
Subject accessing a database ...
Date Tue, 10 Aug 2004 08:32:48 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message