Questions tagged [jdbc]
Java Database Connectivity (JDBC) is a Java standard that provides the interface for connecting from Java to relational databases.
178
questions
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. ...
1
vote
1
answer
4k
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 ...
1
vote
0
answers
71
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. ...
3
votes
1
answer
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 (...
3
votes
2
answers
982
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
1
answer
697
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 ...
0
votes
1
answer
474
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 ...
0
votes
0
answers
29
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.
...
2
votes
2
answers
2k
views
Weblogic Error: Connection test failed [closed]
I am trying to create a SQL Server 2014 data source in weblogic through admin console. When I click on test configuration, I get the following error:
Message icon - Error Connection test failed.
...
0
votes
1
answer
2k
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 ...
1
vote
1
answer
185
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 ...
0
votes
0
answers
59
views
JDBC connection to MariaDB over SSL/TLS
I have an application that I'm trying to connect to MariaDB with a JDBC driver over SSL. I have set the following parameters in the custom.cnf of my MariaDB server:
ssl_ca=/certs/ca-cert.pem
ssl_cert=/...
0
votes
1
answer
113
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 ...
0
votes
0
answers
74
views
MySQL Connection String settings
I'm using the following options in my connection string:
autoReconnect true
autoReconnectForPools true
cacheCallableStmts true
cachePrepStmts true
useCompression true
useSSL true
...
2
votes
1
answer
6k
views
JDBC connection error for SQL Server Database
I have a SQL server names as MS8AT09\AT09. I am able to login to the server through Microsoft SQL server Management studio. While trying to login to same server through JDBC I am facing the error as
...
6
votes
4
answers
18k
views
Why decrease the wait_timeout configuration parameter in MySQL?
Question
I'm working on an application that uses a connection pool in Apache Tomcat to communicate with MySQL. I was wondering why would you want to use a smaller wait_timeout than the default of 28,...
3
votes
2
answers
5k
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 ...
1
vote
1
answer
805
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, ...
0
votes
1
answer
39
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.
...
1
vote
1
answer
1k
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:
...
4
votes
1
answer
33k
views
Retrieving data from inner join using LIMIT and OFFSET
These are my two tables:
table1
qid[PK] |gid[PK] |abcd | xyz | date
---------------+---------+---------+------+------------
00001 | qwe | 54 | a | 1994-11-29
00002 ...
7
votes
2
answers
7k
views
Is there any way to retrieve "Messages" in SQL Server through JDBC?
By "Messages" I mean the Messages tab in the following figure, which includes "Warning", "n rows affected" and in the figure below, the execution time. In JDBC, ResultSet class is used to retrieve the ...
1
vote
0
answers
385
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....
0
votes
1
answer
52
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 ...
1
vote
2
answers
505
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
2
answers
148
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
2
answers
784
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 ...
0
votes
2
answers
753
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" ...
1
vote
0
answers
811
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 ...
1
vote
0
answers
102
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 ...
2
votes
1
answer
5k
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
2
answers
3k
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
0
answers
45
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
1
answer
165
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 ...
1
vote
1
answer
4k
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
1
answer
147
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
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 ...
0
votes
1
answer
128
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
1
answer
863
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
1
answer
43
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
1
answer
7k
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
1
answer
2k
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
1
answer
2k
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
1
answer
283
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
1
answer
126
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
3
answers
8k
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
3
answers
3k
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
1
answer
903
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
1
answer
231
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
1
answer
660
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 ...