Subject | Re: How to specify RoleName in the JNDI resource? |
---|---|
Author | Roman Rokytskyy |
Post date | 2002-11-14T16:33:03Z |
Hi,
Just for your information: you can pass any DPB parameter by
stripping the "isc_dpb_" from the DPB parameter name. In case of
roles this would be:
...my.gdb?sql_role_name=guest&lc_ctype=WIN1251
If Tomcat passes all parameters to the driver, you can try
<parameter>
<name>sql_role_name</name>
<value>guest</value>
</parameter>
Best regards,
Roman Rokytskyy
--- In Firebird-Java@y..., Jose Maria Lopez Lagunas <chema@v...>
wrote:
Just for your information: you can pass any DPB parameter by
stripping the "isc_dpb_" from the DPB parameter name. In case of
roles this would be:
...my.gdb?sql_role_name=guest&lc_ctype=WIN1251
If Tomcat passes all parameters to the driver, you can try
<parameter>
<name>sql_role_name</name>
<value>guest</value>
</parameter>
Best regards,
Roman Rokytskyy
--- In Firebird-Java@y..., Jose Maria Lopez Lagunas <chema@v...>
wrote:
> Hi.driver.
>
> I guess ROLES are not implemented in the current version of the
> I had a similar problem because we use roles too. To solve it Imodified
> the FBDriver.java filedoes).
> to accept roles by using the 'roleName' property (as InterClient
>changes
> This is what I modified (sorry for not submitting it, I did the
> yesterday and was testing my applications):this
>
> FBDriver.java
> ...
> public class FBDriver implements Driver {
> ...
> public static final String DATABASE = "database";
> public static final String ROLENAME = "roleName"; // I added
> field= "blob_buffer_length";
> public static final String BLOB_BUFFER_LENGTH
> ...specified.");
> public Connection connect(String url, java.util.Properties info)
> throws SQLException
> {
> ...
> if (password == null)
> throw new SQLException(
> "Password for database connection not
>(GDS.isc_dpb_sql_role_name,roleName);
> // THIS IS WHAT I MODIFIED
> /////////////////////////////////////////////////////////
> // extract the roleName
> String roleName = info.getProperty(ROLENAME);
> if (roleName == null)
> roleName =
> conCri.getStringProperty(GDS.isc_dpb_sql_role_name);
> else
> conCri.setProperty
> // Should I do that?the
>
> // Maybe it should ignore role if it is not found so
> next code might be removed("sysdba")))
> if ((roleName == null) && (!user.equalsIgnoreCase
> throw new SQLException(specified.");
> "User role for database connection not
>/////////////////////////////////////
> ////////////////////////////////////////////////////////////////////
>(FIREBIRD_PROTOCOL.length());
> // extract the database URL
> String databaseURL = url.substring
> ...to
>
>
> I hope this helps.
>
>
> Andrew Guts wrote:
>
> >Hello All,
> >
> >I've defined and used DataSource with Tomcat 4.1.2. Now it is time
> >test it under real account instead of SYSDBA user. My databasesecurity
> >based on roles. So how to provide role parameter to DateSource intype="javax.sql.DataSource"/>
> >server.xml?
> >
> >Thanks ahead
> >
> >Andrew
> >
> >PS: which place below?
> >
> > <Resource name="jdbc/FE2" auth="Container"
> > <ResourceParams name="jdbc/FE2"><value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
> > <parameter>
> > <name>factory</name>
> >
> > </parameter>lc_ctype=WIN1251</value>
> > <parameter>
> > <name>maxWait</name>
> > <value>5000</value>
> > </parameter>
> > <parameter>
> > <name>maxActive</name>
> > <value>4</value>
> > </parameter>
> > <parameter>
> > <name>username</name>
> > <value>TOMCAT</value>
> > </parameter>
> > <parameter>
> > <name>password</name>
> > <value>12345</value>
> > </parameter>
> > <parameter>
> > <name>url</name>
> >
> ><value>jdbc:firebirdsql:127.0.0.1/3050:/data/db?
> > </parameter>http://docs.yahoo.com/info/terms/
> > <parameter>
> > <name>driverClassName</name>
> > <value>org.firebirdsql.jdbc.FBDriver</value>
> > </parameter>
> > <parameter>
> > <name>maxIdle</name>
> > <value>2</value>
> > </parameter>
> > </ResourceParams>
> >
> >
> >
> >
> >
> >
> >To unsubscribe from this group, send an email to:
> >Firebird-Java-unsubscribe@y...
> >
> >
> >
> >Your use of Yahoo! Groups is subject to
> >
> >
> >
> >
> >