Jsp-jstl-sql-setdatasource-tag
提供:Dev Guides
JSTL-SQL <sql:setDataSource>タグ
属性
Attribute | Description | Required | Default |
---|---|---|---|
driver | Name of the JDBC driver class to be registered | No | None |
url | JDBC URL for the database connection | No | None |
user | Database username | No | None |
password | Database password | No | None |
password | Database password | No | None |
dataSource | Database prepared in advance | No | None |
var | Name of the variable to represent the database | No | Set default |
scope | Scope of the variable to represent the database | No | Page |
例
MySQLデータベースのセットアップに関する次の情報を考慮してください-
- JDBC MySQL ドライバーを使用しています。
- ローカルマシンのTESTデータベースに接続します。
- TESTデータベースにアクセスするには、 user_id と mypassword を使用します。
上記のすべてのパラメーターは、MySQLまたはその他のデータベース設定によって異なります。 上記のパラメーターを考慮して、次の例では setDataSource タグを使用します-
後続のSQLタグで<sql:setDataSource>を使用します。