JDBC Tutorial는
The JDBC API is a Java API that can access any kind of tabular data,
especially data stored in a Relational Database.
JDBC helps you to write java applications that manage these three programming
activities:
1. Connect to a data source, like a database
2. Send queries and update statements to the database
3. Retrieve and process the results received from the database in answer to
your query
The following simple code fragment gives a simple example of
these three steps:
Connection con = DriverManager.getConnection
("jdbc:myDriver:wombat", "myLogin","myPassword");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT a, b, c FROM Table1");
while (rs.next()) {
int x = rs.getInt("a");
String s = rs.getString("b");
float f = rs.getFloat("c");
}
This short code fragment instantiates a DriverManager object to
connect to a database driver and log into the database, instantiates a
Statement object that carries your SQL language query to the database;
instantiates a ResultSet object that retrieves the results of your query,
and executes a simple while loop, which retrieves and displays those
results. It's that simple.
Google 도서 here에 책 미리보기도 있습니다 인트로에서 좋은 출발점
스 니펫입니다. JDBC 자습서를 읽은 후
사용한 후에는 사실 이것이 최고의 튜토리얼이 아니라는 것을 알게되었습니다. 나는 틀릴 수도 있지만 인트로 물건 뒤에는 물건이 어떻게 작동하는지에 대해 단계적으로 누락 된 지시 사항이 나타납니다. 내가 튜토리얼을 바꾸기 전에 나는 그것의 대부분을 스스로 추론해야만했다. –
필자는 개인적으로 누락 된 부품을 찾지 못했지만 그래도 어디로 전환 했습니까? –
아파치 더비의 가이드를 따랐습니다 : http://db.apache.org/derby/docs/dev/getstart/ –