Questions tagged [jdbc]

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

173 questions
13
votes
2 answers

To what extent is MariaDB Java client a perfect replacement for MySQL JDBC (Connector/J)?

Premise: I ship a Java application which will make a JDBC connection to a MySQL database. (At the time of this writing it could be 5.1 or 5.5, but hopefully the question and answer don't rely heavily on the version.) Observation: Clearly, I can use…
mdahlman
  • 349
  • 3
  • 14
12
votes
1 answer

Disable explicit commits in JDBC, detect them in SQL, or put the database in a readonly state

Background: I'm working on http://sqlfiddle.com (my site), and am trying to prevent one avenue of abuse possible there. I'm hoping that by asking about a problem I'm currently addressing, I don't inadvertently make the potential abuse worse, but…
Jake Feasel
  • 587
  • 1
  • 6
  • 22
11
votes
3 answers

Insert Speeds for large batches

In my application, my INSERTs seem to be taking a major chunk of the time. I have a large number of objects in memory (~40-50,000) which i want to insert into a table. Lets take a sample table CREATE TABLE bill ( id BIGINT(20) PRIMARY KEY, amount…
Aditya
  • 211
  • 1
  • 2
  • 5
10
votes
4 answers

Why does MySQL say I'm out of memory?

I was trying to execute a fairly large INSERT...SELECT in MySQL with JDBC, and I got the following exception: Exception in thread "main" java.sql.SQLException: Out of memory (Needed 1073741824 bytes) at…
Michael McGowan
  • 759
  • 2
  • 10
  • 20
6
votes
1 answer

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 "Results". Is there any way to get all the…
zli89
  • 887
  • 2
  • 10
  • 18
6
votes
2 answers

datetime fractional seconds

I am reading the description of the datetime datatype from Sybase ASE 15.7 documentation: datetime columns hold dates between January 1, 1753 and December 31, 9999. datetime values are accurate to 1/300 second on platforms that support this level…
Marcus Junius Brutus
  • 2,869
  • 6
  • 26
  • 40
6
votes
1 answer

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 forcibly disconnecting their application server for some…
SomeGuy
  • 1,923
  • 7
  • 32
  • 44
5
votes
2 answers

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 MySQL query log) preceding the actual SP call: SELECT…
Slawomir
  • 403
  • 3
  • 13
5
votes
3 answers

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, create type, alter table, drop type, drop procedure,…
Learner
  • 151
  • 1
  • 1
  • 2
5
votes
2 answers

Session in "Sql*net message from client", but is active

I've Googled around, and my impression is that Sql*net message from client suggests the Oracle DBMS is waiting for the client to send new commands to the DBMS, and therefore any time spent in this event should be client-side time and not consume…
RAY
  • 191
  • 1
  • 1
  • 5
5
votes
1 answer

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 but i'm trying to see if there's a way i can get…
JCole
  • 53
  • 1
  • 1
  • 5
5
votes
1 answer

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 usually take less than a second to complete but…
5
votes
1 answer

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 result was returned when none was expected error,…
user3276552
  • 151
  • 3
5
votes
2 answers

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 connect to db using dbeaver. My instance name…
Omer
  • 423
  • 4
  • 8
  • 16
4
votes
2 answers

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.ora…
edinor
  • 133
  • 1
  • 2
  • 8
1
2 3
11 12