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
5 votes
1 answer
2k views

Using SELECT to call a function in a jdbc migration

I'm looking to set up some Postgres/PostGIS migrations with clojure/jdbc. running side-effect functions with SELECT is proving to be an issue, with most migration libs eventually throwing the A ...
user3276552's user avatar
1 vote
1 answer
910 views

Can sequential queries result in concurrent transactions?

I'm using PostgreSQL 9.4.4 and the default configuration. I use a JDBC connection to run multiple queries in succession. Only one Java thread is using the connection and before a new query is executed ...
ben's user avatar
  • 155
2 votes
1 answer
1k views

How to connect DB2 with eclipse on mac? [closed]

I tried to connect the DB2 Express-C Version 10.1 to Eclipse Mars but it returns an exception when I tried to run the program. com.ibm.db2.jcc.am.DisconnectNonTransientConnectionException: Error ...
Kanishk's user avatar
  • 21
5 votes
1 answer
1k views

Replacing a large object in PostgreSQL

What should one do when one wishes to replace a large object with a new large object. An example would be to update an uploaded file with a new version. One way would presumably be to create a new ...
beldaz's user avatar
  • 1,680
1 vote
1 answer
11k views

Tomcat7 JDBC connection pool -> Connection has been abandoned

I have the following configuration for the JDBC connection pool initialSize="2" minIdle="10" maxIdle="50" maxActive="100" maxWait="15000" jdbcInterceptors="org.apache.tomcat.jdbc.pool.interceptor....
vtor's user avatar
  • 111
1 vote
1 answer
2k views

JDBC Exception JZ0BE: BatchUpdateException: A user with System Administrator (SA) role must reconfigure the system to enable Java

I am using Sybase JDBC JConnect3 driver to insert large data in a table using Batch Insert feature of JDBC. I am preparing a batch of 100 inserts and executing the batch. But it is throwing below ...
user avatar
1 vote
2 answers
785 views

What is wrong in my jdbc config pool?

I am using clearDB with max_connections plan being 40. This is my jdbc pool configuration: <bean id="dataSource" class="org.apache.tomcat.jdbc.pool.DataSource" destroy-method="close" ...
Cristian Boariu's user avatar
6 votes
1 answer
30k views

Connection Reset by Peer: Socket Write Error

We have a vendor working on Java (JDBC) application saying they are getting the error Connection Reset by Peer: Socket Write Error They are insisting that the SQL Server (SQL Server 2012) is ...
SomeGuy's user avatar
  • 1,973
2 votes
2 answers
1k views

Oracle instant client

What is the difference between instant client and the original Oracle client? The Oracle client is almost 800MB and the instant client is not so much. I need to install oracle client, ODBC drivers and ...
tesla747's user avatar
  • 1,876
2 votes
0 answers
18 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
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. ...
NaMo Murali Krishna Reddy's user avatar
2 votes
1 answer
350 views

Accurate PG database size for comparing representations

I have a Java/JDBC program that takes a sample file and imports the data into the database, shredding it across multiple relations. The program does this multiple times for several different ...
beldaz's user avatar
  • 1,680
1 vote
1 answer
704 views

JDBC prepared statement - make a token null

So, I have an insert statement in a Java program I'm writing. Under some conditions, I want it to insert some values as null. However, before I can execute the statement, I have to set all of the ...
Daniel Paczuski Bak's user avatar
1 vote
1 answer
6k views

Syntax error using preparedstatements with postgresql

