so in one connection string you have user and in the Realm you're using 
userName?

-----Original Message-----
From: Richard Sayre [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 13, 2007 12:42 PM
To: users@tomcat.apache.org
Subject: Tomcat 6, SQL Server 2005 JDBC Realm not working


I have a web app that connects to my SQL Server 2005 Database with no
trouble using this code:

  Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
            con =
DriverManager.getConnection("jdbc:sqlserver://server-2006;databaseName=v362;user=user;password=dbase");

My application runs fine and I can see data from the database.

Now when I try to set up a Realm to do Database authentication I get an error:

<Realm  className="org.apache.catalina.realm.JDBCRealm" debug="99"
             driverName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
          
connectionURL="jdbc:sqlserver://server-2006;databaseName=v362;userName=user;password=dbase"
          connectionName="user"
          connectionPassword="dbase"
          digest="SHA"
              userTable="PPMUser" userNameCol="UserName"
userCredCol="UserPassword"
userRoleTable="PPMUser" roleNameCol="RoleTomcat" />

Exception:

13-Jun-2007 3:56:00 PM org.apache.catalina.realm.JDBCRealm authenticate
SEVERE: Exception performing authentication
java.sql.SQLException: com.microsoft.sqlserver.jdbc.SQLServerDriver
        at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:691)
        at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:346)
        at 
org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:181)
        at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:491)
        at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
        at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
        at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
        at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
        at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Unknown Source)

The strange thing is, if I set up a DSN under Windows and use the Sun
ODBC driver the authentication realm works:

<Realm  className="org.apache.catalina.realm.JDBCRealm" debug="99"
             driverName="sun.jdbc.odbc.JdbcOdbcDriver"
          connectionURL="jdbc:odbc:v362"
          connectionName="user"
          connectionPassword="dbase"
          digest="SHA"
              userTable="User" userNameCol="UserName" userCredCol="UserPassword"
          userRoleTable="User" roleNameCol="RoleTomcat" />


Does any one have this type of authentication working with MS SQL
Server 2005 JDBC driver under Tomcat 6?

Thank you,

Rich

---------------------------------------------------------------------
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