<s>
Java	B-Language
Database	I-Language
Connectivity	I-Language
(	O
JDBC	B-Language
)	O
is	O
an	O
application	B-Application
programming	I-Application
interface	I-Application
(	O
API	B-Application
)	O
for	O
the	O
Java	B-Language
programming	I-Language
language	I-Language
,	O
which	O
defines	O
how	O
a	O
client	O
may	O
access	O
a	O
database	O
.	O
</s>
<s>
It	O
is	O
a	O
Java-based	O
data	O
access	O
technology	O
used	O
for	O
Java	B-Language
database	I-Language
connectivity	I-Language
.	O
</s>
<s>
It	O
is	O
part	O
of	O
the	O
Java	B-Language
Standard	I-Language
Edition	I-Language
platform	O
,	O
from	O
Oracle	B-Application
Corporation	I-Application
.	O
</s>
<s>
It	O
provides	O
methods	O
to	O
query	O
and	O
update	B-Language
data	O
in	O
a	O
database	O
,	O
and	O
is	O
oriented	O
toward	O
relational	B-Application
databases	I-Application
.	O
</s>
<s>
A	O
JDBC-to-ODBC	O
bridge	O
enables	O
connections	O
to	O
any	O
ODBC-accessible	O
data	O
source	O
in	O
the	O
Java	B-Language
virtual	I-Language
machine	I-Language
(	O
JVM	B-Language
)	O
host	O
environment	O
.	O
</s>
<s>
Sun	O
Microsystems	O
released	O
JDBC	B-Language
as	O
part	O
of	O
Java	B-Language
Development	I-Language
Kit	I-Language
(	O
JDK	B-Language
)	O
1.1	O
on	O
February	O
19	O
,	O
1997	O
.	O
</s>
<s>
Since	O
then	O
it	O
has	O
been	O
part	O
of	O
the	O
Java	B-Language
Platform	I-Language
,	I-Language
Standard	I-Language
Edition	I-Language
(	O
Java	B-Language
SE	I-Language
)	O
.	O
</s>
<s>
The	O
JDBC	B-Language
classes	O
are	O
contained	O
in	O
the	O
Java	B-Language
package	I-Language
and	O
.	O
</s>
<s>
Starting	O
with	O
version	O
3.1	O
,	O
JDBC	B-Language
has	O
been	O
developed	O
under	O
the	O
Java	B-Language
Community	I-Language
Process	I-Language
.	O
</s>
<s>
JSR	B-Language
54	I-Language
specifies	O
JDBC	B-Language
3.0	O
(	O
included	O
in	O
J2SE	B-Language
1.4	O
)	O
,	O
JSR	B-Language
114	I-Language
specifies	O
the	O
JDBC	B-Language
Rowset	O
additions	O
,	O
and	O
JSR	B-Language
221	I-Language
is	O
the	O
specification	O
of	O
JDBC	B-Language
4.0	O
(	O
included	O
in	O
Java	B-Language
SE	I-Language
6	O
)	O
.	O
</s>
<s>
JDBC	B-Language
4.1	O
,	O
is	O
specified	O
by	O
a	O
maintenance	O
release	O
1	O
of	O
JSR	B-Language
221	I-Language
and	O
is	O
included	O
in	O
Java	B-Language
SE	I-Language
7	O
.	O
</s>
<s>
JDBC	B-Language
4.2	O
,	O
is	O
specified	O
by	O
a	O
maintenance	O
release	O
2	O
of	O
JSR	B-Language
221	I-Language
and	O
is	O
included	O
in	O
Java	B-Language
SE	I-Language
8	O
.	O
</s>
<s>
The	O
latest	O
version	O
,	O
JDBC	B-Language
4.3	O
,	O
is	O
specified	O
by	O
a	O
maintenance	O
release	O
3	O
of	O
JSR	B-Language
221	I-Language
and	O
is	O
included	O
in	O
Java	B-Language
SE	I-Language
9	O
.	O
</s>
<s>
As	O
JDBC	B-Language
( 	O
 '	O
Java	B-Language
Database	I-Language
Connectivity	I-Language
 '	O
)	O
is	O
mostly	O
a	O
collection	O
of	O
interface	O
definitions	O
and	O
specifications	O
,	O
it	O
allows	O
multiple	O
implementations	O
of	O
these	O
interfaces	O
to	O
exist	O
and	O
be	O
used	O
by	O
the	O
same	O
application	O
at	O
runtime	O
.	O
</s>
<s>
The	O
API	B-Application
provides	O
a	O
mechanism	O
for	O
dynamically	O
loading	O
the	O
correct	O
Java	B-Language
packages	I-Language
and	O
registering	O
them	O
with	O
the	O
JDBC	B-Language
Driver	O
Manager	O
.	O
</s>
<s>
The	O
Driver	O
Manager	O
is	O
used	O
as	O
a	O
connection	O
factory	O
for	O
creating	O
JDBC	B-Language
connections	O
.	O
</s>
<s>
JDBC	B-Language
connections	O
support	O
creating	O
and	O
executing	O
statements	O
.	O
</s>
<s>
These	O
may	O
be	O
update	B-Language
statements	O
such	O
as	O
SQL	O
's	O
CREATE	O
,	O
INSERT	B-Language
,	O
UPDATE	B-Language
and	O
DELETE	B-Language
,	O
or	O
they	O
may	O
be	O
query	O
statements	O
such	O
as	O
SELECT	B-Language
.	O
</s>
<s>
Additionally	O
,	O
stored	B-General_Concept
procedures	I-General_Concept
may	O
be	O
invoked	O
through	O
a	O
JDBC	B-Language
connection	O
.	O
</s>
<s>
JDBC	B-Language
represents	O
statements	O
using	O
one	O
of	O
the	O
following	O
classes	O
:	O
</s>
<s>
the	O
statement	O
is	O
cached	O
and	O
then	O
the	O
execution	B-Language
path	I-Language
is	O
pre-determined	O
on	O
the	O
database	O
server	O
allowing	O
it	O
to	O
be	O
executed	O
multiple	O
times	O
in	O
an	O
efficient	O
manner	O
.	O
</s>
<s>
used	O
for	O
executing	O
stored	B-General_Concept
procedures	I-General_Concept
on	O
the	O
database	O
.	O
</s>
<s>
Update	B-Language
statements	O
such	O
as	O
INSERT	B-Language
,	O
UPDATE	B-Language
and	O
DELETE	B-Language
return	O
an	O
update	B-Language
count	O
that	O
indicates	O
how	O
many	O
rows	B-Application
were	O
affected	O
in	O
the	O
database	O
.	O
</s>
<s>
Query	O
statements	O
return	O
a	O
JDBC	B-Language
row	O
result	B-Application
set	I-Application
.	O
</s>
<s>
The	O
row	O
result	B-Application
set	I-Application
is	O
used	O
to	O
walk	O
over	O
the	O
result	B-Application
set	I-Application
.	O
</s>
<s>
Individual	O
columns	B-Application
in	O
a	O
row	O
are	O
retrieved	O
either	O
by	O
name	O
or	O
by	O
column	O
number	O
.	O
</s>
<s>
There	O
may	O
be	O
any	O
number	O
of	O
rows	B-Application
in	O
the	O
result	B-Application
set	I-Application
.	O
</s>
<s>
The	O
row	O
result	B-Application
set	I-Application
has	O
metadata	O
that	O
describes	O
the	O
names	O
of	O
the	O
columns	B-Application
and	O
their	O
types	O
.	O
</s>
<s>
There	O
is	O
an	O
extension	O
to	O
the	O
basic	O
JDBC	B-Language
API	B-Application
in	O
the	O
.	O
</s>
<s>
JDBC	B-Language
connections	O
are	O
often	O
managed	O
via	O
a	O
connection	B-General_Concept
pool	I-General_Concept
rather	O
than	O
obtained	O
directly	O
from	O
the	O
driver	O
.	O
</s>
<s>
When	O
a	O
Java	B-Language
application	O
needs	O
a	O
database	O
connection	O
,	O
one	O
of	O
the	O
DriverManager.getConnection( )	O
methods	O
is	O
used	O
to	O
create	O
a	O
JDBC	B-Language
connection	O
.	O
</s>
<s>
The	O
URL	O
used	O
is	O
dependent	O
upon	O
the	O
particular	O
database	O
and	O
JDBC	B-Language
driver	O
.	O
</s>
<s>
It	O
will	O
always	O
begin	O
with	O
the	O
"	O
jdbc	B-Language
:	O
"	O
protocol	O
,	O
but	O
the	O
rest	O
is	O
up	O
to	O
the	O
particular	O
vendor	O
.	O
</s>
<s>
Starting	O
from	O
Java	B-Language
SE	I-Language
7	O
you	O
can	O
use	O
Java	B-Language
's	O
statement	O
to	O
make	O
the	O
above	O
code	O
simpler	O
:	O
</s>
<s>
Note	O
that	O
Connections	O
,	O
Statements	O
,	O
and	O
ResultSets	B-Application
often	O
tie	O
up	O
operating	B-General_Concept
system	I-General_Concept
resources	O
such	O
as	O
sockets	O
or	O
file	B-Application
descriptors	I-Application
.	O
</s>
<s>
In	O
the	O
case	O
of	O
Connections	O
to	O
remote	O
database	O
servers	O
,	O
further	O
resources	O
are	O
tied	O
up	O
on	O
the	O
server	O
,	O
e.g.	O
,	O
cursors	B-Language
for	O
currently	O
open	O
ResultSets	B-Application
.	O
</s>
<s>
It	O
is	O
vital	O
to	O
close( )	O
any	O
JDBC	B-Language
object	O
as	O
soon	O
as	O
it	O
has	O
played	O
its	O
part	O
;	O
</s>
<s>
garbage	B-General_Concept
collection	I-General_Concept
should	O
not	O
be	O
relied	O
upon	O
.	O
</s>
<s>
If	O
a	O
database	O
operation	O
fails	O
,	O
JDBC	B-Language
raises	O
an	O
.	O
</s>
<s>
An	O
example	O
of	O
a	O
database	B-General_Concept
transaction	I-General_Concept
:	O
</s>
<s>
For	O
an	O
example	O
of	O
a	O
CallableStatement	O
(	O
to	O
call	O
stored	B-General_Concept
procedures	I-General_Concept
in	O
the	O
database	O
)	O
,	O
see	O
the	O
documentation	O
.	O
</s>
<s>
JDBC	B-Language
drivers	O
are	O
client-side	O
adapters	O
(	O
installed	O
on	O
the	O
client	O
machine	O
,	O
not	O
on	O
the	O
server	O
)	O
that	O
convert	O
requests	O
from	O
Java	B-Language
programs	O
to	O
a	O
protocol	O
that	O
the	O
DBMS	O
can	O
understand	O
.	O
</s>
<s>
Type	O
1	O
that	O
calls	O
native	O
code	O
of	O
the	O
locally	O
available	O
ODBC	B-Application
driver	O
.	O
</s>
<s>
Type	O
3	O
,	O
the	O
pure-java	O
driver	O
that	O
talks	O
with	O
the	O
server-side	O
middleware	O
that	O
then	O
talks	O
to	O
the	O
database	O
.	O
</s>
<s>
Type	O
4	O
,	O
the	O
pure-java	O
driver	O
that	O
uses	O
database	O
native	O
protocol	O
.	O
</s>
<s>
Note	O
also	O
a	O
type	O
called	O
an	O
internal	O
JDBC	B-Language
driver	O
-	O
a	O
driver	O
embedded	O
with	O
JRE	O
in	O
Java-enabled	O
SQL	O
databases	O
.	O
</s>
<s>
It	O
is	O
used	O
for	O
Java	B-Language
stored	I-Language
procedures	I-Language
.	O
</s>
<s>
This	O
does	O
not	O
fit	O
into	O
the	O
classification	O
scheme	O
above	O
,	O
although	O
it	O
would	O
likely	O
resemble	O
either	O
a	O
type	O
2	O
or	O
type	O
4	O
driver	O
(	O
depending	O
on	O
whether	O
the	O
database	O
itself	O
is	O
implemented	O
in	O
Java	B-Language
or	O
not	O
)	O
.	O
</s>
<s>
supplied	O
with	O
Oracle	B-General_Concept
RDBMS	I-General_Concept
.	O
</s>
<s>
"	O
jdbc:default:connection	O
"	O
offers	O
a	O
relatively	O
standard	O
way	O
of	O
making	O
such	O
a	O
connection	O
(	O
at	O
least	O
the	O
Oracle	B-General_Concept
database	I-General_Concept
and	O
Apache	B-Language
Derby	I-Language
support	O
it	O
)	O
.	O
</s>
<s>
However	O
,	O
in	O
the	O
case	O
of	O
an	O
internal	O
JDBC	B-Language
driver	O
,	O
the	O
JDBC	B-Language
client	O
actually	O
runs	O
as	O
part	O
of	O
the	O
database	O
being	O
accessed	O
,	O
and	O
so	O
can	O
access	O
data	O
directly	O
rather	O
than	O
through	O
network	O
protocols	O
.	O
</s>