I have a Java application connecting to a PostgreSQL database. Using straightforward code like: ps = con.prepareStatement(sql); if (dataTypes != null && dataTypes.size() >...
alpert's user avatar
  • 113
2 votes
1 answer
25k views

Dealing with single quotes in a dynamic query [closed]

I'm building a query as a string in my application layer to be executed over jdbc. The string is constructed as follows: "SELECT COUNT(DISTINCT ROOT_ID) as rows1 FROM DANIEL.UNIQUE_PHYSICIAN " ...
Daniel Paczuski Bak's user avatar
3 votes
2 answers
146 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
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, ...
Salmononius2's user avatar
1 vote
2 answers
1k views

How to populate another column with a sequence value generated for an identity column?

I have a table that has a column that is determined by a sequence using the identity column thing, so after a record is inserted (or during, I'm not sure how it works behind the scenes, only that it ...
Daniel Paczuski Bak's user avatar
1 vote
1 answer
399 views

Driver properties for db2jcc in Squirrell and MON_GET_CONNECTION table function

I'm trying to set driver properties like: clientAccountingInformation clientApplicationInformation clientProgramId clientProgramName in Squirrell 3.6 (http://squirrel-sql.sourceforge.net/). See ...
Lennart - Slava Ukraini's user avatar
4 votes
1 answer
908 views

Access operator added by extension inside a schema

I am writing an application that uses postgres. Each microservice uses its own schema inside the database. So connect to the database schema I use this jdbc string: jdbc:postgresql://${db.host}/${db....
Patrick Cornelissen's user avatar
5 votes
2 answers
24k views

JDBC local MSSQL Server connection string

I have installed open source database management tool "dbeaver" and want to use it instead of Sql Server Management Studio. But there is a problem. I searched from the internet but somehow I could not ...
Omer's user avatar
  • 433
0 votes
2 answers
2k views

No suitable driver found Orientdb jdbc driver

I have some problems with Orientdb driver for jdbc. i´m using Netbeans, i have include the library JDBC+OrientDB libraries (orientdb-jdbc-2.0.8-all.jar) in the directory and in netbeans, i have also ...
LaraCraft84's user avatar
5 votes
2 answers
2k views

MySQL overhead of calling a Stored Procedure

Within Java, we access MySQL (v5.5.40) via JDBC -- a prepare statement, setting parameters then calling the stored procedure. It appears that every execute() has the overhead of 4 meta-calls (per ...
Slawomir's user avatar
  • 453
0 votes
1 answer
2k views

jdbc connection string ORACLE , integrated security

we are trying to configure Spotfire to use JDBC connection to ORACLE. We would like it to use integrated security (I call it Active Directory, TIBCO seems to like integrated security). Here is the ...
greg's user avatar
  • 381
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
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
2 votes
1 answer
162 views

how can optimize this sql query for being faster than superman

this my sql query: SELECT * FROM (SELECT * FROM ClassifiedAd WHERE city_id = :city AND currency = :currency AND price > 100) UNION DISTINCT (SELECT c.* ...
SergiM's user avatar
  • 23
4 votes
2 answers
2k views

Database-agnostic stored procedure call passing array of name/value pairs

Background Looking to pass a set of name/value pairs into a stored procedure in a database-agnostic way, using JDBC. A database structure is defined as follows: CREATE TYPE array_parameters AS ( ...
Dave Jarvis's user avatar
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 ...
Srikanth Ganapavarapu's user avatar
0 votes
1 answer
3k views

Can't find sun.jdbc.odbc package in Java version 8 [closed]

I am trying to connect a database query to my class while I compile the package name sun.jdbc.odbc package but it is not found in Java version 8.
Akshay's user avatar
  • 1
4 votes
1 answer
3k views

What do these parameters mean at the beginning of my SQL Server query plan?

I'm looking at query plan in SQL Server Mgmt Studio and I see something like this: (@P0 nvarchar(4000), @P1 nvarchar(4000)) Update... What does the type mean beside the parameters? For this example ...
Stephen__T's user avatar
3 votes
1 answer
35k views

JDBC pooling Oracle driver Socket read timed out [duplicate]

I run Java EE application on Glassfish server v3 together with Oracle 12 DB on the same machine under Windows Server 2012 64bit. I use latest ojdbc7 driver. Connection pool config: <jdbc-...
karolkpl's user avatar
  • 131
2 votes
3 answers
1k views

Transaction Isolation level different threads massive number of Writes

I have a lot of threads that writing to DB some data in two tables. tbl_raw_data and tbl_parsed_data where tbl_parsed_data have foreign key to tbl_raw_data. I also need the writing to be superfast. ...
yossico's user avatar
  • 167
4 votes
2 answers
18k views

Configuring sqlnet.ora and tnsnames.ora on the client side

I have an application server talking to an Oracle database, using the Oracle instant client. We are troubleshooting a specific bug, and it was asked if I could add the following flags to to my sqlnet....
edinor's user avatar
  • 143
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 ...
beldaz's user avatar
  • 1,680
4 votes
1 answer
5k views

Proxy authentication for PostgeSQL

The following seems likely to be a fairly common situation, but I haven't seen any solutions. I have a PostgreSQL database containing views that are specific to the $user, in order to restrict data ...
beldaz's user avatar
  • 1,680
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
3 votes
2 answers
3k views

Does Postgresql support different transaction isolation per connection?

I just discovered that H2 doesn't support concurrent connections using different transaction isolation levels. Meaning, changing the transaction isolation of one connection affects all other ...
Gili's user avatar
  • 999
1 vote
1 answer
690 views

PostgreSQL 9.3 - Performance Issue: Counting table entries slower with jdbc postgres driver

I'm using PostgreSQL 9.3 and want to ask if it is possible to improve the performance of my queries based on the following database schema: CREATE TABLE "entities" ( "id" ...
user2715478's user avatar
4 votes
1 answer
5k views

How does Sybase store datetime information?

We have a Sybase database that currently stores datetime values in some of the tables. If we move that server with the Sybase database to another country which is in another time zone, will the ...
Jasper Citi's user avatar
1 vote
1 answer
531 views

MySQLSyntaxErrorException on ALTER TABLE ... CONVERT TO ... in MySQL Connector/J

Running Ubuntu 14.04 with mysql-connector-java-5.1.28 installed. Let's create a table: CREATE TABLE mytable (value1 VARCHAR(32000), value2 TEXT, value3 VARCHAR(1000), value4 VARCHAR(32000)) ...
Petr's user avatar
  • 113
3 votes
1 answer
860 views

Does it make sense to upgrade to a newer PostgreSQL JDBC driver?

I would like to know if it could be possible to gain any performance benefits from upgrading the default PostgreSQL JDBC drivers from applications like Confluence or JIRA. Assume that you cannot ...
sorin's user avatar
  • 1,212
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 ...
RoughPlace's user avatar
1 vote
1 answer
4k views

ORA-12516 but max_utilization not reaching limit

Our app began to raise ORA-12516, TNS:listener could not find available handler with matching protocol stack errors, and I'm trying to diagnose why. The workload has not changed, so I think we might ...
alci's user avatar
  • 442
0 votes
1 answer
3k views

No such column error jdbc

Suppose I have a table: SERVICE={SID,NAME,PORT} and with the help of a Java program, I want to select the SID of the known port with the help of a SQL query: Select SID from SERVICE ...
user1369975'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
0 votes
3 answers
2k views

How to IFNULL or COALESCE rewrite in a SQL query?

I there a way to rewrite a SQL query, so I can avoid IFNULL or COALESCE, because the HXTT DBF JDBC driver (supports SQL92) throws the following error.: Caused by: java.sql.SQLException: The aggregate ...
BuZZ-dEE's user avatar
  • 131
0 votes
3 answers
753 views

prepared statements are not inserted

i am new to JDBC and trying following code. Could not find the error in it try{ Connection con = ConnectionProvider.getCon(); stmt=con.prepareStatement("insert into ...
Santhosh's user avatar
  • 117
5 votes
3 answers
13k views

How to separate out individual sql statements from Oracle SQL script for execution from java code

I have Oracle DB 11g Enterprise Edition and I want to execute sql script from my java code. I am reading this sql script from a .sql file and the script contains statements such as create table, ...
Learner's user avatar
  • 151
0 votes
2 answers
1k views

Improve performance on write-only table?

I am using MySQL 5.5 with innoDB. The basis of my server is Netty, JDBC and BoneCP. I have a log table that contains user inputs(HTTP header, request body etc). This table will only be read very ...
Jee Seok Yoon's user avatar