Java Database Connectivity: Difference between revisions

Content deleted Content added
Types: Incident Identifier: 380215E6-2CC0-4F22-BA33-ADEC63899CD6 CrashReporter Key: a9c97b0521d9f92b07d8452e4e9e57d8a8b830d2 Hardware Model: iPhone4,1 Date/Time: 2019-10-29 16:44:59.493 -0500 OS Version: iOS 6.1.3 (10B329) panic(cpu 0 caller 0x8d32f683): "AppleUSBEHCI[0x8f666800]::WaitForAsyncSchedule: USBCMD (0x00010351) and USBSTS (0x0000e000) did not synchronize" Debugger message: panic OS version: 10B329 Kernel version: Darwin Kernel Version 13.0.0: Wed Feb 13 21:37...
Tags: Mobile edit Mobile web edit
 
(52 intermediate revisions by 40 users not shown)
Line 1:
{{Short description|API for Java}}
{{Infobox software
'''Java Database Connectivity''' ('''JDBC''') is an [[application programming interface]] (API) for the [[Java (programming language)|Java]] programming language which defines how a client may access a [[database]]. It is a Java-based data access technology used for Java database connectivity. It is part of the [[Java Standard Edition]] platform, from [[Oracle Corporation]]. It provides methods to query and update data in a database, and is oriented toward [[Relational database|relational databases]]. A JDBC-to-[[ODBC]] bridge enables connections to any ODBC-accessible data source in the [[Java virtual machine]] (JVM) host environment.{{Infobox software
|name = JDBC
|logo =
Line 13 ⟶ 14:
|website = {{Javadoc:SE-guide|jdbc|JDBC API Guide}}
}}
 
'''Java Database Connectivity''' ('''JDBC''') is an [[application programming interface]] (API) for the programming language [[Java (programming language)|Java]], which defines how a client may access a [[database]]. It is a Java-based data access technology used for Java database connectivity. It is part of the [[Java Standard Edition]] platform, from [[Oracle Corporation]]. It provides methods to query and update data in a database, and is oriented towards [[relational database]]s. A JDBC-to-[[ODBC]] bridge enables connections to any ODBC-accessible data source in the [[Java virtual machine]] (JVM) host environment.
 
==History and implementation==
[[Sun Microsystems]] released JDBC as part of [[Java Development Kit]] (JDK) 1.1 on February 19, 1997.<ref name="JDK 1.1 release">
{{cite web wrong
| title = Sun Ships JDK 1.1 -- Javabeans Included
| date = 1997-02-19
| work = www.sun.com
| publisher = [[Sun Microsystems]]
| archiveurlurl =https://web.archive.org/web/20080210044125/ http://www.sun.com/smi/Press/sunflash/1997-02/sunflash.970219.0001.xml
| archive-url = https://web.archive.org/web/20080210044125/http://www.sun.com/smi/Press/sunflash/1997-02/sunflash.970219.0001.xml
| archivedate =2008-02-10
| accessdateurl-status = 2010-02-15dead
| archive-date =2008-02-10
| access-date = 2010-02-15
| quote = February 19, 1997 - The JDK 1.1 [...] is now available [...]. This release of the JDK includes: [...] Robust new features including JDBC for database connectivity
}}
Line 30 ⟶ 32:
Since then it has been part of the [[Java Platform, Standard Edition]] (Java SE).
 
The JDBC classes are contained in the [[Java package]] {{Javadoc:SE|package=java.sql|java/sql|module=java.sql}} and {{Javadoc:SE|package=javax.sql|javax/sql|module=java.sql}}, as well as a few other classes elsewhere. Everything involved in JDBC is exported through [[Java Platform Module System|module]] <code>java.sql</code>.
 
Starting with version 3.1, JDBC has been developed under the [[Java Community Process]]. JSR 54 specifies JDBC 3.0 (included in J2SE 1.4), JSR 114 specifies the JDBC Rowset additions, and JSR 221 is the specification of JDBC 4.0 (included in Java SE 6).<ref>[http://java.sun.com/products/jdbc/download.html#corespec40 JDBC API Specification Version: 4.0].</ref>
 
JDBC 4.1, is specified by a maintenance release 1 of JSR 221<ref>{{cite web|url=http://jcp.org/aboutJava/communityprocess/mrel/jsr221/index.html|title=The Java Community Process(SM) Program - communityprocess - mrel|author=|date=|website=jcp.org|accessdateaccess-date=22 March 2018}}</ref> and is included in Java SE 7.<ref>{{cite web|url=http://docs.oracle.com/javase/7/docs/technotes/guides/jdbc/jdbc_41.html|title=JDBC 4.1|author=|date=|website=docs.oracle.com|accessdateaccess-date=22 March 2018}}</ref>
 
JDBC 4.2, is specified by a maintenance release 2 of JSR 221<ref>{{cite web|url=https://jcp.org/aboutJava/communityprocess/mrel/jsr221/index2.html|title=The Java Community Process(SM) Program - communityprocess - mrel|author=|date=|website=jcp.org|accessdateaccess-date=22 March 2018}}</ref> and is included in Java SE 8.<ref>{{cite web|url=http://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/jdbc_42.html|title=JDBC 4.2|author=|date=|website=docs.oracle.com|accessdateaccess-date=22 March 2018}}</ref>
 
The latest version, JDBC 4.3, is specified by a maintenance release 3 of JSR 221<ref>{{cite web|url=https://jcp.org/aboutJava/communityprocess/mrel/jsr221/index3.html|title=The Java Community Process(SM) Program - communityprocess - mrel|author=|date=|website=jcp.org|accessdateaccess-date=22 March 2018}}</ref> and is included in Java SE 9.<ref>{{cite web|url=http://docs.oracle.com/javase/9/docs/api/java/sql/package-summary.html|title=java.sql (Java SE 9 & JDK 9)|author=|date=|website=docs.oracle.com|accessdateaccess-date=22 March 2018}}</ref>
 
{| class="wikitable"
==Functionality==
|+ JDBC versions
JDBC ('Java Database Connectivity') allows multiple implementations to exist and be used by the same application. The API provides a mechanism for dynamically loading the correct Java packages and registering them with the JDBC Driver Manager. The Driver Manager is used as a connection factory for creating JDBC connections.
|-
 
! JDBC version !! Java version !! Release Type !! Release date
JDBC connections support creating and executing statements. These may be update statements such as SQL's [[Create (SQL)|CREATE]], [[Insert (SQL)|INSERT]], [[Update (SQL)|UPDATE]] and [[Delete (SQL)|DELETE]], or they may be query statements such as [[Select (SQL)|SELECT]]. Additionally, stored procedures may be invoked through a JDBC connection. JDBC represents statements using one of the following classes:
|-
* {{Javadoc:SE|java/sql|Statement}} &ndash; the statement is sent to the database server each and every time.
| 1.1 || JDK 1.1 || Main || 1997-02-19.<ref name="JDK 1.1 release" />
* {{Javadoc:SE|java/sql|PreparedStatement}} &ndash; the statement is cached and then the [[Query plan|execution path]] is pre-determined on the database server allowing it to be executed multiple times in an efficient manner.
|-
* {{Javadoc:SE|java/sql|CallableStatement}} &ndash; used for executing [[stored procedures]] on the database.
| [https://www.jcp.org/en/jsr/detail?id=54 3.0] || J2SE 1.4 || Main || 2002-05-09
 
|-
Update statements such as INSERT, UPDATE and DELETE return an update count that indicates how many [[Row (database)|rows]] were affected in the database. These statements do not return any other information.
| [https://www.jcp.org/en/jsr/detail?id=221 4.0] || Java SE 6 || Main || 2006-12-11
 
|-
Query statements return a JDBC row result set. The row result set is used to walk over the [[result set]]. Individual [[Column (database)|columns]] in a row are retrieved either by name or by column number. There may be any number of rows in the result set. The row result set has metadata that describes the names of the columns and their types.
| [https://www.jcp.org/en/jsr/detail?id=221 4.1] || Java SE 7 || Maintenance || 2011-10-13
 
|-
There is an extension to the basic JDBC API in the {{Javadoc:SE|package=javax.sql|javax/sql}}.
| [https://www.jcp.org/en/jsr/detail?id=221 4.2] || Java SE 8 || Maintenance || 2014-03-04
 
|-
JDBC connections are often managed via a [[connection pool]] rather than obtained directly from the driver.
| [https://www.jcp.org/en/jsr/detail?id=221 4.3] || Java SE 9 || Maintenance || 2017-09-21
|}
 
==Functionality==
{| class="wikitable floatright"
|+ Host database types which Java can convert to with a function
Line 111 ⟶ 116:
|}
 
Since JDBC is mostly a collection of interface definitions and specifications, it allows multiple implementations of these interfaces to exist and be used by the same application at runtime. The API provides a mechanism for dynamically loading the correct Java packages and registering them with the JDBC Driver Manager ({{code|DriverManager}}). {{code|DriverManager}} is used as a {{java|Connection}} [[Factory (object-oriented programming)|factory]] for creating JDBC connections.
 
JDBC connections support creating and executing statements. JDBC connections support update statements such as SQL's [[Create (SQL)|CREATE]], [[Insert (SQL)|INSERT]], [[Update (SQL)|UPDATE]] and [[Delete (SQL)|DELETE]], or query statements such as [[Select (SQL)|SELECT]]. Additionally, stored procedures may be invoked through a JDBC connection. JDBC represents statements using one of the following classes:
* {{Javadoc:SE|java/sql|Statement|module=java.sql}} &ndash; the {{java|Statement}} is sent to the database server each and every time. In other words, the {{java|Statement}} methods are executed using SQL statements to obtain a {{code|ResultSet}} object containing the data.{{sfn | Bai | 2022 | p=74}}
* {{Javadoc:SE|java/sql|PreparedStatement|module=java.sql}} &ndash; {{code|PreparedStatement}} is a subinterface of the {{code|Statement}} interface.{{sfn | Bai | 2022 | p=74}} The statement is cached and then the [[Query plan|execution path]] is pre-determined on the database server, allowing it to be executed multiple times in an efficient manner.{{sfn | Bai | 2022 | p=74}} {{code|PreparedStatement}} is used to execute pre-compiled SQL statements.{{sfn | Bai | 2022 | p=74}} Running pre-compiled statements increases statement execution efficiency and performance. The {{code|PreparedStatement}} is often used for dynamic statement where some input parameters must be passed into the target database.{{sfn | Bai | 2022 | loc=§4.2.3.5 More About the Execution Methods | pp=122-124}} The
{{code|PreparedStatement}} allows the dynamic query to vary depending on the query parameter.{{sfn | Bai | 2022 | loc= §3.2 JDBC Components and Architecture | pp=72-74}}
* {{Javadoc:SE|java/sql|CallableStatement|module=java.sql}} &ndash; {{code|CallableStatement}} is a subinterface of the {{code|Statement}} interface.{{sfn | Bai | 2022 | loc= §3.2 JDBC Components and Architecture | pp=72-74}} It is used for executing [[stored procedures]] on the database.{{sfn | Bai | 2022 | loc= §3.2 JDBC Components and Architecture | pp=72-74}}{{sfn | Horstmann | 2022 | loc=§5.5.3 SQL Escapes}} Both input and output parameters must be passed into the database for stored procedures.{{sfn | Bai | 2022 | loc= §4.2.3.5 JDBC Components and Architecture | pp=122-124}}
 
Update statements such as INSERT, UPDATE and DELETE return an update count indicating the number of [[Row (database)|rows]] affected in the database as an integer.{{sfn | Bai | 2022 | loc= §4.2.3.5 JDBC Components and Architecture | pp=122-124}} These statements do not return any other information.
 
Query statements return a JDBC row result set. The row result set is used to walk over the [[result set]]. Individual [[Column (database)|columns]] in a row are retrieved either by name or by column number. There may be any number of rows in the result set. The row result set has metadata that describes the names of the columns and their types.
 
There is an extension to the basic JDBC API in the {{Javadoc|module=java.sql|package=javax.sql|monotype=y}}.
 
JDBC connections are often managed via a [[connection pool]] rather than obtained directly from the driver.{{sfn | Bai | 2022 | loc=§3.5.1 JDBC DataSource | p=83}}
 
==Examples==
 
When a Java application needs a database connection, one of the <code>DriverManager.getConnection()</code> methods is used to create a JDBC connection{{java|Connection}}. The URL used is dependent upon the particular database and JDBC driver. It will always begin with the "jdbc:" protocol, but the rest is up to the particular vendor.
 
<sourcesyntaxhighlight lang="java5java">
Connection conn = DriverManager.getConnection(
"jdbc:somejdbcvendor:other data needed by some jdbc vendor",
Line 129 ⟶ 149:
} catch (Throwable e) { /* Propagate the original exception
instead of this one that you want just logged */
logger.warn("Could not close JDBC Connection", e);
}
}
</syntaxhighlight>
</source>
 
Starting from Java SE 7 you can use Java's [http://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html try-with-resources] statement to makesimplify the above code simpler:
<sourcesyntaxhighlight lang=java5"java">
try (Connection conn = DriverManager.getConnection(
"jdbc:somejdbcvendor:other data needed by some jdbc vendor",
Line 142 ⟶ 162:
/* you use the connection here */
} // the VM will take care of closing the connection
</syntaxhighlight>
</source>
 
Once a connection is established, a statement{{java|Statement}} can be created.
 
<sourcesyntaxhighlight lang=java5"java">
try (Statement stmt = conn.createStatement()) {
stmt.executeUpdate("INSERT INTO MyTable(name) VALUES ('my name')");
}
</syntaxhighlight>
</source>
 
Note that Connections{{java|Connection}}s, Statements{{java|Statement}}s, and ResultSets{{java|ResultSet}}s often tie up [[operating system]] resources such as sockets or [[file descriptor]]s. In the case of Connections{{java|Connection}}s to remote database servers, further resources are tied up on the server, e.g., [[Cursor (databases)|cursors]] for currently open ResultSets{{java|ResultSet}}s.
It is vital to <code>close()</code> any JDBC object as soon as it has played its part;
[[Garbage collection (computer science)|garbage collection]] should not be relied upon.
Line 159 ⟶ 179:
Data is retrieved from the database using a database query mechanism. The example below shows creating a statement and executing a query.
 
<sourcesyntaxhighlight lang=java5"java">
try (Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM MyTable")
Line 167 ⟶ 187:
for (int i = 1; i <= numColumns; i++) {
// Column numbers start at 1.
// Also, there are many methods on the result set to return
// the column as a particular type. Refer to the Sun documentation
// for the list of valid conversions.
Line 174 ⟶ 194:
}
}
</syntaxhighlight>
</source>
 
AnThe following code is an example of a <code>PreparedStatement</code> query, usingwhich uses <code>conn</code> and class from the first example.:
 
<sourcesyntaxhighlight lang=java5"java">
try (PreparedStatement ps =
conn.prepareStatement("SELECT i.*, j.* FROM Omega i, Zappa j WHERE i.name = ? AND j.num = ?")
Line 198 ⟶ 218:
for (int i = 1; i <= numColumns; i++) {
// Column numbers start at 1.
// Also, there are many methods on the result set to return
// the column as a particular type. Refer to the Sun documentation
// for the list of valid conversions.
Line 206 ⟶ 226:
} // try
} // try
</syntaxhighlight>
</source>
 
If a database operation fails, JDBC raises an {{Javadoc:SE|java/sql|SQLException|module=java.sql}}. There is typically very little one can do to recover from such an error, apart from logging it with as much detail as possible. It is recommended that the {{code|SQLException}} be translated into an application ___domain exception (an unchecked one) that eventually results in a transaction rollback and a notification to the user.
 
AnThe following code is an example of a [[database transaction]]:
<sourcesyntaxhighlight lang=java5"java">
boolean autoCommitDefault = conn.getAutoCommit();
try {
Line 225 ⟶ 245:
try { conn.setAutoCommit(autoCommitDefault); } catch (Throwable e) { logger.warn("Could not restore AutoCommit setting",e); }
}
</syntaxhighlight>
</source>
 
For an example of a <code>CallableStatement</code> (to call stored procedures in the database), see the {{Javadoc:SE-guide|jdbc/getstart/callablestatement.html|JDBC API Guide}} documentation.
 
<sourcesyntaxhighlight lang=java5"java">
import java.sql.Connection;
import java.sql.DriverManager;
Line 244 ⟶ 264:
Statement stmt = conn.createStatement();
String sql = "INSERT INTO emp1 VALUES ('pctb5361', ‘gajanan'kiril', 'krpuramjohn', 968666668)";
stmt.executeUpdate(sql);
Line 253 ⟶ 273:
}
}
</syntaxhighlight>
</source>
 
 
==JDBC drivers==
Line 264 ⟶ 283:
Commercial and free drivers provide connectivity to most relational-database servers. These drivers fall into one of the following types:
 
* [[JDBC driver#Type 1 Driver - JDBC-ODBC bridge|Type 1]] that calls native code of the locally available ODBC driver. (Note: In JDBC 4.2, JDBC-ODBC bridge has been removed<ref>{{cite web|url=https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/|title=Java JDBC API|author=|date=|website=docs.oracle.com|accessdateaccess-date=22 March 2018}}</ref>)
* [[JDBC driver#Type 2 Driver - Native-API Driver|Type 2]] that calls database vendor native library on a client side. This code then talks to database over the network.
* [[JDBC driver#Type 3 Driver - Network-Protocol Driver(MiddleWare Driver)|Type 3]], the pure-java driver that talks with the server-side middleware that then talks to the database.
* [[JDBC driver#Type 4 Driver - Database-Protocol Driver(Pure Java Driver)|Type 4]], the pure-java driver that uses database native protocol.
 
Note also a type called an [[internal JDBC driver]] - a driver embedded with [[Java Runtime Environment|JRE]] in Java-enabled SQL databases. It is used for [[Java stored procedure]]s. This does not fit into the classification scheme above, although it would likely resemble either a type 2 or type 4 driver (depending on whether the database itself is implemented in Java or not). An example of this is the KPRB (Kernel Program Bundled) driver<ref>
{{cite book
| last1 = Greenwald
Line 291 ⟶ 310:
}}
</ref>
supplied with [[Oracle Database | Oracle RDBMS]]. "jdbc:default:connection" offers a relatively standard way of making such a connection (at least the Oracle database and [[Apache Derby]] support it). However, in the case of an internal JDBC driver, the JDBC client actually runs as part of the database being accessed, and so can access data directly rather than through network protocols.Incident Identifier: 380215E6-2CC0-4F22-BA33-ADEC63899CD6
CrashReporter Key: a9c97b0521d9f92b07d8452e4e9e57d8a8b830d2
Hardware Model: iPhone4,1
Date/Time: 2019-10-29 16:44:59.493 -0500
OS Version: iOS 6.1.3 (10B329)
 
panic(cpu 0 caller 0x8d32f683): "AppleUSBEHCI[0x8f666800]::WaitForAsyncSchedule: USBCMD (0x00010351) and USBSTS (0x0000e000) did not synchronize"
Debugger message: panic
OS version: 10B329
Kernel version: Darwin Kernel Version 13.0.0: Wed Feb 13 21:37:19 PST 2013; root:xnu-2107.7.55.2.2~1/RELEASE_ARM_S5L8940X
iBoot version: iBoot-1537.9.55
secure boot?: YES
Paniclog version: 1
Kernel slide: 0x000000000ce00000
Kernel text base: 0x8ce01000
Epoch Time: sec usec
Boot : 0x5db8b21e 0x00000000
Sleep : 0x00000000 0x00000000
Wake : 0x00000000 0x00000000
Calendar: 0x5db8b233 0x00072300
 
Task 0x80036c20: 14320 pages, 118 threads: pid 0: kernel_task
thread 0x80ac70a0
kernel backtrace: 8bdb3b40
lr: 0x8ce884d1 fp: 0x8bdb3b70
lr: 0x8ce88d6d fp: 0x8bdb3b9c
lr: 0x8ce17ca7 fp: 0x8bdb3bb4
lr: 0x8d32f683 fp: 0x8bdb3d0c
lr: 0x8d35da11 fp: 0x8bdb3d28
lr: 0x8d3572ef fp: 0x8bdb3d50
lr: 0x8d358eb5 fp: 0x8bdb3d64
lr: 0x8d356ccd fp: 0x8bdb3d90
lr: 0x8d356c53 fp: 0x8bdb3d9c
lr: 0x8d05792f fp: 0x8bdb3dc4
lr: 0x8d32405d fp: 0x8bdb3dd8
lr: 0x8db1ec61 fp: 0x8bdb3dec
lr: 0x8d32812d fp: 0x8bdb3e04
lr: 0x8d325b49 fp: 0x8bdb3e1c
lr: 0x8d045ec1 fp: 0x8bdb3e54
lr: 0x8d046105 fp: 0x8bdb3e64
lr: 0x8d042f27 fp: 0x8bdb3e80
lr: 0x8d045fdd fp: 0x8bdb3e98
lr: 0x8d0460db fp: 0x8bdb3eb4
lr: 0x8d32ea89 fp: 0x8bdb3ed0
lr: 0x8d04fa75 fp: 0x8bdb3f50
lr: 0x8d04c09f fp: 0x8bdb3f68
lr: 0x8ce2fefd fp: 0x8bdb3fa8
lr: 0x8ce8655c fp: 0x00000000
 
Task 0x80036968: 266 pages, 3 threads: pid 1: launchd
Task 0x800366b0: 310 pages, 1 threads: pid 2: launchctl
Task 0x80035e88: 954 pages, 26 threads: pid 13: UserEventAgent
Task 0x800363f8: 622 pages, 7 threads: pid 14: wifid
Task 0x80036140: 583 pages, 6 threads: pid 15: awdd
Task 0x80035bd0: 377 pages, 5 threads: pid 16: timed
Task 0x80035660: 304 pages, 9 threads: pid 18: misd
Task 0x800353a8: 404 pages, 3 threads: pid 19: mediaremoted
Task 0x800350f0: 707 pages, 6 threads: pid 20: backupd
Task 0x80034b80: 438 pages, 4 threads: pid 22: iaptransportd
Task 0x800348c8: 697 pages, 5 threads: pid 23: ptpd
Task 0x80034358: 236 pages, 4 threads: pid 25: softwareupdated
Task 0x800340a0: 987 pages, 15 threads: pid 26: backboardd
Task 0x80033b30: 207 pages, 4 threa
 
===Sources===
* [[Oracle Corporation|Oracle]] provides a [http://www.oracle.com/technetwork/java/index-136695.html list of some JDBC drivers and vendors]
* [[Simba Technologies]] ships an SDK for building custom JDBC Drivers for any custom/proprietary relational data source
* CData Software ships type 4 JDBC Drivers for various applications, databases, and Web APIs.<ref>{{cite web|url=http://www.cdata.com/jdbc/|title=JDBC Drivers - CData Software|author=|date=|website=CData Software|accessdateaccess-date=22 March 2018}}</ref>
* RSSBus Type 4 JDBC Drivers for applications, databases, and web services<ref>{{cite web|url=http://www.rssbus.com/jdbc/|title=JDBC Drivers - CData Software|author=|date=|website=CData Software|accessdateaccess-date=22 March 2018|archive-date=22 December 2015|archive-url=https://web.archive.org/web/20151222115409/http://www.rssbus.com/jdbc/|url-status=dead}}</ref>
* DataDirect Technologies provides a comprehensive suite of fast Type 4 JDBC drivers for all major database they advertise as Type 5<ref name=datadirect>{{cite web
| url=http://www.datadirect.com/products/features/data-connectivity/type-5-jdbc/index.html
Line 367 ⟶ 324:
* JDBaccess is a Java persistence library for [[MySQL]] and [[Oracle database|Oracle]] which defines major database access operations in an easy usable API above JDBC
* [[JNetDirect Incorporated|JNetDirect]] provides a suite of fully Sun J2EE certified high-performance JDBC drivers.
* JDBCR4 is a service program written by [[Scott Klement]] to allow access to JDBC from [[IBM RPG|RPG]] on the [[IBM i]].<ref>{{cite web|title=Access External Databases from RPG with JDBCR4 Meat of the Matter|url=http://iprodeveloper.com/rpg-programming/access-external-databases-rpg-jdbcr4|accessdateaccess-date=12 April 2016|date=28 June 2012}}</ref>
* [[HSQLDB]] is a [[Relational database management system|RDBMS]] with a JDBC driver and is available under a BSD license.
* SchemaCrawler<ref name=schemacrawler>{{cite web
| author=Sualeh Fatehi
| url=https://github.com/schemacrawler/SchemaCrawler
| url=http://schemacrawler.sourceforge.net/
| title=SchemaCrawler
| work=SourceForgeGitHub
}}</ref> is an open source API that leverages JDBC, and makes database metadata available as plain old Java objects (POJOs)
 
Line 380 ⟶ 337:
* [[JDBCFacade]]
* [[Open Database Connectivity]] (ODBC)
* [[Object–relational mapping]] (ORM)
 
==References Citations ==
{{reflist}}
 
== References ==
* {{cite book | last=Bai | first=Ying | title=SQL Server Database Programming with Java | publisher=[[Springer International Publishing]] | publication-place=Cham | year=2022 | isbn=978-3-030-92686-1 | doi=10.1007/978-3-031-06553-8}}
* {{cite book | last=Horstmann | first=Cay | title=Core Java | publisher=Oracle Press Java | date=April 15, 2022 | isbn=978-0-13-787107-0}}
 
==External links==
{{Commons category|JDBC}}
{{Wikibooks|Java Programming/Database Programming}}
* {{Javadoc:SE-guide|jdbc|JDBC API Guide}}
* {{Javadoc:SE-guide|jdbc|JDBC API Guide}} This documentation has examples where the JDBC resources are not closed appropriately (swallowing primary exceptions and being able to cause NullPointerExceptions) and has code prone to [[SQL injection]]{{Citation needed|date=January 2012}}
* {{Javadoc:SE|package=java.sql|java/sql|module=java.sql}} API [[Javadoc]] documentation
* {{Javadoc:SE|package=javax.sql|javax/sql|module=java.sql}} API Javadoc documentation
* [httphttps://wwwweb.archive.org/web/20160111210342/http://orbroker.org/ O/R Broker] Scala JDBC framework
* [http://www.hsqldb.org/doc/2.0/util-guide/sqltool-chapt.html SqlTool] Open source, command-line, generic JDBC client utility. Works with any JDBC-supporting database.
* [http://codeoftheday.blogspot.com/2012/12/java-database-connectivity-jdbc-url.html JDBC URL Strings and related information of All Databases.]
 
{{DEFAULTSORT:Database Connectivity}}
[[Category:JavaJDK platformcomponents]]
[[Category:Java specification requests]]
[[Category:SQL data access]]
[[Category:Java APIs]]
[[Category:Database APIs]]