JDBC and MySQL: Getting rid of the dreaded message – WARN: Establishing SSL connection without server’s identity verification is not recommended

When connecting to a MySQL database, you may encounter this scary warning message. Thu Feb 04 14:49:25 IST 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate [...]

By |2016-05-20T20:34:58-04:00May 20, 2016|How-To, Java, JDBC, MySQL|Comments Off on JDBC and MySQL: Getting rid of the dreaded message – WARN: Establishing SSL connection without server’s identity verification is not recommended

JDBC BLOB: Handling large file sizes

JDBC has support for storing binary files in the database using the BLOB datatype. I covered this in a previous blog post: Reading and Writing BLOBs with MySQL. However, you may run into errors if you need to store large files. In particular, you may encounter the following error messages: Packets larger than max_allowed_packet are not allowed. Data too long [...]

By |2015-10-27T09:38:20-04:00October 27, 2015|How-To, Java, JDBC, MySQL|Comments Off on JDBC BLOB: Handling large file sizes

Java JDBC Tutorial – Using MySQL Triggers to keep copy of previous value

I recently had a person ask the following question: For the employees table, every time I insert a new value in salary column the previous value is overwritten. Can we add new inserted value to the previous salary value before it is overwritten? Yes, we can accomplish this by using MySQL Triggers. Here's a quick run of the application so [...]

By |2015-01-26T06:04:42-05:00January 26, 2015|How-To, Java, JDBC, MySQL|Comments Off on Java JDBC Tutorial – Using MySQL Triggers to keep copy of previous value

Java JDBC Tutorial – Inserting Date and Time

In this blog post, I'll show you how to insert a date and time value into the database. The date and time is collectively known as a timestamp. JDBC has builtin support for saving and reading timestamps. This support is provided by java.sql.Timestamp. Let's assume we have this database table schema below. Make note of the timestamp column called checkout_time. [...]

By |2015-01-06T17:49:14-05:00January 6, 2015|How-To, Java, JDBC, MySQL|Comments Off on Java JDBC Tutorial – Inserting Date and Time

Java JDBC Tutorial – Part 12.x: Creating Runnable JAR file with Eclipse

In this blog post, I'll show you how to create an runnable JAR file. This will use the code from video 12.10. A runnable JAR file allows you to have a single JAR file that includes all Java class files and supporting libraries. In our case, this includes the JAR files for the MySQL JDBC driver (client api code only) [...]

By |2014-11-28T13:53:05-05:00November 28, 2014|How-To, Java, JDBC, MySQL, Swing|Comments Off on Java JDBC Tutorial – Part 12.x: Creating Runnable JAR file with Eclipse

Java JDBC Tutorial – Part 12.11: Connect Java Swing GUI to a MySQL Database – Date of Birth

Hi All, Things have being going good with the JDBC Swing GUI video series. I had a YouTube subscriber ask if I could expand on this example and show how to handle dates. So, in this post, we'll add support for read/write the date of birth for an employee. Overview of the Steps Add new database field for Date of [...]

By |2014-11-05T12:37:10-05:00November 5, 2014|How-To, Java, JDBC, MySQL, Swing|12 Comments
Go to Top