ojdbc

How do I forcefully close a connection from a connection pool when it's taking too much time to close?

本秂侑毒 提交于 2019-12-04 16:16:32
There are times closing connections takes a lot of time, like more than 10 minutes upto 1 hour, or worse, even for indefinite time, depending on how heavy or slow the query was. In a situation where the client cancels the query because it has been taking too much time, I would want to free up the underlying connection used as soon as possible. I tried cancelling the PreparedStatement, closing it, then closing the resultset, and then finally closing the connection. Cancelling took almost instantly. Closing the PreparedStatement and ResultSet took too much time that I had to wrap it in a

Creating an ssl connection to oracle db with Java

爷,独闯天下 提交于 2019-12-04 09:27:34
I'm trying to connect to an Oracle DB using Java and SSL. For now I have the Java program on the server with the database. I'm getting this error when I try to run it (full error in comment): java.sql.SQLRecoverableException: IO Error: Inbound closed before receiving peer's close_notify: possible truncation attack?, connect lapse 15 ms., Authentication lapse 0 ms. This is my java code: public static void main(String[] args) { Security.addProvider(new oracle.security.pki.OraclePKIProvider()); String url = "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=localhost)(PORT=2484))

How to handle callableStatement.registerOutParameter(1, java.sql.Types.BOOLEAN);

徘徊边缘 提交于 2019-12-04 05:21:21
问题 Have a stored procedure in Oracle 10g/11g like the following: CREATE OR REPLACE PROCEDURE SP_SOME_PROC ( PRM_ID IN NUMBER , START_DATE IN DATE, RESULT OUT BOOLEAN) is... Using the following to code to call it and get the result: String sql = "{call SP_SOME_PROC(?,?,?) }"; callableStatement = conn.prepareCall(sql); callableStatement.setLong(1, theid); callableStatement.setDate(2, new java.sql.Date(startDate.getTime())); callableStatement.registerOutParameter(3, java.sql.Types.BOOLEAN);

Unable to get db connection after Java 8 upgrade

早过忘川 提交于 2019-12-04 02:41:45
I have recently upgraded an application from java 1.7 to 1.8. Rest of the libraries versions remains unchanged. I am getting the following error after the upgrade: DEBUG 2015-11-12 09:55:12 BasicResourcePool An exception occurred while acquiring a poolable resource. Will retry. java.lang.NullPointerException at oracle.net.jndi.JndiAttrs.getAttrs(JndiAttrs.java:207) at oracle.net.resolver.AddrResolution.<init>(AddrResolution.java:198) at oracle.net.ns.NSProtocol.connect(NSProtocol.java:219) at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1102) at oracle.jdbc.driver.T4CConnection

How to use Oracle JDBC driver in Gradle project

佐手、 提交于 2019-12-03 17:58:52
问题 I'm new with Gradle projects and I have one question. I've searched in Internet but I couldn't find what I need or maybe I couldn't know how to search it. First I'm going to tell you my case. I have a Gradle project and I would like to execute several automated tests, in the future with jenkins, but now I want to try on Eclipse. I have the oracle jdbc driver in /lib directory, and this is my build.gradle apply plugin: 'java' // In this section you declare where to find the dependencies of

Java - Oracle Database Change Notification

試著忘記壹切 提交于 2019-12-03 16:58:53
I am trying to implement a event listener which can identify DATABASE CHANGE NOTIFICATION (Oracle). According to the reference website , it said that event will triggle and print ROW_ID when something change in EXAMPLE table. I want this project running, and it should give me a message "give me something!" if I manually insert/update data in Database. However, it is my understanding that this code will terminate no matter what since there is no infinite loop that can be interrupted by the event. Please correct me if I am wrong. Additional Question] By setting OracleConnection.DCN_NOTIFY_ROWIDS

Oracle ojdbc8 12.2.0.1 Forbidden by Maven

左心房为你撑大大i 提交于 2019-12-03 14:40:24
Oracle ojdbc8 12.2.0.1 Forbidden by Maven since December 2017, before that worked well. What configuration has changed on the Oracle repository (setting.xml)? Maven project: https://github.com/sgrillon14/MavenSampleOracleJdbc Full trace: https://travis-ci.org/sgrillon14/MavenSampleOracleJdbc It's possible that the Oracle Maven terms have changed. You may need to re-register on the Oracle Maven site: http://www.oracle.com/webapps/maven/register/license.html I tried your github script and it worked fine with me: $ mvn clean install --settings test/mvnsettings.xml [INFO] Scanning for projects...

Oracle JDBC charset and 4000 char limit

℡╲_俬逩灬. 提交于 2019-12-03 06:59:12
We are trying to store an UTF-16 encoded String into an AL32UTF8 Oracle database. Our program works perfectly on a database that uses WE8MSWIN1252 as charset. When we try to run it on a database that uses AL32UTF8 it gets to a java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column . In the testcase below everything works fine as long as our input data doesn't get too long. The input String can exceed 4000 chars. We wish to retain as much information as possible, even though we realise the input will have to be cut off. Our database tables are defined using

What is the difference between ojdbc6.jar and ojdbc7.jar?

懵懂的女人 提交于 2019-12-01 02:29:31
Will ojdbc6.jar work for JDK 1.7 and Oracle 12c? Should I use ojdbc7.jar? Thank you in advance. Anand Dwivedi The included ojdbc6.jar is the latest 12c driver. The only difference between ojdbc6.jar and ojdbc7.jar is that the latter one is compiled with Java 7. Since DB Solo is at least for now using Java 6, it can only include ojdbc6.jar. In terms of functionality the versions are identical. Link Note that another difference between ojdbc6 and ojdbc7 is the supported Oracle version. Specifically ojdbc7 does not support Oracle 11.2 or 11gR2 whereas ojdbc6 does: source . For completeness, note

How to set custom connection properties on DataSource in Spring Boot 1.3.x with default Tomcat connection pool

依然范特西╮ 提交于 2019-11-30 09:31:40
I need to set some specific Oracle JDBC connection properties in order to speed up batch INSERT s ( defaultBatchValue ) and mass SELECT s ( defaultRowPrefetch ). I got suggestions how to achieve this with DBCP (Thanks to M. Deinum) but I would like to: keep the default Tomcat jdbc connection pool keep application.yml for configuration I was thinking about a feature request to support spring.datasource.custom_connection_properties or similar in the future and because of this tried to pretent this was already possible. I did this by passing the relevant information while creating the DataSource