Thursday, January 28, 2010

Specifying default schema name in JPA

Often we use different user name to connect to oracle database instead of the using the same user name with schema name. In that case queries needs to be prefixed with schema names. to do that in JPA we can add the following property in persistence.xml file




com.foo.bar.Test




Tuesday, January 19, 2010

Access Oracle Blob and Timestamp Columns

Many of the time we use Blob and Timestamps column in Oracle. When we access them using JDBC, we will get Oracle specific Java objects when result set is returned from DB. e.g oracle.sql.BLOB, oracle.sql.TIMESTAMP but we may need them in the form of java.sql.Blob and java.sql.Timestamp

To get it in right way we need add the following start-up properties

-Doracle.jdbc.J2EE13Compliant=true