tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bip Thelin <bip.the...@sf.razorfish.com>
Subject [PATCH] JDBCRealm problem with Oracle
Date Mon, 19 Jun 2000 02:24:48 GMT
Resolvs a problem i had when connecting with Oracledriver.

	..bip

Index: JDBCRealm.java
===================================================================
RCS file: /home/cvspublic/jakarta-tomcat/src/share/org/apache/tomcat/request/JDBCRealm.java,v
retrieving revision 1.4
diff -r1.4 JDBCRealm.java
121a122,131
>      * The connection URL to use when trying to connect to the databse
>      */
>     private String connectionName = null;
> 
>     /**
>      * The connection URL to use when trying to connect to the databse
>      */
>     private String connectionPassword = null;
> 
>     /**
207a218,235
>      * Set the name to use to connect to the database.
>      *
>      * @param connectionName User name
>      */
>     public void setConnectionName(String connectionName) {
>         this.connectionName = connectionName;
>     }
> 
>     /**
>      * Set the password to use to connect to the database.
>      *
>      * @param connectionPassword User password
>      */
>     public void setConnectionPassword(String connectionPassword) {
>         this.connectionPassword = connectionPassword;
>     }
> 
>     /**
364c392,399
<             dbConnection = DriverManager.getConnection(connectionURL);
---
>             if ((connectionName.equals("") || connectionName == null) &&
>                 (connectionPassword.equals("") || connectionPassword == null)) {
>                 dbConnection = DriverManager.getConnection(connectionURL);
>             } else {
>                 dbConnection = DriverManager.getConnection(connectionURL,
>                                                            connectionName,
>                                                            connectionPassword);
>             }
Index: JDBCRealm.howto
===================================================================
RCS file: /home/cvspublic/jakarta-tomcat/src/doc/JDBCRealm.howto,v
retrieving revision 1.2
diff -r1.2 JDBCRealm.howto
103a104,106
>    Optional:
>      connectionName -> The name to use when connecting to the database.
>      connectionPassword -> The password to use when connecting to the database.
113a117,126
>    - If you have problem connecting you can specify connectionName and connectionPassword:
> 
>     <RequestInterceptor className="org.apache.tomcat.realm.JDBCRealm"
>      debug="99"
>      driverName="oracle.jdbc.driver.OracleDriver"
>      connectionURL="jdbc:oracle:thin:@ntserver:1521:ORCL"
>      connectionName="scott"
>      connectionPassword="tiger"
>      userTable="users" userNameCol="user_name" userCredCol="user_pass"
>      userRoleTable="user_roles" roleNameCol="role_name" />
Index: server.xml
===================================================================
RCS file: /home/cvspublic/jakarta-tomcat/src/etc/server.xml,v
retrieving revision 1.24
diff -r1.24 server.xml
103c103,104
<                               "?user=scott;password=tiger"  
---
>               connectionName="scott"
>               connectionPassword="tiger"
107c108,109
<                             "?user=test;password=test"
---
>               connectionName="test"
>               connectionPassword="test"
108a111
>             "connectionName" and "connectionPassword" are optional.

Mime
View raw message