A data source is a standard generic object that specifies the database or other resources to be used. You can connect your application to the database by connecting to a Java Database Connectivity (JDBC) data source.
The concept of data source is introduced to the extended API of OceanBase Connector/J. For convenience and portability, a data source can be bound to a Java Naming and Directory Interface (JNDI) entity so that databases can be accessed by using logical names.
The data source feature is a thorough replacement of the previous JDBC DriverManager feature. You can use both features in the same application. However, we recommend that you convert the application to a data source.
Data sources support JNDI, which provides applications with a method to find and access remote services and resources. These services can be any enterprise services. However, for JDBC applications, these services include only database connections and services.
JNDI allows applications to use logical names to access these services. That is, vendor-specific syntax can be removed from the application code. JNDI allows you to associate a logical name with a specified source of the desired service.
All OceanBase Connector/J data sources can be referenced by JNDI. Developers do not need to use this feature, but accessing databases through JNDI logical names can make the code more portable.