このコンテンツは選択した言語では利用できません。
Appendix B. AccountService Example
Abstract
The
AccountService example class illustrates how you can use Spring JdbcTemplate class to access a JDBC data source.
B.1. AccountService Example Code リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
Overview リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
The
AccountService class provides a simple example of accessing a data source through JDBC. The methods in this class can be used inside a local transaction or inside a global (XA) transaction.
Database schema リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
The
AccountService example requires a single database table, accounts, which has two columns: a name column (containing the account name), and an amount column (containing the dollar balance of the account). The required database schema can be created by the following SQL statement:
CREATE TABLE accounts (name VARCHAR(50), amount INT);
CREATE TABLE accounts (name VARCHAR(50), amount INT);
AccountService class リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
Example B.1, “The AccountService Class” shows the complete listing of the
AccountService class, which uses the Spring JdbcTemplate class to access a JDBC data source.
Example B.1. The AccountService Class