are you sure you have the right type driver for JDBC thru the web?

In your standalone Java app connecting to MS Access, is that thru the web? It's 
not is it?

maybe you should attempt to download another one.

http://developers.sun.com/product/jdbc/drivers



-----Original Message-----
From: remmons [mailto:[EMAIL PROTECTED]
Sent: Friday, August 10, 2007 2:10 PM
To: users@tomcat.apache.org
Subject: Re: Using MSAccess database for container authentication




Christopher Schultz-2 wrote:
> 
> 
> This is a standard class that comes with the Sun JRE. There is no need
> for any additional JAR files.
> 
> I would advise the OP to check online for how to connect Java to Access
> in general before adding Tomcat into the mix. Using MS Access requires
> you to setup an ODBC DataSource in Windows. Have you done that? Is it
> called "Auth"? The connection URL was "jdbc:odbc:Auth", so it should be.
> 
> 

Yes, sun.jdbc.odbc.JdbcOdbcDriver is in the Java distrubition rt.jar, and I
did not think it had to be added to Tomcat/common/lib, but I tried it
anyhow.  It had no effect.

Yes, I did set up and configure a DSN, named Auth, in the ODBC Data source
administrator.  I can connect to Auth via JDBC-ODBC from a stand alone Java
Application I wrote.  I am able to access Auth it and display its tables.  I
did state this in my original message.

The ODBC data source is definitely working, but I cannot get Tomcat to
connect to it.  The driver sun.jdbc.odbc.JdbcOdbcDriver is definitely
working because I use it in my stand alone Java application to connect to
Auth and display its tables.

I do not seem to be able to get Tomcat to connect to any ODBC data source. 
The ODBC administrator has a trace function.  When I access Auth from my
stand alone Java App, it generates a bunch of log entries in the ODBC log. 
When I start Tomcat, and try to open a secured document, zero entries are
generated in the ODBC log.  It is as if Tomcat does not know ODBC exists.


Christopher Schultz-2 wrote:
> 
> 
> I've never used Access with Java (or by itself, for that matter), but
> I've seen connection URLs like this, too:
> 
> "jdbc:odbc:;DRIVER=Microsoft Access Driver (*.mdb);
>                               DBQ=D:\\path_to_db\db.mdb;PWD=mypass"
> 
> This appears to define it's own data source instead of requiring you to
> create one in the control panel.
> 
> 

The server.xml Realm entry which I used (below) was copied directly from the
original server.xml supplied with Tomcat, where it was commented out.  I
commented out the Realm entry which directs Tomcat to use the
tomcat-users.xml file for authentication.  All I did was change
"jdbc:odbc:CATALINA" to "jdbc:odbc:Auth", and edit the names of the tables
and columns to reflect my actual MSAccess database.

<Realm  className="org.apache.catalina.realm.JDBCRealm"
        driverName="sun.jdbc.odbc.JdbcOdbcDriver"
        connectionURL="jdbc:odbc:Auth"
        userTable="User" userNameCol="UserName" userCredCol="Password"
        userRoleTable="User_Role" roleNameCol="RoleName" />


Do I need to make some other entry in server.xml?  Do I need to make an
entry in some other configuration file?

Thanks for any additional hints you can provide.


-- 
View this message in context: 
http://www.nabble.com/Using-MSAccess-database-for-container-authentication-tf4249487.html#a12097330
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to