Skip to content

My example for creating JDBC application interacting with MySQL database

Notifications You must be signed in to change notification settings

elshadzarbali/jdbc-mysql-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

jdbc-mysql-example

  • Using Class.forName method in static block to load MySQL Driver class at runtime when DBUtil class is used fist time. So, driver class is loaded and registered once. We don't need additional method to load driver class every time we want to get connection.
  • Since JDBC 4.0, we don't need to explicitly load driver class. But, it is good practice to load driver class explicitly for backward compatibility.
  • Using getConnection method for getting Connection based on url, username and password.
  • Using handleSQLException method to handle SQLException.

User class

About

My example for creating JDBC application interacting with MySQL database

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages