You can specify a statement that executes each time a physical connection to the database is created (not reused) from a JDBC connection pool. This is useful for setting request or session specific properties and is suited for homogeneous requests in a single application. Set the Init SQL attribute of the JDBC connection pool to the SQL string to be executed in one of the following ways:
Specify the ----initsql option in the asadmin create-jdbc-connection-pool command. For more information, see the Oracle GlassFish Server 3.0.1 Reference Manual.
asadmin set domain1.resources.jdbc-connection-pool.DerbyPool.init-sql="sql-string"
For more information, see the Oracle GlassFish Server 3.0.1 Reference Manual.