This is an example of an ANT to automatically SQL build table. When you run a method, build a Java Project first in Workshop, pour this three files, build this Java Project, if the ANT window is not displayed in Workshop, choose to see -> windows -> Ant
Double-click the icon in the ANT window when performing SQL.
Document 1: build.xml content is as follows:
XML Version = "1.0"?>
Author: aaronsi
Date: 05/25/2004
============================================================================================================================================================================================================= =================== ->
Default = "resetdb" Basedir = ""> Value = "PointBase" /> Value = "9093" /> Value = "com.pointbase.jdbc.jdbcuniversaldriver" /> Value = "Workshop" /> Value = "LocalHost" /> Value = "@ wl_home" /> path> Description = "Clear and repopulate the database" Depends = "CreateTables, BuildDatabase" /> Description = "Drop and create the demo tables" >
Value = "dbdemo_init.sql" />
Value = "WebLogic" />
Value = "WebLogic" /> ANTCALL> target> Description = "Populate Tables with DATA" Depends = "CreateTables">
Value = "dbdemo_data.sql" />
Value = "WebLogic" />
Value = "WebLogic" /> ANTCALL> target> Description = "Starts The PointBase Client with a SQL Script." > claspath> java> target> provject> Document 2: dbdemo_data.sql, the content is as follows: INSERT INTO DEMO.USERTABLE (Username, AGE, Address) Values ('aaron', 25, 'beijing'), ('Andy', 25, 'Shanghai') ; Document 3: dbdemo_init.sql, the content is as follows: Drop Schema Demo; Create Schema Demo; Create Table Demo.usertable ( Userid Identity Not Null, Username varchar2 (30), Age Int, Address Varchar2 (30), Constraint PK_CUSTOMER Primary Key (UserID) );