Properties Class to Load Driver in JDBC | JDBC Tutorials

This JDBC Tutorials “Properties Class to Load Driver in JDBC” page explains clearly how to use properties file to load the driver dynamically into JDBC application.


 

Properties class:

  • Available in java.util package.
  • Used to construct Object from any Properties file.
  • We can Load Driver information and Connection String information using Properties class.

Properties class in Java API

 

Note: After constructing Properties Object, we need to load the properties file into Empty Object using InputStream.

load method in Properties class

 

  • InputStream is the abstract class, hence we need to construct any one of its sub class for example “FileInputStream”.
  • FileInputStream available in io package.

InputStream class in java API

Share this