Questions tagged [jdbc]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
18 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 ...
1
vote
1answer
1k views

How to configure TCPS in JDBC thin client for oracle

An Java Application running with JDBC thin wtih TCP connection, Now require is to convert in TCPS for encryption transmission from application to database. String url = "jdbc:oracle:thin:@(...
0
votes
1answer
16 views

Accessing Firebird Database Remotely using JDBC

I would like to access a Firebird database remotely using DBeaver and have had little success. DBeaver utilises the FirebirdSQL JDBC driver. We have been presented with the following error message: ...
0
votes
1answer
349 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. ...
0
votes
1answer
70 views

Postgres deadlock on sharedlock

I'm having a problem where a couple UPDATE sql statements are locking up on a particular table in a database. For some reason these statements seem to be requiring access to a "ShareLock" ...
0
votes
3answers
122 views

JDBC oracle listener random port

I have an issue with our listener trying to assign random ports to JDBC connections. We have a 19c oracle db running on a RHEL server with two ports opened 1523 and 1524. When application tries to ...
1
vote
1answer
661 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, ...
1
vote
1answer
2k 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 ...
3
votes
1answer
1k 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 (...
2
votes
2answers
588 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 ...
0
votes
2answers
386 views

Connection denied from Java application

I try to connect from my little Java class to Oracle11g database and connection was refused with a SQL error. From client (SQL Developer) connection works. This is the ERROR when I try to run java ...
3
votes
2answers
120 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 ...
0
votes
2answers
853 views

Unable to connect to Mysql via JDBC but works fine with Mysql

I have a mysql server running locally to which I am able to connect using mysql -h localhost -u root It does not require a password. But when I try to connect with the same attributes (jdbcurl = "...
1
vote
0answers
20 views

How to Enable TLS 1.2 on MS SQL Server 2012 SP1? [duplicate]

im having trouble connecting to MS SQL Server 2012 SP1 with regards to TLS Handshake. as stated by microsoft, SP1 only supports TLSv1 to TLSv1.1, if i'm not mistaken. I have been developing a spring/...
1
vote
1answer
49 views

What could be the reason for running rollback after a commit?

I am trying to understand why there are so many rollback queries being issued by Jira and is equal to the number of commits. MySQL log reveals the following: 2021-04-29T14:55:58.364468Z 42059 ...
0
votes
1answer
774 views

Can Microsoft JDBC Driver 4.0 connect to SQL Server 2019 and perform DML without issue?

The SQL version compatibility BOL article advises that the minimum compatible JDBC driver version for SQL Server 2019 is 7.4. Can an older JDBC driver still connect to SQL Server 2019? Or can only the ...
0
votes
1answer
40 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 ...
0
votes
0answers
239 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 ...
0
votes
1answer
38 views

does SELECT with implicit transaction prevent VersionStore cleanup?

The JDBC driver usually sets the implicit transaction on in every query executed by the client. I found many SELECT statements in suspended state with implicit transaction set to ON using Version ...
0
votes
0answers
104 views

Correct way to account for MySQL session variables using JDBC

I am trying out a neat solution for getting top N rows per each group. The solution makes use of two session variables @country_rank and @current_country. The solution works well while directly ...
0
votes
1answer
195 views

How to reset session context/variables in JDBC pooled connections - MySQL / Oracle

In my application I have multithreads that needs to access database and I am using apache.tomcat.jdbc.pool.DataSource as a JDBC connection pool. In some cases users execute stored procedures that ...
0
votes
1answer
27 views

Connecting to “foreign” database on the same DBMS

I am somewhat surprised to see that JDBC allows me to transparently SELECT from a table in a "foreign" database, on the same DBMS, for which I have the requisite privileges, without ...
0
votes
1answer
1k views

FATAL: database does not exist in postgresql for jdbc

I create a database by installing Postgres on my ubuntu 20.04 machine and used the following commands to create it: sudo su - postgres psql CREATE USER preopus WITH PASSWORD 'admin222'; CREATE ...
0
votes
1answer
631 views

postgresql prepared statements with JSONB containment

I'm trying to write a prepared statement using a date held in JSONB. A prepared statement doesn't allow the containment operator @> so I used the function name itself jsonb_contains which executes,...
1
vote
1answer
1k views

sql server query execution plan via jdbc driver

is there a way to fetch the XML generated by the "Actual Execution Plan" in SQL server 2012 - 2014, but via JDBC driver for Java -- sqljdbc_6.0.8112.100_enu? (preferable forward compatible with 2016) ...
0
votes
1answer
86 views

Creating external tables from SQL Server using JDBC Drivers

I am trying to query Hive tables AND Kylin tables from SQL Server 2019. I was doing some research and found that MSSQL provide PolyBase as a form of interface to Hadoop storage. However, the examples ...
0
votes
1answer
59 views

Enabling TLS and TLS-MA simultaneously for different clients of a Oracle DB

We have a requirement where we want to enable TLS-MA for some of the clients connecting to a specific Oracle database while the other clients can continue to use TLS with server certificate. We are ...
1
vote
3answers
5k views

Query is slow with JDBC parameters, fast with concatenated SQL

I have an application that can be run with either mysql or SQL Server. There is a query that runs in a reasonable time on mysql, but is very slow on SQL Server. My application uses hibernate, but this ...
4
votes
3answers
2k views

SET ROLE via parameterized query

In the very helpful response I received to a previous question, I am trying to write some JDBC code that first sets the role to a specific user before executing subsequent queries. On the safe side I ...
0
votes
1answer
236 views

Implementation of JDBC DataSource in MySQL Connector/J 8

In the MySQL Connector/J 8.0 Developer Guide (JDBC driver for MySQL), I have not found any mention of an implementation for the DataSource interface in JDBC. To quote the DataSource Javadoc: An ...
0
votes
1answer
228 views

monitoring sql execution perfomance of an application that makes use of SP_prepare

we have an application that makes heavy use of sp_prepare and sp_execute and we would like to start monitoring the execution plans of the sql. but this is made difficult by the use of sp_prepare ...
0
votes
1answer
222 views

Informix JDBC login fails, local login succeeds

I'm troubleshooting a "sudden" issue on our somewhat old Informix server (11.50.UC9GE). After years of running without issue (and connecting w/o issue), suddenly today we can't connect to the server ...
0
votes
1answer
229 views

Disable nestloops into the Postgresql JDBC connection

I'd like to disable nested loops for a specific JDBC connection string (batch java application), using the PostgreSQL community driver Is it possible to do so? I tried this way, in vain: jdbc:...
2
votes
1answer
276 views

Deadlock troubleshooting in SQLServer

Edit: In case it is relevant, we are connecting to the database via JDBC in a java webapp. We use autocommit=off for all of these operations, and deadlocks mean the job thread is not committed. I am ...
2
votes
1answer
3k views

Are the MariaDB and MySql drivers interchangeable when connecting to a MySQL backend Aurora cluster?

I saw a similar question asked before but I didn't get enough supporting information Does anyone know any new information on this? Can MariaDB connector (driver) be used instead of the MySQL ...
0
votes
1answer
28 views

Correct table quoting

I want to generically use any SQL database(I'm using jdbc, it works if the driver and the URL are provided). It seems, that different DBMS use different quoting for table names. For example, I have ...
3
votes
1answer
760 views

How to set IP segment and connection string with IPv6?

For this PostgreSQL configuration example: https://repmgr.org/docs/4.4/quickstart-authentication.html local replication repmgr trust host replication ...
1
vote
0answers
103 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 ...
0
votes
1answer
1k views

How to do automatic failover for PostgreSQL with application automatic switch?

There are two ways to try. Method 1 Use JDBC connect the PostgreSQL cluster (primary, standby 2 servers only): jdbc:postgresql://192.168.0.1:5432,192.168.0.2:5432/jiradb But failed: The ...
1
vote
0answers
82 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 ...
-1
votes
1answer
359 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..#...
3
votes
1answer
6k views

Keep H2 in-memory database between connections

I create and use a H2 database in-memory (no writing to storage) for demos and quick tests using this code in Java: Connection conn = DriverManager.getConnection( "jdbc:h2:mem:example_db" ) ; This ...
0
votes
2answers
210 views

Is there a way to check connection properties of an active SQL Server connection?

The context: I have a Java application that's using HikariCP for its connection pooling solution. While lightning-fast, HikariCP doesn't have a lot of configuration options, by design, and that's all ...
1
vote
1answer
243 views

Oracle save mandarin characters with we8iso8859p1

Im trying to save Mandarin characters into Oracle instance database 11g. Field datatype - NVARCHAR2 ; NLS_LANG - AMERICAN_AMERICA.WE8ISO8859P1 If I change NLS_LANG, it will affect other data already ...
0
votes
1answer
745 views

SQL Server doesn't send intermediate SSL certificates

I am connecting to SQL Server (2008 R2) over open Internet and properly encrypting the connection is essential. I have COMODO certificate with two intermediate certificates between root CA and server ...
0
votes
1answer
46 views

Java driver dont fire query-start probe in postgres 11

While using SystemTap to trace postgres session on PostgreSQL 11.2 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36), 64-bit. global livequeries probe process("/usr/...
1
vote
0answers
112 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 ...
0
votes
0answers
1k 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="...
0
votes
2answers
1k views

JDBC Connection on Current Primary Database After Switchover: ORA-01033 encountered

We are using Oracle Data Guard and currently testing Disaster Recovery scenarios, which is starting the application after switching over from the Primary Database to the Secondary Database. I am ...
-1
votes
1answer
2k views

Incorrect string value: '\xF0\x9F\xA4\x96<b...' for column 'body' at row 1 [closed]

I've set the column type to utf8mb4 and the collation to utf8mb4_bin. The table defaults are also utf8mb4 and utf8mb4_bin. When I use SequelPro to add the emoji "🤖" to the database manually, it ...