What is the difference between javax.sql and java.sql I understand that javax.sql is for JavaEE. or am I wrong.
I am struggling with understanding this difference. And their usage scenarios.
The javax. sql package provides for the following: The DataSource interface as an alternative to the DriverManager for establishing a connection with a data source. Connection pooling and Statement pooling. Distributed transactions.
What you will probably be doing is using JDBC to allow Java to connect to SQL databases. There are also persistence layers, such as Hibernate, that you can use to store and retrieve data in a database using Java.
The JDBC API is comprised of two packages: java. sql. javax.
A connection (session) with a specific database. SQL statements are executed and results are returned within the context of a connection. A Connection object's database is able to provide information describing its tables, its supported SQL grammar, its stored procedures, the capabilities of this connection, and so on.
What is the difference between
javax.sql
andjava.sql
I understand thatjavax.sql
is for JavaEE.
It used to be that javax.sql
was for JDBC extensions that were in Java EE and not Java SE, but this changed as of JDBC 3.
Now both packages are part of JDBC in Java SE, and the fact that there are two packages is now just a historical anomaly. The two packages continue to exist because removing one would cause backwards compatibility problems.
Java.sql
Provides the API for accessing and processing data stored in a data source (usually a relational database) using the JavaTM programming language.
. This API includes a framework whereby different drivers can be installed dynamically to access different data sources. Although the JDBCTM API is mainly geared to passing SQL statements to a database, it provides for reading and writing data from any data source with a tabular format. The reader/writer facility, available through the javax.sql.RowSet group of interfaces, can be customized to use and update data from a spread sheet, flat file, or any other tabular data source.
Javax.sql
Provides the API for server side data source access and processing from the JavaTM programming language. This package supplements the java.sql package and, as of the version 1.4 release, is included in the Java Platform, Standard Edition (Java SETM). It remains an essential part of the Java Platform, Enterprise Edition (Java EETM).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With