RE: Using MSAccess database for container authentication

2007-08-10 Thread Propes, Barry L
you did give it a DSN of some sort?
Do you have the correct driver or MDAC update?

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



I am trying to use an MSAccess database for container authentication in
Tomcat 5.5.23.  When I start Tomcat, I get this message in the
catalina.-MM-DD.log:

Aug 10, 2007 10:50:30 AM org.apache.catalina.realm.JDBCRealm start
SEVERE: Exception opening database connection
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not
found and no default driver specified
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcConnection.initialize(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcDriver.connect(Unknown Source)
at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:701)
at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:769)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1006)
at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at 
org.apache.catalina.core.StandardService.start(StandardService.java:448)
at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Aug 10, 2007 10:50:30 AM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled


I setup my realm in server.xml as follows:

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 /

where Auth.mdb is the name of my MSAccess database.  I configured Auth.mdb
in my ODBC Data Source Administrator, and I am able to access it and display
its tables from a Java application.

I am using Tomcat 5.5.23.

Has anyone used an MSAccess database via JDBC-ODBC for authentication in
Tomcat?  Can anyone tell me what I am doing wrong?

-- 
View this message in context: 
http://www.nabble.com/Using-MSAccess-database-for-container-authentication-tf4249487.html#a12093749
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]



Re: Using MSAccess database for container authentication

2007-08-10 Thread Daniel Stephens
didn't imply there was a need for additional jars. Just trying to make clear
he needed the one the one with that class. . Also didn't mean to complicate
it, just trying to help figure out where the issue was going.

On 8/10/07, Christopher Schultz [EMAIL PROTECTED] wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Daniel,

 Daniel Stephens wrote:
  Also, make sure that whatever jar file has this
  sun.jdbc.odbc.JdbcOdbcDriver class, is located in your tomcat
  common/lib.

 This is a standard class that comes with the Sun JRE. There is no need
 for any additional JAR files.

  As well as having a binding in your context.xml or web.xml like
  below. And have the datasource configured in the server.xml or
  equivalent(I think 5.5 sets up the Datasources a little different).
  but you'll need the following configured.

 The OP is using a JDBC realm, not configuring a DataSource. Don't
 complicate things, here.

 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.

 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.

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.7 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iD8DBQFGvJzU9CaO5/Lv0PARAgg1AJ90pWZ/jhYheC/bCL/uG+bHZAxPNACdF4Xb
 PQqTPRSwxn24giPvVRwlzxQ=
 =We8r
 -END PGP SIGNATURE-

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




Re: Using MSAccess database for container authentication

2007-08-10 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Daniel,

Daniel Stephens wrote:
 Also, make sure that whatever jar file has this 
 sun.jdbc.odbc.JdbcOdbcDriver class, is located in your tomcat
 common/lib.

This is a standard class that comes with the Sun JRE. There is no need
for any additional JAR files.

 As well as having a binding in your context.xml or web.xml like
 below. And have the datasource configured in the server.xml or
 equivalent(I think 5.5 sets up the Datasources a little different).
 but you'll need the following configured.

The OP is using a JDBC realm, not configuring a DataSource. Don't
complicate things, here.

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.

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.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGvJzU9CaO5/Lv0PARAgg1AJ90pWZ/jhYheC/bCL/uG+bHZAxPNACdF4Xb
PQqTPRSwxn24giPvVRwlzxQ=
=We8r
-END PGP SIGNATURE-

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



Re: Using MSAccess database for container authentication

2007-08-10 Thread Daniel Stephens
Also, make sure that whatever jar file has this
sun.jdbc.odbc.JdbcOdbcDriver class, is located in your tomcat common/lib. As
well as having a binding in your context.xml or web.xml like below. And have
the datasource configured in the server.xml or equivalent(I think 5.5 sets
up the Datasources a little different). but you'll need the follwing
configured..

   datasurce:
  Resource name=jdbc/AccessDS type=javax.sql.DataSource/
  ResourceParams name=jdbc/AccessDS
   parameternamefactory/namevalue
