Difference between revisions of "Information Systems:Using JDBC"
(Created page with "JDBC is what allows Java to access databases. It is a part of the standard JDK (java.sql). Resources for learning JDBC are abundant. This page discusses usage of JDBC at uniPH...") |
m |
||
| Line 2: | Line 2: | ||
==UWDDBConnection== |
==UWDDBConnection== |
||
| − | Found in <code>com.unipharm.uwd.utils</code> ([[Information Systems:com.unipharm.uwd (Java |
+ | Found in <code>com.unipharm.uwd.utils</code> ([[Information Systems:com.unipharm.uwd (Java integrations project)|UWD Java Integrations)]]. |
This class was created to be a connection manager of sorts i.e. to provide convenience methods. The current state is that it requires massive improvement. For one, it should be converted to use connection pooling. |
This class was created to be a connection manager of sorts i.e. to provide convenience methods. The current state is that it requires massive improvement. For one, it should be converted to use connection pooling. |
||
Revision as of 13:37, 27 May 2021
JDBC is what allows Java to access databases. It is a part of the standard JDK (java.sql). Resources for learning JDBC are abundant. This page discusses usage of JDBC at uniPHARM.
UWDDBConnection
Found in com.unipharm.uwd.utils (UWD Java Integrations).
This class was created to be a connection manager of sorts i.e. to provide convenience methods. The current state is that it requires massive improvement. For one, it should be converted to use connection pooling.
Connection Pooling
Using a connection pool is important to prevent the opening and closing of DB connections (worst case scenario is one connection open/close per DB operation), which is an "expensive" process. The JDBC API provides the facilities to implement a connection pooling mechanism from scratch, but there are established libraries that already do this for you. The one in use for the UWD Integrations project is HikariCP.
Integrator itself
JTOpen
The database facilities in JTOpen extend JDBC classes. For example, the AS400JDBCConnection class extends java.sql.Connection