Updated March 29, 2023
Introduction to JDBC version
JDBC version is the release of JDBC software, there is multiple JDBC version available in the JDK implementation. The current stable version of JDBC is 4.3, it’s released on 21st September 2017, version 4.3 is a stable release means we can implement the API software using this version. The first version was released in 1997, its version name is JDBC 1.2 and this is the first stable release of JDBC. After releasing version 1.2 many stable releases are released in JDK implementation, JDBC 4.0 and later versions are supporting the java SE environment.
Versions of JDBC
- Basically, JDBC is an API (application programming interface) for the programming language as java. It will be defined to access the database server from the client.
- JDBC is nothing but the data access technology used in java applications. It is also part of the standard edition of the Java platform.
- This is used to query the data from the database and also used to update the data in the database. It is used in relational databases like MySQL, Oracle, PostgreSQL, etc.
- JDBC is allowing the implementation from the same application as well as from the existing applications.
- Basically, API is providing the mechanism to load the correct package for java which was registered with the diver manager of JDBC.
- JDBC driver manager is used in the connection factory to create a connection of JDBC. The full form of JDBC is java database connectivity.
- Basically, the JDBC connection will support creating & execute the statement which we have used with statement methods in java.
- JDBC will support the below java statement are as follows.
- Statement
- PreparedStatement
- CallableStatement
- The statement method is defined using statement class, the statement will be sent to the database server every execution time.
- Using PreparedStatement the statement will be cached, the statement is not precompiled into the database by using the PreparedStatement in JDBC connection.
- The callable statement is used to execute the stored procedure from the database server.
- Below is the version available are as follows.
JDBC version –
- JDBC 1.2
- JDBC 2.1
- JDBC 3.0
- JDBC 4.0
- JDBC 4.1
- JDBC 4.2
- JDBC 4.3
JDBC 1.2 –
- This version is released in 1997 and this is implemented in the JDK version as 1.1.
- This version will support the SQL query execution.
JDBC 2.1 –
- This version is released in 1999 and this is implemented in the JDK version as 1.2.
- This version will support the SQL query execution and character set.
JDBC 3.0 –
- This version is released in 2000 and this is implemented in the JDK version as 1.4.
- This version will support the SQL query execution and SQL driver.
JDBC 4.0 –
- This version is released in 2006 and this is implemented in the JDK version as Java SE 6.
- The main feature of the 4.0 version is it will automatically load the driver of java.sql.
- It will support the data type as a row.
- It will support the conversion of the national character set.
- JDBC version 4.0 is supporting the XML and SQL/XML.
JDBC 4.1 –
- This version is released in 2011 and this is implemented in the JDK version as Java SE 7.
- The main feature of the 4.1 version is it will add the support of the statement as try with resource.
- It has the enhanced date type value of timestamp.
- Also, this version will support the java object additional mappings to the JDBC types.
- This version will contain the changes in API as compared to the previous version name as 4.0.
JDBC 4.2 –
- This version is released in 2014 and this is implemented in the JDK version as Java SE 8.
- The main feature of the 4.2 version is it will support the ref cursor.
- This contains the additional java.sql interface as compared to the previous version name as 4.1.
- This contains the additional SQL type interface as compared to the previous version.
- This contains the additional JDBC type enum as compared to the previous version names as 4.1 and 4.0.
JDBC 4.3 –
- This version is released in 2017 and this is implemented in the JDK version as Java SE 9.
- This is the current stable version which was released in September 2017.
- This version will add the support of sharding.
- It will add the extra support for the connection builder interface as compared to the previous version.
- Also, this version will contain the interface of the sharding key.
- This version will contain the interface of the sharding key builder.
- Basically, JDBC 4.3 version is implemented in the JDK version as Java SE 9. But specific database driver for JDBC 4.3 is not available.
- JDBC version 4.3 is backwards compatible, we have not faced any problem while using java SE 9 or higher version with JDBC 3.0, JDBC 4.0, 4.1 and JDBC 4.2 drivers.
- We can check the version using the following steps are as follows.
Steps to check the version in windows
- Open the command prompt window by searching cmd in the search bar.
- After opening cmd prompt go to the folder where our JDBC jar file is located.
Code:
> cd downloads
Run the following command to check the version.
- For checking the version first we need to convert all data into the META-INF/MANIFEST.MF file.
- After creating the file then we have to check the version using findstr command.
Code:
> jar -xvf postgresql-42.2.23.jar META-INF/MANIFEST.MF
> more "META-INF/MANIFEST.MF" | findstr "Version"
- In the above example, we can see that it will be showing almost five versions from MANIFEST.MF file.
- First-line showing the version of manifest as 1.0.
- Second-line is showing the version of the bundle manifest. In the above example, we can see that version of the bundle manifest is 2.
- The third line showing the bundle version of the PostgreSQL JDBC driver, it will be showing the PostgreSQL JDBC driver version as 42.2.23.
- The fourth line showing the implementation version of the PostgreSQL JDBC driver, it will be showing the PostgreSQL JDBC implementation driver version as 42.2.23.
- The last line will be showing the actual version of JDBC i.e. 4.2.
Conclusion
There are multiple types of versions available to connect JAVA API to the database server. There are seven types of JDBC version available i.e. JDBC 1.2, JDBC 2.1, JDBC 3.0, JDBC 4.0, JDBC 4.1, JDBC 4.2 and JDBC 4.3. The latest stable version of JDBC is JDBC 4.3.
Recommended Articles
This is a guide to JDBC version. Here we discuss the multiple types of JDBC versions available to connect JAVA API to the database server. You may also have a look at the following articles to learn more –