org.apache.commons.dbcp.BasicDataSourceFactory/value/parameter
parameternamemaxActive/namevalue10/value/parameter
parameternamemaxIdle/namevalue8/value/parameter
parameternameminIdle/namevalue5/value/parameter
parameternamemaxWait/namevalue1000/value/parameter
parameternameusername/namevalueusername/value/parameter
parameternamepassword/namevaluepassword/value/parameter
parameternamedriverClassName/namevalue
sun.jdbc.odbc.JdbcOdbcDriver/value/parameter
!-- This URL parameter may be different since it's jdbc.odbc --
parameternameurl/namevaluejdbc:oracle:thin:@host
:port:sid/value/parameter
!-- This URL parameter may be different since it's jdbc.odbc --

parameternameremoveAbandoned/namevaluetrue/value/parameter

parameternameremoveAbandonedTimeout/namevalue10/value/parameter
parameternamelogAbandoned/namevaluetrue/value/parameter
  /ResourceParams


resourcelink:
ResourceLink name=jdbc/AccessDS global=jdbc/AccessDS type=
javax.sql.DataSource /


this is meerly an example, you may have to search the web for the correct
way to bind it.

reference in web or context.xml
resource-ref
 res-ref-namejdbc/AccessDS/res-ref-name
 res-typejavax.sql.DataSource/res-type
 res-authContainer/res-auth
/resource-ref



On 8/10/07, Propes, Barry L [EMAIL PROTECTED] wrote:

 you did give it a DSN of some sort?
 Do you have the correct driver or MDAC update?

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



 I am trying to use an MSAccess database for container authentication in
 Tomcat 5.5.23.  When I start Tomcat, I get this message in the
 catalina.-MM-DD.log:

 Aug 10, 2007 10:50:30 AM org.apache.catalina.realm.JDBCRealm start
 SEVERE: Exception opening database connection
 java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name
 not
 found and no default driver specified
 at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
 at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
 at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(Unknown Source)
 at sun.jdbc.odbc.JdbcOdbcConnection.initialize(Unknown Source)
 at sun.jdbc.odbc.JdbcOdbcDriver.connect(Unknown Source)
 at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:701)
 at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:769)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java
 :1006)
 at org.apache.catalina.core.StandardEngine.start(
 StandardEngine.java:443)
 at org.apache.catalina.core.StandardService.start(
 StandardService.java:448)
 at org.apache.catalina.core.StandardServer.start(
 StandardServer.java:700)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
 Aug 10, 2007 10:50:30 AM org.apache.catalina.core.StandardHost start
 INFO: XML validation disabled


 I setup my realm in server.xml as follows:

 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 /

 where Auth.mdb is the name of my MSAccess database.  I configured Auth.mdb
 in my ODBC Data Source Administrator, and I am able to access it and
 display
 its tables from a Java application.

 I am using Tomcat 5.5.23.

 Has anyone used an MSAccess database via JDBC-ODBC for authentication in
 Tomcat?  Can anyone tell me what I am doing wrong?

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


 -
 To start a new topic, e-mail: users@tomcat.apache.org

Using MSAccess database for container authentication

2007-08-10 Thread remmons

I am trying to use an MSAccess database for container authentication in
Tomcat 5.5.23.  When I start Tomcat, I get this message in the
catalina.-MM-DD.log:

Aug 10, 2007 10:50:30 AM org.apache.catalina.realm.JDBCRealm start
SEVERE: Exception opening database connection
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not
found and no default driver specified
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcConnection.initialize(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcDriver.connect(Unknown Source)
at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:701)
at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:769)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1006)
at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at 
org.apache.catalina.core.StandardService.start(StandardService.java:448)
at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Aug 10, 2007 10:50:30 AM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled


I setup my realm in server.xml as follows:

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 /

where Auth.mdb is the name of my MSAccess database.  I configured Auth.mdb
in my ODBC Data Source Administrator, and I am able to access it and display
its tables from a Java application.

I am using Tomcat 5.5.23.

Has anyone used an MSAccess database via JDBC-ODBC for authentication in
Tomcat?  Can anyone tell me what I am doing wrong?

-- 
View this message in context: 
http://www.nabble.com/Using-MSAccess-database-for-container-authentication-tf4249487.html#a12093749
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]



Re: Using MSAccess database for container authentication

2007-08-10 Thread remmons


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]



RE: Using MSAccess database for container authentication

2007-08-10 Thread Propes, Barry L
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]