JDBC

[How-To] Print Date/Time in a Given Format in Java

Often, we wish to Format the Date and Time information into a given format, either for displaying the same to the end user or for further processing. Java contains formatting classes which can be used to format a date into a desired format. The most commonly used class for formatting dates is the SimpleDateFormat class. The SimpleDateFormat class takes format string as input to its constructor and returns a format object which can then be used to format Date objects. Calling the format() method of the SimpleDateFormat object will return a string that contains the formatted representation of the Date that is passed into the method as a parameter. The table below contains Time and Date Format Codes which can be used to format the Date Object.
Source:

JDBC Drivers:What are they?

JDBC has been a widely used API since long for interaction between Java Programs and various Databases. From a Java programmer’s perspective,JDBC API serves the following mentioned functions:
  • Loading the appropriate JDBC Driver
  • Creating connection with a database or a table based datasource.
  • Sends SQL Statements to the database/source.
  • Processing of the retrieved results.
Loading the driver is accomplished either by setting the jdbc.drivers system property, or by dynamically loading the appropriate driver class with a call to Class.forName(). try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Class.forName("com.oracle.jdbc.OracleDriver"); } catch (ClassNotFoundException e) { /* Handle Exception */ }Type of JDBC Drivers There are essentially four different types of JDBC Drivers which are categorized as
Source:

Valid XHTML 1.0 Strict

Syndicate content