Showing entries 1 to 10 of 348
10 Older Entries »
Displaying posts with tag: Java (reset)
MySQL BLOB Fetch Performance in Java

Cover image by DALL-E: “a manometer with pipe with a dolphin on a background, 3d render”

What’s the best way to store binary data in MySQL? This is a question that has multiple answers, depending on what you want to achieve. For example, if you need to optimize for the storage size, you probably need to use some compression algorithm that compresses your data efficiently. In my case, I really need the best performance, meaning the fastest response time to fetch the entire blob from MySQL.

Let’s put aside the question of whether MySQL is a good fit for storing binary data. The question here, is how to store binary data so the reads from DB are as fast as possible?

The …

[Read more]
AlmaLinux+Java+MySQL

AlmaLinux generally has Java installed. You can check whether java is installed with this command:

which -a java

It should return:

/usr/bin/java

Then, you can check the Java version with this command:

java -version

For AlmaLinux 9, it should return:

openjdk version "11.0.17" 2022-10-18 LTS
OpenJDK Runtime Environment (Red_Hat-11.0.17.0.8-2.el9_0) (build 11.0.17+8-LTS)
OpenJDK 64-Bit Server VM (Red_Hat-11.0.17.0.8-2.el9_0) (build 11.0.17+8-LTS, mixed mode, sharing)

Next, you check whether javac is installed. You can use the which command to determine whether it is installed. Generally, its not installed and you use this command to

sudo dnf search jdk | egrep -- '-17'

It should return:

Last metadata expiration check: 0:11:17 ago on Mon 19 Dec 2022 11:32:48 PM EST.
java-17-openjdk.x86_64 : OpenJDK 17 Runtime Environment
java-17-openjdk-demo.x86_64 …
[Read more]
Database migration with Spring Boot and Flyway

Database migration or schema evolution is inevitable in any long-lasting project. While NoSQL databases give more leeway, relational databases are pretty rigid regarding schema evolution. Hence, having a suitable tool [...]

The post Database migration with Spring Boot and Flyway appeared first on Geeky Hacker.

MySQL rewriteBatchedStatements configuration property

Introduction In this article, we are going to see how MySQL rewriteBatchedStatements works when using JDBC, JPA, or Hibernate. I first researched this MySQL configuration property when I was writing the batching chapter of my High-Performance Java Persistence book, and, back then, I discovered that this setting allows batching plain Statement by rewriting the SQL string that is sent to the database. However, the MySQL 6 Connector/J documentation mentioned that: for prepared statements, server-side prepared statements can not currently take advantage of this rewrite option So, for a long time, I wrongly... Read More

The post MySQL rewriteBatchedStatements configuration property appeared first on Vlad Mihalcea. …

[Read more]
Log4j RCE 0-day Mitigation

Background # A critical vulnerability CVE-2021-44228 in the Apache Log4j logging library was disclosed on Dec 9. The project provided release 2.15.0 with a patch that mitigates the impact of this CVE. It was quickly found that the initial patch was insufficient, and an additional CVE CVE-2021-45046 followed. This has been fixed in release 2.16.0. Who is affected? # The bulk of vitess code is in golang, and is unaffected by these vulnerabilities.

Support EOL for MySQL Connector/J 5.1

Per Oracle’s Lifetime Support policy, as of Feb 9th, 2021, MySQL Connector/J 5.1 series is covered under Oracle Sustaining Support. Downloadable binaries can be found in the MySQL Products Archives and in the Maven Central Repository.

MySQL Connector/J 5.1.49 has been the last release of Connector/J 5.1 series.

It is time to move on. Users are encouraged to upgrade to MySQL Connector/J 8.0 series which provides the same features as Connector/J 5.1 and a lot more, including a brand new date/time handling support, introduced in version 8.0.23, and the X DevAPI that empowers the MySQL Document Store.

We like to hear from you. Please join …

[Read more]
High-Performance Java Persistence Newsletter, Issue 22

Introduction Welcome to a new issue of the High-Performance Java Persistence Newsletter in which we share articles, videos, workshops, and StackOverflow answers that are very relevant to any developer who interacts with a database system using Java. Articles From version 2.12, Percona PMM uses Victoria Metrics instead of Prometheus. Victoria Metrics provides better disk I/0 utilization and less memory usage. For more details about this change and its benefits, check out this article. By default, the MySQL JDBC Driver only emulates prepared statements. If you wonder whether server-side prepared statements perform better... Read More

The post High-Performance Java Persistence Newsletter, Issue 22 appeared first on …

[Read more]
X DevAPI Traffic Compression With Connector/J

X Protocol traffic compression is available on MySQL Server since version 8.0.19. A connector that also supports compression on its end can leverage this feature and reduce the byte streams that are exchanged with the Server.

By default, connections to a MySQL server are uncompressed, thus permitting exchanging data with a client or connector that doesn’t support compression. However, given a client or connector that also supports compression, it is recommended that client and server negotiate the connection compression by default. If this negotiation concludes successfully, both ends can then compress the data they send.

Compression at this level allows reducing the amount of bytes exchanged over the network, but at the cost of additional CPU resources required to run data inflate and deflate operations. The benefits of compression, therefore, occur primarily on low network bandwidth. One can assess the gain or loss due to the …

[Read more]
MySQL 8.0.20 JDBC

In April, when I updated from MySQL 8.0.17 to MySQL 8.0.19, I found that my Java connection example failed. That’s because of a change in the JDBC driver, which I blogged about then. Starting yesterday, I began updating a base Fedora 30 configuration again to MySQL 8.0.20. I wrote a testing program for the Java JDBC file last time, and when I ran it this time it told me that I didn’t have the JDBC driver installed, or in the $CLASSPATH. My Java diagnostic script, MySQLDriver.java, returned the following error message:

Error: Could not find or load main class MySQLDriver

The Java JDBC test program code is in the prior post. It simply loads the user, password, database, host, and port statically for my student …

[Read more]
Use MySQL in Quarkus with Hibernate and Panache

Quarkus is a supersonic Java framework built with a cloud-native first mentality. It’s blazing fast in startup and has a much smaller memory footprint compared to Spring Boot. Quarkus is [...]

The post Use MySQL in Quarkus with Hibernate and Panache appeared first on Geeky Hacker.

Showing entries 1 to 10 of 348
10 Older Entries »