The UDTT smart channel uses JPA as the data implementation.
You can use the UDTT smart channel DAO API to operate the data in the table. DAO API supports add, update, delete, and find operation. The following steps introduce how to use DAO API:
1 Specify the file bttsmartchannel.jar in your class path. This JAR file is located at ${btt_root}/lib/ bttsmartchannel.jar.
2 Specify the file com.ibm.ws.jpa.thinclient_7.0.0.jar standalone Java archive (JAR) in your class path. This standalone JAR file is available from the client and server installation images. The location of this file on the client install image is ${app_client_root}/runtimes/com.ibm.ws.jpa.thinclient_7.0.0.jar. The location of this file on the server install image is ${app_server_root}/runtimes/com.ibm.ws.jpa.thinclient_7.0.0.jar.
3 Specify the database connection driver jar in your class path. For DB2 v9 or v9.5 or v9.7, the driver JAR files are db2jcc.jar and db2jcc_license_cisuz.jar; For Oracle 11, the driver JAR file is ojdbc14.jar; For SQL Server 2005, the driver JAR file is sqljdbc.jar.
4 Create database, and then run the DDL files accordingly to the database type to generate or update the tables. The DDL files are available from the file bttsmartchannel.jar. For DB2, the DDL file is dataCollector_DB2.DDL; For Oracle, the DDL file is dataCollector_ORACLE.DDL; For SQL Server, the DDL file is dataCollector_SQLSERVER.DDL.
5 In the persistence.xml, specify your database configuration options. For DB2, specify as following configuration:
try{ smartDao.addSmartVisit(visit);//add the record smartDao.updateSmartVisit(visit);//update the record smartDao.deleteSmartVisit(visit);//delete the record }catch(Exception e){ e.printStackTrace(); }