Hi guys,
I have this question. I have configured my database datasource with jndi in jetty.xml, like this:
<New id="dataSource" class="org.eclipse.jetty.plus.jndi.Resource">
<Arg></Arg>
<Arg>jdbc/myDS</Arg>
<Arg>
<New class="com.mchange.v2.c3p0.ComboPooledDataSource">
<Set name="driverClass">
<SystemProperty name="jdbc.driverClassName" default="com.mysql.jdbc.Driver"/>
</Set>
<Set name="jdbcUrl">
<SystemProperty name="jdbc.url"
default="jdbc:mysql://localhost:3306/mydb?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&connectionCollation=utf8_general_ci&characterSetResults=utf8"/>
</Set>
<Set name="user">
<SystemProperty name="jdbc.username" default="root"/>
</Set>
<Set name="password">
<SystemProperty name="jdbc.password" default="admin"/>
</Set>
<Set name="minPoolSize">5</Set>
<Set name="maxPoolSize">50</Set>
<Set name="acquireIncrement">3</Set>
<Set name="acquireRetryAttempts">0</Set>
<Set name="acquireRetryDelay">3000</Set>
<Set name="breakAfterAcquireFailure">false</Set>
<Set name="maxConnectionAge">60</Set>
<Set name="maxIdleTime">30</Set>
<Set name="maxIdleTimeExcessConnections">10</Set>
<Set name="idleConnectionTestPeriod">15</Set>
<Set name="testConnectionOnCheckout">true</Set>
<Set name="preferredTestQuery">SELECT 1</Set>
<Set name="debugUnreturnedConnectionStackTraces">true</Set>
<Set name="autoCommitOnClose">true</Set>
</New>
</Arg>
</New>
Now I would like to replace the username/password and the url with values from properties file. I tried with SystemProperties but it doesn't work + I don't want to specify them as system properties. I have a file called system.properties in my classpath and I would like to use the properties from it. Is that possible?