Skip to main content

Questions tagged [jdbc]

Java Database Connectivity (JDBC) is a Java standard that provides the interface for connecting from Java to relational databases.

50 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5 votes
1 answer
1k views

Measure Performance for INSERT, UPDATE and DELETE commands on DB2

I have a DB2 database with a table for daily transactions, which is cleared to a history table at the end of the day, every day. I insert rows to this table via java-JDBC INSERT commands and they ...
Roberto Linares's user avatar
4 votes
1 answer
2k views

Why would a query return oracle.sql.NUMBER@[hex value] in place of a numeric value?

I'm seeing some odd behavior in an Oracle 11gR2 database. When I select from a particular table, using SQL Developer, certain rows of the result set include non-numeric results in a NUMBER column (...
Air's user avatar
  • 181
3 votes
2 answers
1k views

How do I run a database heavy query over jdbc without timing out (Oracle)?

For one of our applications (Pentaho Data Integration), we need to run queries through the oracle jdbc. Some of these queries are computation expensive and can take an hour or more to return any rows ...
Andrew Hangsleben's user avatar
3 votes
2 answers
164 views

Causing ORA errors in a program using JDBC. How can I find what's causing them?

So I'm building a java app to interface with the company's database. Whenever it causes an ORA error, it just prints something like the following to system output: ORA-00911: invalid character Is ...
Daniel Paczuski Bak's user avatar
3 votes
0 answers
2k views

MySQL SSL using MariaDB JDBC Driver

We have the following setup: Ec2 instance running a jboss server with mariadb (1.1.7) datasources setup to connect to an rds instance running MySQL 5.6.21. We would like to turn on SSL on for this ...
mhbrooks's user avatar
  • 131
3 votes
0 answers
311 views

Unable to Update on SQL Server 2008 R2

