Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Appendix A. AccountService Example
Abstract
The
AccountService
example class illustrates how you can use Spring JdbcTemplate
class to access a JDBC data source.
A.1. 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
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 A.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 A.1. The AccountService Class