db-ojb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guillaume Laforge <glafo...@gmail.com>
Subject Re: Problem with repository.xml outside war-File
Date Wed, 03 Aug 2005 14:52:16 GMT
On 03/08/05, christine.gerstenmayer@r-it.at
<christine.gerstenmayer@r-it.at> wrote:
> But when I regard this example, it does not solve the problem with the
> password-change of the db-user:
> 
> 
>  <jdbc-connection-descriptor
>      jcd-alias="default"
>      default-connection="true"
>      platform="Sapdb"
>      jdbc-level="2.0"
>      jndi-datasource-name="java:DefaultDS"
>      username="sa"             <-------------
>      password=""               <------------------
>      eager-release="false"
>      batch-mode="false"
>      useAutoCommit="0"
>      ignoreAutoCommitExceptions="false"

I'm by no means an OJB expert, but I think the username and password
attributes shouldn't be placed in the jdbc-connection-descriptor, but
are set in your datasource definition in JNDI or some other
configuration files (depending on your app server).

For instance, under Tomcat 5, you can define a MyWebApp.xml in
TOMCAT_HOME/conf/catalina/localhost where you define your datasource:

<Context path="/MyWebApp" unpackWARs="true" docBase="MyWebApp.war">

<!-- Tomcat 5.5 configuration -->
<!--
	<Resource name="jdbc/Datasource_DS" auth="Container"
type="javax.sql.DataSource"
		maxActive="10" maxIdle="5" maxWait="10000" username="myuser"
password="mypassword"
		driverClassName="oracle.jdbc.driver.OracleDriver" 
		url="jdbc:oracle:thin:@foo:1521:bar" 
		connectionProperties=""/>
-->

<!-- Tomcat 5.0 configuration -->
	<Resource name="jdbc/Datasource_DS" auth="Container"
type="javax.sql.DataSource"/>
	<ResourceParams name="jdbc/Datasource_DS">
		<parameter><name>username</name>             <value>myuser</value></parameter>
		<parameter><name>password</name>            
<value>mypassword</value></parameter>
		<parameter><name>driverClassName</name>     
<value>oracle.jdbc.driver.OracleDriver</value></parameter>
		<parameter><name>url</name>                 
<value>jdbc:oracle:thin:@foo:1521:bar</value></parameter>
		<parameter><name>maxActive</name>            <value>10</value></parameter>
		<parameter><name>maxIdle</name>              <value>5</value></parameter>
		<parameter><name>maxWait</name>              <value>10000</value></parameter>
	</ResourceParams>

</Context>



-- 
Guillaume Laforge
http://glaforge.free.fr/weblog/?catid=2

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Mime
View raw message