Skip to content
Advertisement

Tag: mysql

Java async MySQL queries

First of all, I don’t have much experience with thread safe programming. I have a MySQL class, and I want to use one instance in multiple threads to prevent blocking code in the main thread. I read about connection pooling but I want to keep it as simple as it is. This is my MySQL class: Is it possible to

Java sorting is not the same with MySQL sorting

I need to check the sorting in the table and table content is given by MySQL. I’m trying the following: Collections.sort(sorted, String.CASE_INSENSITIVE_ORDER); And get the following result: tes3@test.com test4@test.com test5@test.com test@test.com test_user@mail.com user-og@driver.com And this is what I get from MySQL by query: SELECT ’email’ FROM ‘user’ WHERE 1 ORDER BY ‘user’.’email’ ASC : tes3@test.com test_user@mail.com test@test.com test4@test.com test5@test.com user-og@driver.com

jooq single query with one to many relationship

I have a table experiment and a table tags. There may be many tags for one experiment. schema: Is it possible to create a query with jooq which returns the experiments and the corresponding List of tags? something like Result<Record> where Record is a experimentRecord and a list of Tags, or a map<experimentRecord, List<TagRecord>. I also have a query which

Exception while trying to run java program from maven

I have a small java program that connects to a mysql db and reads data from it. I am able to run it successfully using java -cp but when I try to run it using mvn exec:java I get this exception after the program has finished: Why is this happening and how can I fix this? Here is my code

Advertisement