Data Source Custom Properties

You can set the database vendor specific custom properties on data source by clicking on custom properties link on data source definition page.



This is what i see on the custom properties page for Apache Derby data source. I can enable the data source level SQL trace from here, Ex. i can turn on the trace to see what all SQL queries are getting fired on the SQL connection from this data source,
the input parameters and the result set.

As you can see there is some help available for each of the custom property that you can set


I did set traceLevel to 4, that enables only TRACE_RESULTSET_CALLS, and i set value of traceFile to c:/temp/derbytrace.log file. After setting these properties i tried accessing the data source and this is the log that got generated in the derbytrace.log

Similarly you can set custom properties specific to your data source to generate trace

[derby][Time:1250572072484][Thread:WebContainer : 0][ClientConnectionPoolDataSource@5000500] getPooledConnection () called
[derby][Time:1250572072593][Thread:WebContainer : 0][ClientConnectionPoolDataSource@5000500] getPooledConnection () returned org.apache.derby.client.ClientPooledConnection@78987898
[derby][Time:1250572072593][Thread:WebContainer : 0][ClientPooledConnection@78987898] getConnection () called
[derby][Time:1250572072593][Thread:WebContainer : 0][ClientPooledConnection@78987898] getConnection () returned org.apache.derby.client.am.LogicalConnection@77807780
[derby][Time:1250572072609][Thread:WebContainer : 0][org.apache.derby.client.net.NetConnection@20242024] getMetaData () returned DatabaseMetaData@6fe66fe6
[derby][Time:1250572072734][Thread:WebContainer : 0][org.apache.derby.client.net.NetConnection@20242024] getHoldability () returned 1
[derby][Time:1250572072734][Thread:WebContainer : 0][org.apache.derby.client.net.NetConnection@20242024] getAutoCommit () returned true
[derby][Time:1250572072734][Thread:WebContainer : 0][org.apache.derby.client.net.NetConnection@20242024] getCatalog () returned null
[derby][Time:1250572072734][Thread:WebContainer : 0][org.apache.derby.client.net.NetConnection@20242024] isReadOnly () returned false
[derby][Time:1250572072734][Thread:WebContainer : 0][org.apache.derby.client.net.NetConnection@20242024] setTransactionIsolation (4) called
[derby][Time:1250572072734][Thread:WebContainer : 0][org.apache.derby.client.am.Statement@2cc62cc6] executeUpdate (SET CURRENT ISOLATION = RS) called
[derby][Time:1250572072750][Thread:WebContainer : 0][org.apache.derby.client.am.Statement@2cc62cc6] executeUpdate () returned 0
[derby][Time:1250572072781][Thread:WebContainer : 0][org.apache.derby.client.net.NetConnection@20242024] clearWarnings () called
[derby][Time:1250572072781][Thread:WebContainer : 0][org.apache.derby.client.net.NetConnection@20242024] createStatement (1003, 1007) called
[derby][Time:1250572072781][Thread:WebContainer : 0][org.apache.derby.client.net.NetConnection@20242024] createStatement () returned Statement@1b401b4
[derby][Time:1250572072796][Thread:WebContainer : 0][org.apache.derby.client.am.Statement@1b401b4] executeQuery (SELECT * FROM DERBY.EMPLOYEE) called
[derby][Time:1250572072828][Thread:WebContainer : 0][org.apache.derby.client.am.Statement@1b401b4] executeQuery () returned ResultSet@1bae1bae
[derby][Time:1250572072843][Thread:WebContainer : 0][ResultSet@1bae1bae] next () called
[derby][Time:1250572072843][Thread:WebContainer : 0][ResultSet@1bae1bae] next () returned true
[derby][Time:1250572072843][Thread:WebContainer : 0][ResultSet@1bae1bae] getObject (1) called
[derby][Time:1250572072843][Thread:WebContainer : 0][ResultSet@1bae1bae] getObject () returned 1
[derby][Time:1250572072843][Thread:WebContainer : 0][ResultSet@1bae1bae] getObject (2) called
[derby][Time:1250572072843][Thread:WebContainer : 0][ResultSet@1bae1bae] getObject () returned Sunil Patil
[derby][Time:1250572072843][Thread:WebContainer : 0][ResultSet@1bae1bae] next () called
[derby][Time:1250572072843][Thread:WebContainer : 0][ResultSet@1bae1bae] next () returned true
[derby][Time:1250572072843][Thread:WebContainer : 0][ResultSet@1bae1bae] getObject (1) called
[derby][Time:1250572072843][Thread:WebContainer : 0][ResultSet@1bae1bae] getObject () returned 2
[derby][Time:1250572072843][Thread:WebContainer : 0][ResultSet@1bae1bae] getObject (2) called
[derby][Time:1250572072843][Thread:WebContainer : 0][ResultSet@1bae1bae] getObject () returned Alden Taylor
[derby][Time:1250572072843][Thread:WebContainer : 0][ResultSet@1bae1bae] next () called
[derby][Time:1250572072843][Thread:WebContainer : 0][ResultSet@1bae1bae] next () returned false
[derby][Time:1250572072843][Thread:WebContainer : 0][ResultSet@1bae1bae] close () called
[derby][Time:1250572072843][Thread:WebContainer : 0][org.apache.derby.client.am.Statement@1b401b4] close () called

No comments: