Monday, June 6, 2022

Java integration libraries

The Java SE API is split between three informal components: base libraries, integration libraries, and desktop libraries. The integration libraries I divide into two components: database programming and distributed programming.

Database programming:

Support for databases was added to Java SE in version 1.1 with the JDBC API. The JDBC API is basically all about letting you run SQL queries to communicate with existing databases. Of course, you first need to setup a database and ensure that Java has the appropriate drivers to communicate it with, but once you have that you are ready to use JDBC.

JDBC
The java.sql package defines the JDBC API for accessing databases in Java programs. It handles all the basic aspects, like getting a connection to a database and executing SQL queries on it. All the databases handled by the builting JDBC library of Java SE are relational. They use the familiar mathematics of relational structures, to get to other types of databases you need to use something beyond the standard library.

Scripting

Java SE provides scripting language functionality as an integration library.

The Java scripting package
All Java scripting functionality is centered around the ScriptEngine interface in the javax.script package. ScriptEngine is implemented by classes that want to implement their own scripting functionality that takes in Strings.

Distributed computing:

Distributed computing is an outgrowth of networking. The Java SE platform lets you run Java methods on external machines using RMI. After the technical details are worked out, objects on external machines can be treated like they are on your own machine. The JDNI also provides you the ability to access information on machines in external locations.

RMI
The RMI (remote method invocation) library is the main basis of distributed computing in Java. It was introduced with the JDBC in the second release of the Java platform version 1.1. You can easily run methods on objects on your own machine, but RMI handles what happens if you want to execute methods on some other computer far away. First of all you have to serialize all your data on both ends, so it can be transferred. Secondly, you need to be able to handle networking issues in the remote ivocation.

JDNI
The JDNI is a naming and directory service for the Java platform. It is defined in the java.naming module module of Java SE. JDNI solves the issue of accessing resources on external machines, which requires that they have some kind of naming service. Directory services extend naming services with the addition of attributes. The JDNI can be used to share information between servers in distributed applications.

External links:
JDBC

RMI

JDNI

Disclaimer
These icons are part of the Oxygen Icon Set. All rights to these respect icons belong to their respective owners. They are included here for educative purposes.

No comments:

Post a Comment