To create database through Java's code, you must use executeUpdate(sql); and connect to the mysql database as root.