Questions tagged [connector-j]

69 questions
37
votes
2 answers

Correct way to keep pooled connections alive (or time them out and get fresh ones) during longer inactivity for MySQL, Grails 2 app

I have a grails app that has flurries of high activity, but then often periods of inactivity that can last several hours to over night. I notice that the first users in the morning get the following type of exception, and I believe this is due to…
Peter
  • 29,498
  • 21
  • 89
  • 122
19
votes
1 answer

Using getGeneratedKeys with batch inserts in MySQL with Connector/J

Using Connector/J, I would like to do a batch insert into a master table followed by a batch insert into a details table (PreparedStatement.executeBatch() for both). I haven't found much information online, so I'm looking for any feedback from…
ykaganovich
  • 14,736
  • 8
  • 59
  • 96
5
votes
1 answer

Do you still need an AWS RDS proxy when you already have an application side pooling in place?

As a follow-through on this question Do you still need an AWS RDS proxy when you already have an application side pooling in place? I have a Springboot application which uses the default HikariDataSource to manage the db connection pool. For the…
4
votes
2 answers

ResultSetImpl throws NullPointerException

i'm running mysql 5.5 with mysql 5.1.18 connector. a simple query of style select * from my_table where column_a in ('aaa','bbb',...) and column b=1; is executed from within java application. the query returns a resultset of 25k rows, 8 columns in…
atarno
  • 329
  • 1
  • 3
  • 14
3
votes
1 answer

Client-side emulation prepared statement in MySQL JDBC driver

I am trying to understand how client-side emulation prepared statement in MySQL JDBC driver works. Part 1 I read online that for prepared statements, there are four steps involved when a relational database handles a JDBC/SQL query and they are as…
Tay Wen Bin
  • 111
  • 2
  • 11
3
votes
1 answer

MySQL 5.5 Connector/J CharacterSet Encoding (utf8mb4) Issue

I am trying to properly store utf8mb4 strings into MySQL 5.5.30. We are using ConnectorJ 5.1.18. According to the documentation ConnectorJ should autodetect the character encoding based upon the character_set_server variable... However, as best as…
cadams500
  • 73
  • 1
  • 6
2
votes
1 answer

Java MySQL - Named Pipe connection throws warning on close

I am connecting to MySQL in Java with Connector/J using Named Pipes. My connection and query are successful, but I am receiving a warning when I try to close the connection. I would like to know what I should do to fix whatever is causing the…
Lucas
  • 875
  • 7
  • 15
2
votes
0 answers

class java.time.LocalTime cannot be cast to class java.sql.Time

I get this error when doing a batch update using setObject(int, LocalTime) with the combination of url properties: rewriteBatchedStatements=true and useServerPrepStmts=true This says that LocalDate, LocalDateTime and LocalTime have been fully…
Kevin
  • 367
  • 1
  • 2
  • 12
2
votes
2 answers

Store and retrieve a date in MySQL without any timezone information using MySQL Connector/J 8.0

We are now in the process of updating the MySQL Connector/J of a Spring Boot application from version 5 to 8 (we are actually updating the Spring Boot version from 2.0 to 2.1, but I don't think it's relevant for our problem). After upgrading the…
Jago
  • 155
  • 9
2
votes
2 answers

How do I instal Connector/J on windows 7?

I need step by step instructions. I have downloaded if from the mysql website http://dev.mysql.com/usingmysql/java/ But now I am not to sure what to do from here? I'm sort of stuck..
Aaron
  • 11,239
  • 18
  • 58
  • 73
2
votes
1 answer

Does MySQL's Connector/J work with MariaDB?

I'm attempting to connect to my MariaDB database using Connector/J from here, but this fails to work and MariaDB logs ` "[Warning] Aborted connection 12 to db: 'enwikt_parsed' user: 'javawiki' host: 'localhost' (Got an error reading…
stripedneck
  • 23
  • 1
  • 1
  • 3
2
votes
1 answer

How MySQL connector jar version can affect query performance?

Currently, in my application with mysql-connector-java:5.1.36, everything works fine. But when I upgrade connector to mysql-connector-java:5.1.47, a query starts to take minutes-2-hours time to execute. If I run the same query directly from the…
Rajat Goel
  • 2,207
  • 17
  • 35
2
votes
2 answers

Caching InitialContext and DataSource in a Java EE web-app

In the following Connector/J reference for JDBC/MySQL it suggests we cache the instances of InitialContext and Datasource. Would just making it a private static instance solve the caching? Shouldn't one have to be concerned with thread-safety (if at…
PhD
  • 11,202
  • 14
  • 64
  • 112
2
votes
1 answer

how to know the data size returned from mysql server with connector-j

I am using mysql with connector-j from java to perform a query. I would like to know the size of the data returned when I use it with/without compression. What is the best way to obtain the total amount of data passed from the server to the client? …
oshai
  • 14,865
  • 26
  • 84
  • 140
2
votes
1 answer

MySQL "No operations allowed after statement closed"

I'm running into a strange situation with a prepared statement hitting a MySQL database using MySQL Connector/J. In certain environments, I periodically have issues with longer existing (> 5 minutes) prepared statements. I frequently get an…
heavydutydev
  • 21
  • 2
  • 3
1
2 3 4 5