This is a bit strange so bear with me please. After installing a new SQL Server 2008 R2 on a new server (Windows 2012 Standard) just like the production one, I tried to connect my web aplication (...
Piero van Oordt's user avatar
2 votes
0 answers
906 views

Connection to Azure SQL from Java

I try to connect to Azure SQL with MS JDBC driver: import java.sql.*; public class ExampleSQLJDBC { public static void main(String[] args) { // Setting. String connectionUrl = "...
user824276's user avatar
2 votes
0 answers
118 views

JDBC Statement vs. Prepared Statement SQL Injection

as far as I understand a "normal" JDBC Statement which is created via conn.createStatement() is prone to SQL-Injection. A prepared statement protects from such attacks. So why/when should I use a ...
knowledge's user avatar
  • 121
2 votes
0 answers
20 views

JDBC - maximum allowable cursors - how do I see my open statements?

I've got some resource leaking and I'm trying to find what's causing them. I think I have some statements or resultsets that aren't being closed properly. Is there any way to see all of the cursors ...
Daniel Paczuski Bak's user avatar
2 votes
0 answers
1k views

Is there a way to detect if there is an uncommitted transaction in H2?

I am using an H2 database with JDBC to create a connection with setAutoCommit(false). I am currently programatically checking whether or not there is an uncommitted transaction, but I was wondering ...
Bri's user avatar
  • 195
2 votes
0 answers
160 views

Wanted: Android versions of JDBC drivers for common RDMBSes

I've got a Java-based application library I'm trying to port to Android. The package presently supports: Oracle Informix DB2 Postgres Sybase ...And can easily be configured to use any other SQL92 ...
Richard T's user avatar
  • 219
1 vote
0 answers
93 views

Writing large dataset from spark dataframe

We have a azure databricks job that retrieves some large dataset with pyspark. The dataframe has about 11 billion rows. We are currently writing this out to a postgresql DB (also in azure). Currently ...
Kyle Chamberlin's user avatar
1 vote
0 answers
178 views

is it possible to set specific timezone for session in mariadb connector/j

I 'm trying to use timezone setting with mariadb connector/J version 3.x. In the documentation,in Timezone consideration, it says: 'a timezone': connector will set connection variable to value. ...
SkyKnight's user avatar
1 vote
1 answer
324 views

Can JDBC Oracle file stream blob inserts be speeded up?

I have these four different ways by which I am inserting some file data into an Oracle database using JDBC and PreparedStatements. Approach A ps.setBytes(1, fileDataInByteArray); Approach B Blob ...
Raster R's user avatar
1 vote
0 answers
601 views

Oracle 19c: Sql.Recovarable.Exception [Error 17410]

We get an exception while making this call from our backend to the database: select f.* from T t inner join CATEGORY Category on Category.ID1 = t.ID1 where Category.ID2 = ? and t.ID3 = ? and Category....
Tennie's user avatar
  • 11
1 vote
0 answers
1k views

Debugging connection leak in postgres instance in RDS

Trying to debug a connection leak in postgres database instance in RDS SELECT * FROM pg_stat_activity; Running the above query shows around 500 sessions, but all of them have wait_event_type Client ...
1987frank's user avatar
  • 111
1 vote
0 answers
108 views

Metadata retrieval query executed for every invocation of ResultSet.updateRow in PostgreSQL JDBC driver

I'm using an updatable ResultSet, where I want to update the columns directly in the ResultSet and commit (for performance and avoiding complex rollback logic). For this, I do the following - Create ...
Richard Kodamanchili's user avatar
1 vote
0 answers
442 views

JDBC can't use the current primary database by setting multiple hosts

node1: 192.168.0.1 as primary node1: 192.168.0.2 as standby The JDBC string is setting as this: <url>jdbc:postgresql://192.168.0.1:5432,192.168.0.2:5432/mydb</url> Using repmgr doing ...
rawmain's user avatar
  • 319
1 vote
0 answers
182 views

Support for JDBC 4.2?

As far as I can tell, the jcc driver shipped with 11.5 (https://www.ibm.com/support/pages/db2-jdbc-driver-versions-and-downloads) still uses JDBC 4.1. Any rumours of, if a later fixpak will switch to ...
Lennart - Slava Ukraini's user avatar
1 vote
0 answers
175 views

Is there a way to open an encrypted Oracle Database wallet through weblogic JDBC drivers?

I encrypted a column in an Oracle 12c database using the TDE method, The said column was being used in my application, The column becomes unavailable due to the Database wallet being closed. To open ...
Nibin George's user avatar
1 vote
0 answers
182 views

SQL JDBC upgrade from v6.0 to v7.2 causes java.lang.NullPointerException in *some* stored procedure returned recordsets

I am developing a java application onWindows 10 using Eclipse Oxygen and SQL JDBC v7.2 and java 1.8 update 202. My code runs fine when I use SQL JDBC v6.0 (sqljdbc42.jar Jan 2017 and java 8), but ...
BBSings's user avatar
  • 11
1 vote
0 answers
745 views

Improve parallel running of bulk copy insert and stored procedures

I have a Java message listener, which upon receiving a message starts bulk inserting thousands of records into a table. After that it calls a few stored procedures sequentially that make some updates ...
A5300's user avatar
  • 111
1 vote
0 answers
110 views

How do Master / Slave JDBC URL handle broken MySQL Slave?

I own the following classical MySQL 5.7 set-up : one master server one slave server The master => slave link is done though GTID. I'm monitoring the link by querying show slave status on the slave ...
Jérôme B's user avatar
1 vote
0 answers
2k views

How to connect to Postgres on localhost with URL: "jdbc:postgresql://database:5432/db123"

I am able to connect to a postgres 10 instance on my local Win10 machine with pgAdmin 4 and "localhost" as a hostname, but when I change the hostname to "database" I cannot connect. How to fix it? I'...
ieXcept's user avatar
  • 111
1 vote
1 answer
5k views

timestamp with timezone issue with TZR vs TZH:TZM

I have a Hibernate with Oracle JDBC based application inserting/updating into the following column; COLUMN_A TIMESTAMP WITH TIME ZONE DEFAULT systimestamp NOT NULL but while it automatically appends ...
buræquete's user avatar
1 vote
0 answers
10k views

org.postgresql.util.PSQLException: This connection has been closed. error for long running transactions

We are getting "org.postgresql.util.PSQLException: This connection has been closed." on one of our deployments for only long running transactions (more than a few minutes): Caused by: org.hibernate....
nilgun's user avatar
  • 111
1 vote
0 answers
2k views

Oracle APEX 5.1 connect to remote db using JDBC and query data

I have only used db links to get access to remote db so far. Now I have to find a way to use JDBC to connect to remote db and get data. Can someone guide me what all things would I need to ask the ...
Bug On the Loose's user avatar
1 vote
0 answers
1k views

Set table name to variable in postgresql

I am trying to set the tablename dynamically in a postgresql query executed through a jdbc connection. Here is my code: PreparedStatement query1 = null; Connection conn = null; //...
toing_toing's user avatar
1 vote
0 answers
2k views

LISTEN/NOTIFY pgconnection goes down java?

I am using PostgreSQL DB and applying it's LISTEN/NOTIFY functionality. So my listener is at my AS (Application Server) and I have triggers configured on my DB such that when CRUD operations are ...
Siddharth Trikha's user avatar
1 vote
0 answers
48 views

MySQL/JDBC: Can a commit on server get missed on client?

I am wondering about when conducting a transaction of one or two updates/inserts from a JDBC client to MySQL Server over the network... In the event of losing the network during the commit, can I get ...
Mark Meyers's user avatar
1 vote
0 answers
1k views

sql taking < 1 sec to run in sql developer, 37 on the application side

As the title says, we have a big discrepency between a sql query we're running from our java application (jdbc thin client) and the same query run in sql developer. I clear the cache of the query ...
Sebas's user avatar
  • 266
1 vote
1 answer
841 views

oracle DB connection - hostdef extension doesn't exist

I am trying to connect to an Oracle DB through ERwin, yet I keep getting this error message: I know that the DB exists, as my coworkers are accessing it. The Username and Password are also correct, ...
Salmononius2's user avatar
0 votes
0 answers
8 views

CREATE TABLE permissions required to append Pyspark dataframe to SSMS table

I am using AWS glue to extract some data from RDS, parse it into some other format and push it back to RDS. The RDS user I use has SELECT and INSERT permissions on tic.Example. However, when I try to ...
Eloy Fernandez's user avatar
0 votes
0 answers
66 views

JDBC using DataSource, DB2 and Kerberos

I am trying to set up a JDBC using DataSource interface, DB2 database and Kerberos for authentication. I am using IBMs documentation which refers in Kerberos security with no user ID or password link ...
bagb's user avatar
  • 1
0 votes
0 answers
62 views

Why, MariaDB user allowed host IP address also allows a virtual machine on the host with NAT network adapter

The MariaDB user specifies an allowed IP address in the Host column of the mysql.user table. So, it only allows logging in from the host with the specified IP address. And MySQL has the same design. ...
James's user avatar
  • 149
0 votes
1 answer
306 views

Execute Permission Denied on Stored Procedure using Microsoft JDBC Driver and Windows Authentication

I have a Microsoft SQL Server database that I use Stored Procedures to read/write data to through a Integration Engine in this case InterSystem IRIS. Originally I was using a local server user to do ...
sroth79's user avatar
0 votes
2 answers
1k views

Java PostgreSQL library seems to convert dates to local time zone automatically

PostgreSQL 14.6 Ubuntu 22.04 I am using postgresql-42.5.4.jar which I downloaded from pgJDBC. I use this library to get data from a database and display it on a website running locally. The web server ...
Zephyrus's user avatar
  • 301
0 votes
1 answer
47 views

Oracle CACHE and STORAGE IN ROW behaviour

We have a Java Spring boot application that writes 20 million plus rows in a table with 2 blob columns in a batched manner into an Oracle 21c DB. We are using JDBC batch insert for fast inserts. ...
humbleCoder's user avatar
0 votes
1 answer
4k views

Unable to connect with JDBC after MySQL upgrade from 5.7 to MySQL 8.0

We use java application client to transfer database table data to a third party server. With MySQL 5.7 it was working fine. After upgrade to MySQL 8, it started to show errors. First thing we did was ...
Amit Sedai's user avatar
0 votes
1 answer
64 views

NDB Cluster Read and Write Process multiple Access

When using the MySQL NDB Cluster distributed database, the following general problem has arisen: To insert a new Record / Row, the last row in the database should be read, see if it is compatible with ...
programmer_13's user avatar
0 votes
1 answer
683 views

Why does my JDBC keep setting session variables?

I'm looking at the Performance Insights for MySQL Aurora on AWS and among the top queries I see: SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ SET SESSION TRANSACTION ISOLATION LEVEL READ ...
Johnny's user avatar
  • 140
0 votes
1 answer
2k views

Unable to connect to an Oracle 12c Docker container

I'm working on a project with Oracle, and using a Oracle XE 11 container for testing. But recent developments have ended up with me running up against a brick wall: I need larger table names. ...
Mason Wheeler's user avatar
0 votes
1 answer
179 views

how do I use sa to access local sql server database with jdbc

I have a new local sql server database, running hypothetically on port 48000. In SQL Server Management Studio under the name of the computer\MSSQLSERVER01, Security, Logins I clicked sa, properties ...
Chris94's user avatar
  • 101
0 votes
0 answers
1k views

Slow insert on conflict do nothing for Postgres 13

I'have rather odd case. I have a "cache" table in Postgres and I need to insert 100K - 1M records in parallel from different sources. Sources can try to insert duplicated data (by Primary ...
Capacytron's user avatar
0 votes
0 answers
3k views

PostgreSQL disconnection session time

I have a simple app which supports just GET & POST using JDBCTemplate, in tomcat configuration (context.xml) is set where it can find the Database like below: <Resource name="jdbc/MYDB" auth="...
GeoCom's user avatar
  • 101
0 votes
0 answers
66 views

Oracle - Is it possible for the results of a transaction not to be visible to a subsequent transaction?

We're having a strange problem with a flaky integration test. This is using Java/JDBC against an Oracle 12 database. The test does this, in pseudocode: transaction 1 { insert into order (id, ...
Pepijn Schmitz's user avatar
0 votes
1 answer
68 views

Need a better way to insert non-existent values in referenced table during insert/update in referencing one

I'm looking for the best way to insert data into MariaDB with JDBC. Please take a look at the following schema CREATE TABLE color ( id SMALLINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, name VARCHAR(...
humkins's user avatar
  • 207
0 votes
0 answers
2k views

Postgres Public Synonym Issue

PostgreSQL ver 9.4.5. Linux OS. Application: Web Based Platform: App Server (java) --> jdbc call --> Database Server (PostgreSQL) I do know that PostgreSQL does not support the public ...
scott's user avatar
  • 71
0 votes
0 answers
2k views

How to enable SSL in MySQL on Windows?

I'm a student doing a project which uses JDBC and MySQL (on Windows). I have an application with connects to a MySQL server on a remote host. To have a secure connection, I found this : http://www....
Roronoa's user avatar
-1 votes
2 answers
565 views

executing SQL query with temp tables using 1.6jdk

I created a batch to run a query that has temp tables as the below example IF OBJECT_ID ('tempdb..#TEMP1') IS NOT NULL DROP TABLE #TEMP1 select * into #TEMP1 from cutomer IF OBJECT_ID ('tempdb..#...
user2074325's user avatar