Software
SQLTags — an open source SQL tag generator for JSP development
SQLTags is an open-source JSP tag generator that builds a custom tag for every table in a relational database.
Links
SQLTags is an open-source tool that is, fundamentally, a JSP tag generator that builds a custom JSP tag for every table in your SQL relational database. These generated tags provide a practical tool for rapid JSP development. SQLTags is intended to decrease development time, improve quality, and improve maintainability in database-driven JSP applications.
The generated classes provide the following functionality based on the underlying table
Basic table features
- JavaBean-style accessors and mutators for each column
- Support for all DML operations: insert, update, and delete
- Iteration based on JDBC record sets and a given
whereclause - Support for BLOB and CLOB data types
Foreign key features
- Direct access to columns within related tables based on imported foreign-key names
- Access to child record sets based on exported foreign-key names
- Automatic master-detail nesting based on foreign-key names
Servlet and JSP integration
- Integration with the servlet request object
- Automatic calls to column mutators when the servlet request object contains parameters matching column names
- Built-in array processing of multi-record row sets from the servlet request object
Additional features
- Built-in paging
- Built-in caching
- Easy master-detail nesting based on foreign-key names
- Tag attributes for each column’s value, select format, and bind format
The linked documentation is for SQLTags only. Refer to the individual third-party projects for documentation on external software.
Please refer to the Developer’s Guide found in the doc
directory of the standard SQLTags distribution for detailed instructions on installing and using
SQLTags.
Prerequisites
See the Developer’s Guide for more detailed requirements.
- Java Development Kit (JDK) version 1.3 or later
javaandjavacaccessible viaPATHCLASSPATHincluding thesqltags-0.x.x.jarfile and the JDBC driver for your database
Setup
- Copy the
sqltags-0.x.x.jarfile and your JDBC JAR files into theWEB-INF/lib/directory. - Add the JAR files, including JDBC, to your
CLASSPATH. - Run the SQLTags generator and build your custom tag library.
- Save the generated JAR file into the
WEB-INF/lib/directory.
Windows:
java -classpath sqltags-x-x-x.jar;anyJdbc.jar SQLTags
Unix:
java -classpath sqltags-x-x-x.jar:anyJdbc.jar SQLTags
Be sure that both JAR files are in the web server’s CLASSPATH.
Create a properties file to describe the database connection and place it into the WEB-INF/
directory:
# Sample SQLTags.properties
connectionTimeToLiveSeconds=240
connectionUrl=jdbc:oracle:thin:@localhost:1521:ORCL
maxPoolSize=1
minPoolSize=1
userName=scott
password=tiger
poolSize=2
databaseDriver=oracle.jdbc.OracleDriver
asciiStreamTypes=LONG
binaryStreamTypes=BLOB
characterStreamTypes=CLOB