Skip to content

Tag: mysql

JOOQ MySQL DATETIME Type

I’m trying to generate this simple SQL with JOOQ and for some reason I can’t get it done. I want the following code to be generated for MySQL databases. I expected it to be something like Unfortunately, MySQLDataType is deprecated. JOOQ explicitly says to only use types declared in SQLDataType, bu…

Spring boot Mongo DB .yml configuration

When I use MySQL and hibernate for spring boot, I use below configuration in .yml file If it is mongoDB instead of MySQL and hibernate how does it change? Answer The mongodb properties are all prefixed with spring.data.mongodb. For user property you would use The list of available mongodb properties are here:…

Checking connection to MySQL (Java)

I’m working on creating my little-utility for MySQL, and I need some help. How I can check connection to MySQL (by login and password), like it was realised in phpMyAdmin, without pointing some database at first. Because most of solutions for work with databases need exactly that pointing. Thanks in adv…

Spring boot CLIENT_PLUGIN_AUTH is required

I have my app working fine on local, but when I tried to connect to remote server I get this error: CLIENT_PLUGIN_AUTH is required. Answer I got it. Step 1. Create an user on remote mysql server and grant all privileges. Step 2. Change datasource url Step 3. Change pom.xml mysql Check that version is changed …

How to return boolean result from SQL count via JPQL

I have a simple problem with sql query. I need to get true or false, I have tried multiple methods, but without good result. This query returns 0 because I have zero records in database. Perhaps the condition should be adjusted. Thanks for all ideas. Answer Solved, thank you all.

Add a jar file to another jar file

In my project I have this code that tell class loader to load Driver.class like so: In Eclipse it runs with no problems and I have created the Jar file of the project. But I don’t know how to insert the mysql-connector-java-5.1.7-bin.jar into a Jar file of my project. The folder structure look like this…