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
13 views

How to connect to a MySQL Database with JDBC using Electron

So I've been tinkering (fresh out of college) with creating a DB app via Electron as practice. I've successfully created a Java-only program that uses JDBC to connect to an MySQL database, but now I ...
0
votes
1answer
20 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,...
0
votes
0answers
15 views

Oracle(12+) + Kerberos = Protocol Violation

we have an various oracle database installations and a few Kerberos KDC servers application uses JDBC driver latest 8 version and it works perfect with 11.2 version but when I try to connect to a bit ...
0
votes
0answers
46 views

PSQLException: An I/O error occurred while sending to the backend

We are using PostgreSQL 11 wherein intermittently the below exception is popping up, causing our application to lose connection with the database. It isn't connecting until the application is ...
0
votes
0answers
20 views

Disable auto-rehash when connecting to mysql via jdbc?

Is there a way to specify equivalent of no-auto-rehash when connecting to mysql via jdbc? I am trying to connect to a large db and the initialization is slow. If I connect without jdbc and specify -A,...
0
votes
1answer
18 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
0answers
37 views

Unable to find oracle/dms/console/DMSConsole

I am using centos-8, java-8, tomcat-8, oracle 18.4.0 XE I not able to connect to the database. Tried to check everything that I was able to do but not able to understand where is the mistake. I ...
0
votes
0answers
36 views

Sigle sign on solution for Cassandra with Keycloak

Please suggest if there are possible solution of itegrating SSO for Cassandra with keycloak. I have searched for blogs for keyclock integration with cassandra. I couldn't find how to integrate these ...
0
votes
2answers
92 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 = "...
0
votes
1answer
28 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
40 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
128 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 ...
0
votes
1answer
23 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
367 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
33 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
156 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
40 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 ...
0
votes
2answers
110 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
166 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
40 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
99 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
2answers
247 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 ...
0
votes
0answers
632 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="...
-1
votes
1answer
263 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..#...
-1
votes
1answer
1k 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 ...
0
votes
2answers
2k 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 ...
1
vote
0answers
130 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 ...
0
votes
2answers
562 views

Can any database table name support double quotes "?

I need to know whether any database supports double quotes as a part of their table name. I am especially interested in JDBC compliant databases. And if they do, can I please know how?
1
vote
0answers
371 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 ...
0
votes
1answer
3k 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 ...
2
votes
1answer
2k 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
1answer
769 views

Can the new “SCRAM-SHA-256” password authentication mechanism in Postgres 10 and later work with any JDBC drivers?

Postgres 10 added support for a new password authentication mechanism, Salted Challenge Response Authentication Mechanism (SCRAM-SHA-256, see RFC 7677). Discussed by Michael Paquier. ➥ Can this ...
1
vote
0answers
65 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 ...
1
vote
0answers
682 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'...
0
votes
0answers
62 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, ...
1
vote
1answer
1k 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
2answers
3k views

Check Java Driver version in clients from Db2 server

I have a Db2 database that is being used by many applications in different servers. I want to check from the Db2 server if the Java driver used in the different client applications is up-to-date. Is ...
0
votes
1answer
128 views

Having multiple ResultSets in parallel on same connection.. Will it cause any problem? [Mysql/Postgres] [closed]

I have tried out the following in my local machine using jdbc/mysql: step 1: conn = getNewConnection step 2: stmt1 = "new statement" using connection 'conn' step 3: stmt2 = "new statement" using ...
1
vote
1answer
184 views

“Error while processing statement” running a query finding unique values with multiple values in other rows

Is there anything wrong in the syntax of this query finding unique values with multiple values in other rows? Select Distinct Ss.`cd`, Ss.`cd` From nit.assrr As Ss Join ( Select `cd` ...
0
votes
1answer
63 views

What if a connection closes in the middle of a commit?

I have a few large CSV files to upload to an instance of SQL Server.(Nope, can't use SSMS) I'm using JDBC to read the CSVs line by line and insert the lines in a table in batches. Supposing my code is ...
1
vote
1answer
875 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) ...
1
vote
0answers
5k 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....
0
votes
1answer
632 views

Polling SQL Databases [closed]

Is there any way to poll for MySQL database changes using JDBC? I need exactly which changes happened (not a simple yes/no). I tried using a thread which executes every 15 seconds to check whether my ...
2
votes
1answer
424 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 ...
1
vote
1answer
1k views

The server's DateStyle parameter was changed to ISO. The JDBC driver requires DateStyle to begin with ISO for correct operation

I use PostgreSQL 9.6.6 on CentOS Linux 7.4 and after upgrading the postgresql-jdbc package - # sudo yum update Failed to set locale, defaulting to C Loaded plugins: fastestmirror Loading mirror ...
2
votes
1answer
3k views

Validation query

By default for Oracle Databases validation query is "select 1 from dual". Tomcat says: ValidationQuery - If specified, this query MUST be an SQL SELECT statement that returns at least one row. ...
1
vote
1answer
2k views

Is there a JDBC Driver for Microsoft SSAS Tabular Databases?

Is there a JDBC Driver for Microsoft SSAS Tabular Databases? Is so where can they be downloaded?
4
votes
1answer
7k views

How do I use the `COPY` command with JDBC

So I've been working with postgre databases and I noticed that it throws an error sometimes when I try to read a csv file and copy to a table remotely. It works perfectly when I use a buffered reader ...
1
vote
0answers
1k 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 ...
1
vote
1answer
689 views

What is the new JDBC 4.3 Connection Request feature with `beginRequest` & `endRequest` methods?

The JDBC 4.3 update arrived with Java 9 2017-10. Amongst its few changes is the new feature on Connection where the beginRequest and endRequest methods signals… Hints to the driver that a request, ...