Can a jdbc connection's properties be changed during its usage?

Is it safe to alter the jdbc connection's settings during its usage?

For example I need to access comments made on the procedures in the rdbms and plan to provide such a functionality in a dedicated method. But I've read in the documentation that this requires altering connection properties through setRemarksReporting method which in turn slows down the connection. Therefore my idea is to set this property only within my method and reset it afterwards. No other method will need that property within other methods.

/* connection is used here */ ( (oracle.jdbc.driver.OracleConnection)conn ).setRemarksReporting(true); /* accessing remarks here */ ( (oracle.jdbc.driver.OracleConnection)conn ).setRemarksReporting(false); /* connection is used here */

My question is whether it is then safe and considered an acceptable practice to alter the connection throughout its usage. The connection belongs to one object that is used only by one java thread.

Category:java Time:2018-04-16 Views:0

Related post

Copyright (C), All Rights Reserved.

processed in 0.507 (s). 13 q(s)