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 Views:3 Time:2018-04-14

Related post

  • I can't access the IP4 properties to change the ip address. 2014-02-08

    I can't access the IP4 properties to change the ip address. The laptop will connect to the network and has internet connection but when I try to set a specific ip address the wireless network connection properites tab for ip4 and ip6 is greyed out. I

  • How can a child window respond to a change in its parent 2010-10-04

    In a Win32 app is there a Windows message or some other notification that will get sent to a child window when it is placed into a different parent --------------Solutions------------- This is easy to test in a Windows Forms app. This is what I saw:

  • how can it be that my class field changes although its defined static? 2012-01-17

    Unfortunately I've got a bug that I have been working on for 1 full day now, and though I know there are ways to work around it, I am very excited to learn where my logic goes wrong. Now, my program is about a match between two teams of chessplayers.

  • How can you use a function that is defined below its usage? 2011-10-05

    I always thought that function a(){} is identical to a = function(){}; However, these two snippets behave differently: a(); function a() { alert("Booya"); } Prints Booya. a(); a = function() { alert("Booya"); } Fails with an exception, which makes se

  • Setting V$SESSION.program property on Glassfish JDBC Connection Pool 2011-05-12

    my Java EE App is deployed on Glassfish 3.0.1, and uses a JDBC Connection Pool to Connect to an Oracle 9i database. I am using JPA to read/write data to the database, which is working fine. However, to get better reporting regarding the load this app

  • Hibernate: javax.persistence.* driver properties cause UnsupportedOperationException: The user must supply a JDBC connection? 2010-12-10

    I'm using <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" /> <property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost/whatever" /> <property name="javax.persistence.jdbc.user" value="" /

  • Can a JBoss JDBC connection be invalidated so that it doesn't get resupplied from the connection pool? 2009-05-28

    I have a circumstance where a JDBC connection places the Oracle session to which it is attached into a particular state (i.e. DBMS_FLASHBACK enabled mode). It's possible for the exit of this mode to fail (at least theoretically) which means that the

  • The emulator can't connect with adb after changing the system.img of it 2011-07-12

    The emulator can't connect with adb after changing the system.img of it. I change the framework.jar and add some apks in the system.img. After changing, the emulator can't connect with adb, so I can't debug. This is very painful. I work at 2.3 versio

  • Can jdbc connections be recovered? 2011-09-13

    Can jdbc connections which are closed due to database un-availability be recovered. To give back ground I get following errors in sequence. It doesn't look to be manual re-start. The reason for my question is that I am told that the app behaved corre

  • Dial up modem Information changed after installing IE-9 Beta - can no longer connect automatically 2013-03-04

    After installing IE-9 Beta over a week ago information changed on automatic configuration of the dial up modem only and now I can no longer connect to the internet automatically, will not open port to dial out. I went to the advance tab of internet o

  • My account can no longer connect to my Gmail account. Do I need to change a configuration, and if so, what and how? 2014-04-16

    After successfully downloading over 10,000 messages, my account can no longer connect to my Gmail account. I'm given the following instructions: "We couldn't get your messages: There was a problem connecting to the other server. If you've

  • JDBC Connection Issue 2009-01-28

    I have create a getDBConnection method in my Java application. This returns a connection object, and hence I haven't closed this connection in this method itself. Now, I am invoking this method from various methods in my application at regular interv

  • Switching users on a JDBC Connection 2010-01-14

    I am writing a Java JDBC database application that connects to an Oracle 11g database and am using a c3p0 connection pool. For the purposes of an example, I have 3 database users DEFAULT, TOM, and BILL. c3p0 opens all of the pooled Connections with t

  • What's the proper way to handle JDBC connections with Spring and DBCP? 2010-08-19

    I'm using the Spring MVC to build a thin layer on top of a SQL Server database. When I began testing, it seems that it doesn't handle stress very well :). I'm using Apache Commons DBCP to handle connection pooling and the data source. When I first at

  • JDBC connection to very busy SQL 2000: selectMethod=cursor vs selectMethod=direct? 2010-09-01

    In the process of trying to help out an app dev team with performance issues on a SQL 2000 server (from a bunch of Java applications on separate app servers), I ran a SQL trace and discovered that all calls to the database are full of API Server Curs

  • configure Grails app to use JDBC connection pool 2012-03-03

    This article suggests Tomcat 7 apps should use a JDBC connection pool instead of a commons-dbcp connection pool. However, the latter is the default for a Grails app, and it's not obvious how to change it. My guess is that I need to define a Spring be

  • JDBC connect string for SQL Server cluster 2009-07-21

    I need to setup a JDBC connection string to SQL Server. This question is similar to the the C# ADO.Net connection question. This one is specific to JDBC connection strings. The usual format for the JDBC string is "jdbc:sqlserver://{host}:{port}". Now

  • Cannot connect to MySQL with JDBC - Connection Timeout - Ubuntu 9.04 2010-05-30

    I am running Ubuntu and am ultimately trying to connect Tomcat to my MySQL database using JDBC. It has worked previously but after a reboot the instance now fails to connect. Both Tomcat 6 and MySQL 5.0.75 are on the same machine Connection string: j

  • tomcat 6.0 with JDBC throws ClassNotFoundException com.mysql.jdbc.Connection 2010-08-30

    I've successfully connected to MySQL database through Eclipse without getting tomcat involved, so at lease it's some good progress. But when I try from my web page (Tomcat 6.0), it throws an error. I followed the tutorials, read documentations and lo

  • java read JDBC connection from XML file 2010-09-09

    Anyone have idea how can i write XMl file that i will have JDBC connection (username, passwd, driver, connection) in it and then read that xml for connecting to db? --------------Solutions------------- Here's how you could compose the XML: <?xml v

  • Beanshell jdbc connection 2010-09-29

    i want to connect to my database using beanshell script. my code works with java but beanshell doesn't work with the same code. Class not found exception will be thrown. does it have other usage or can't i connect to database with beanshell? Thanks,

  • Error getting JDBC Connection: Could not enlist in transaction on entering meta-aware object 2010-09-30

    I am having a problem getting a JDBC connection in an EJB SessionBean. The error is: org.jboss.util.NestedSQLException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.

  • Incorrect Use of JDBC Connection Pool 2010-10-20

    I am running a Spring MVC application, backed by a MySQL database which I am accessing using JDBC. I have been using the same code for a while, and have never really taken a look as to whether or not I was using it correctly (using connection pools p

  • How to pass around JDBC connection without using Spring/JPA/Hibernate 2010-12-09

    We have a Java J2EE application that was using individual web service calls for each database row insert/update. That turned out to be WAY too slow. They have brought me in to "quickly" fix it. I plan to convert all the web service calls to plain JDB

  • JDBC connection in Android 2010-12-15

    Is there anyone who tried JDBC connection in android because in Android 2.3 JDBC is supported. I have to connect with Mysql without web service. I have made application but it gives me error public class MysqlConnect extends Activity{ @Override publi

Copyright (C), All Rights Reserved.

processed in 0.122 (s). 11 q(s)