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
59
views
Can I write a Select query to update the data too
Can I write a Select query under a jdbc connection ,having a resultset object and which would update the records on just passing the select query them in my sql.
1
vote
1
answer
2k
views
postgres+JDBC: fire trigger with non autocommit transaction
i have a jdbc client that make an two INSERT query on database whitout autocommit, and a trigger on database that fires when a insertion is done on a certain table
public foo() throws MyException {
...
11
votes
3
answers
14k
views
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
...
0
votes
0
answers
2k
views
How to enable SSL in MySQL on Windows?
I'm a student doing a project which uses JDBC and MySQL (on Windows).
I have an application with connects to a MySQL server on a remote host.
To have a secure connection, I found this : http://www....
13
votes
2
answers
8k
views
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 ...
0
votes
1
answer
9k
views
How to retrieve data from Postgresql index using java
I am writing an application for searching, using text search of Postgresql. I am a beginner in Database. I created a Gin index and i am trying to get data from it. My code is
import java.sql....
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 ...
2
votes
0
answers
156
views
Wanted: Android versions of JDBC drivers for common RDMBSes
I've got a Java-based application library I'm trying to port to Android. The package presently supports:
Oracle
Informix
DB2
Postgres
Sybase
...And can easily be configured to use any other SQL92 ...
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,...
4
votes
4
answers
4k
views
Oracle 11g delete by unique key slow
We have been plagued by a deadlock issue for quite some time that relates to deletes and inserts on the same table. It happens sporadically, but had been increasing in frequency. It would manifest ...
1
vote
1
answer
62
views
Why isn't my includeThreadNamesAsStatementComment JDBC parameter working?
The JDBC API lists a includeThreadNamesAsStatementComment parameter that seems to indicate it will prefix all queries with the Java thread ID. I thought this would be useful in tying back DB activity ...
2
votes
1
answer
2k
views
LoadBalancing JDBC DataSource Connect without URL
When using JDBC I like the new DataSource-way to establish the connection. Further I like the isolated set-Methods for the properties like setUser, setPassword, setDriverType, setServerName, ...
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 ...
2
votes
2
answers
22k
views
Connect to Postgresql 9.2 from Eclipse Data Tools Platform
GOAL:
My goal is to write sql code within Eclipse to query a Postgresql database. The reason I want to write my queries within Eclipse is to then write R or Python code to perform statistical analysis ...
2
votes
1
answer
3k
views
jdbc: does setAutoCommit(true) commits past executions?
I would like to execute some statements, and commit the entire batch at the end. I've tried the following approach:
connection.setAutoCommit(false); // Don't commit for each statement
int[]...
1
vote
3
answers
4k
views
Derby/SQL - How to increase performance when left joining and retrieving varchar columns
Through trial and error I found that if I do a left join such as:
SELECT
firsttable.id,
secondtable.id,
secondtable.varcharColumn
FROM
firsttable
LEFT JOIN
secondtable
ON
...
1
vote
2
answers
9k
views
jdbc+mysql: "Deadlock found when trying to get lock; try restarting transaction"
After recovering from a disk-full problem, I started getting these errors in my logs:
java.sql.BatchUpdateException: Deadlock found when trying to get lock; try restarting transaction
at com....
0
votes
2
answers
10k
views
java.sql.SQLException: Login failed for user 'sa'
I am having trouble connecting to my Microsoft SQL Server database through a jTDS connection:
Connection conn = DriverManager.getConnection("jdbc:jtds:sqlserver://localhost:1433
/MnA;instance=...
2
votes
2
answers
6k
views
java.sql.SQLException: Login failed for user 'sa'
I am having trouble connecting to my SQL Server database through a jtds connection:
Connection conn = DriverManager.getConnection("jdbc:jtds:sqlserver://localhost:1433/MnA;instance=SQLEXPRESS", "sa","...
5
votes
2
answers
14k
views
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 ...
12
votes
1
answer
2k
views
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 ...
1
vote
1
answer
390
views
Postgres shared_buffers and pooled processes
I have read several articles (including Postgres docs) that suggest setting the shared_buffer's config value to 25% of your total physical memory.
Using my 4 GB memory as an example... If I ...
3
votes
1
answer
15k
views
Oracle 11g hunting down the deadlock, maybe foreign key?
I am trying to understand why a deadlock occurs in my database. The trace tells me that two updates on the same table are locking. In table is the first table to be written to in an transaction, only ...
0
votes
1
answer
927
views
Sybase ASE doing showplan for all requests
We have a strange situation where we are seeing showplan information in packets returned from a Sybase ASE 12.5 database server to a JDBC client. ie using tcpdump we see showplan output being sent ...
1
vote
2
answers
2k
views
Oracle 11. Updating BLOB field. Db file sequential read inappropriately slow?
I've and Oracle (11 Enterprise) schema with a table
CREATE TABLE USER.WSP_BUNDLE (
NODE_ID RAW(16) NOT NULL,
BUNDLE_DATA BLOB NOT NULL
);
CREATE UNIQUE INDEX USER.WSP_BUNDLE_IDX ...
0
votes
1
answer
10k
views
What is the JDBC URL for Oracle's Data Guard Fast-Start Failover?
Currently I have...
url=
"
jdbc:oracle:thin:@
(
DESCRIPTION=
(
ADDRESS_LIST=
(LOAD_BALANCE=OFF)
(FAILOVER=ON)
(
ADDRESS=
(PROTOCOL=TCP)
...
10
votes
4
answers
48k
views
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)
...
3
votes
1
answer
1k
views
Are there any good database management applications for JDBC/Java databases?
I am working with an Apache Derby/JavaDB database via JDBC. Before have I been working with MySQL and used phpMyAdmin as a good Database Management tool.
Is there any good desktop application for ...