the data sources can always be deployed with different id/pwds. jdbc is supporting ds.getconnection(id, pwd) for the sake of flexibility so that any valid user can access connection to database using a ds, when ds is deployed with a different set of id/pwd. this code change is not changing any existing behavior , but just adding for complete support of ds.getconnection(). if the admin deployed 10 different ds with 10 different id/pwd, the das user can use das config without specifying any id/pwd for connection and it will work as before. but in case the admin choses to deploy only 1 ds with 1 id/pwd, das user will have the privilege to obtain connection by supplying id/pwd in das config.
On Nov 13, 2007 7:21 AM, Luciano Resende <[EMAIL PROTECTED]> wrote: > Any reason why this can't be setup during data source configuration ? > If different applications requires different configuration, such as > username and password, the administrator could configure multiple data > sources. I'm just trying to avoid the scenario where, after a password > change, now I have to go to every application and change the DAS > config file to set new username/password. > > Thoughts ? > > > On Nov 11, 2007 11:34 PM, Amita Vadhavkar <[EMAIL PROTECTED]> wrote: > > In a multi user system, it is possible that the data source is > > deployed using one id/pwd and > > connections are obtained by different users (different user id/pwd) > > using the same deployed data source. > > > > See - > > http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/ad/cjvjcsup.htm > > Use the second form if you need to specify a user ID and password for > > the connection that are different from the ones that were specified > > when the DataSource was deployed. > > > > http://download-west.oracle.com/docs/cd/B14099_19/web.1012/b14012/datasrc.htm#i1085287 > > This user name and password overrides the user name and password that > > are defined in the data source definition. > > > > This is the reason why it will be useful to support this second form > > in RDB DAS so as to support full scaled systems > > > > Regards, > > Amita > > > > > > On Nov 9, 2007 11:31 AM, Luciano Resende <[EMAIL PROTECTED]> wrote: > > > Hi Amita > > > > > > I finally found some time to spend on this issue, and had a > > > question in mind. When using datasource, what's the difference from > > > the username and password that can be defined on the datasource > > > itself, and the one a user set on the connection property inside the > > > das config ? > > > > > > In order to test this, here is what I did : > > > - created a secured derby database (requires username/password) > > > - configureda datasource in TC, specifying the username, password > > > > > > <Resource name="jdbc/dastest" > > > type="javax.sql.DataSource" > > > auth="Container" > > > description="Derby database for DAS Samples" > > > maxActive="100" maxIdle="30" > > > maxWait="10000" username="dastest" > > > password="dastest" > > > > > > driverClassName="org.apache.derby.jdbc.EmbeddedDriver" > > > > > > url="jdbc:derby:D:/Opensource-Servers/apache-tomcat-5.5.20/Databases/dastest;create=true"/> > > > > > > - use a das config pointing to a datasource, without specifying > > > connectionProperties. > > > > > > And this worked fine for me, using a slightly modified company-webapp > > > sample. I also remember trying very similar datasource with MySQL and > > > having no problems... > > > > > > In witch case we would need to use the username/password from the das > > > config, instead of the one configured with the datasource ? > > > > > > > > > On Oct 30, 2007 12:40 AM, Amita Vadhavkar <[EMAIL PROTECTED]> wrote: > > > > The requirement was a bit hidden inside below mail thread > > > > http://www.mail-archive.com/[email protected]/msg23299.html > > > > > > > > Below is the JIRA issue for it. > > > > https://issues.apache.org/jira/browse/TUSCANY-1698 > > > > > > > > checked so far that tomcat BasicDataSource.getConnection() does not > > > > support > > > > passing in params for username and password. > > > > This may be how the current code that uses getConnection(no param) > > > > worked so > > > > far. > > > > > > > > But other app servers like WebSphere, or if users of Tomcat opt to use a > > > > different connection pool than the one > > > > supplied by Tomcat, may need getConnection(userName, password). So to > > > > keep > > > > things generic, DAS can use userName/password > > > > when available in config. In case of exception upon usage or if > > > > userName/password not present in Config, DAS can > > > > attempt getConnection(no params) - the way it is doing today. > > > > > > > > We can use the current config as is without any changes like below - > > > > > > > > <xsd:complexType name="ConnectionInfo"> > > > > <xsd:sequence> > > > > <xsd:element maxOccurs="1" minOccurs="0" > > > > name="ConnectionProperties" type="config:ConnectionProperties"/> > > > > </xsd:sequence> > > > > <xsd:attribute name="dataSource" type="xsd:string"/> > > > > <xsd:attribute name="managedtx" type="xsd:boolean" > > > > default="true"/> > > > > </xsd:complexType> > > > > > > > > <xsd:complexType name="ConnectionProperties"> > > > > <xsd:attribute name="driverClass" type="xsd:string"/> > > > > <xsd:attribute name="databaseURL" type="xsd:string"/> > > > > <xsd:attribute name="loginTimeout" type="xsd:int" > > > > default="0"/> > > > > <xsd:attribute name="userName" type="xsd:string" default=""/> > > > > <xsd:attribute name="password" type="xsd:string" default=""/> > > > > </xsd:complexType> > > > > > > > > When ConnectionProperties contain userName, password they will be used > > > > to > > > > obtain connection (DriverManaged based or DS based). > > > > e.g. > > > > DataSource - > > > > <ConnectionInfo dataSource="java:comp/env/jdbc/ajaxdastest"> > > > > <ConnectionProperties > > > > userName="dastest" > > > > password="dastest" > > > > /> > > > > </ConnectionInfo> > > > > > > > > DriverManager - > > > > <ConnectionInfo> > > > > <ConnectionProperties > > > > driverClass="com.mysql.jdbc.Driver" > > > > databaseURL="jdbc:mysql://localhost/dastest" > > > > userName="dastest" > > > > password="dastest" > > > > loginTimeout="600000"/> > > > > </ConnectionInfo> > > > > > > > > Suggestions? > > > > > > > > Regards, > > > > Amita > > > > > > > > > > > > > > > > -- > > > Luciano Resende > > > Apache Tuscany Committer > > > http://people.apache.org/~lresende > > > http://lresende.blogspot.com/ > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > > Luciano Resende > Apache Tuscany Committer > http://people.apache.org/~lresende > http://lresende.blogspot.com/ > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
