Use ANT automatically SQL in Workshop8.1

xiaoxiao2021-03-06  60

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:

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" />

Description = "Clear and repopulate the database"

Depends = "CreateTables, BuildDatabase" />

Description = "Drop and create the demo tables"

>

Value = "dbdemo_init.sql" />

Value = "WebLogic" />

Value = "WebLogic" />

Description = "Populate Tables with DATA"

Depends = "CreateTables">

Value = "dbdemo_data.sql" />

Value = "WebLogic" />

Value = "WebLogic" />

Description = "Starts The PointBase Client with a SQL Script."

>

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)

);

转载请注明原文地址:https://www.9cbs.com/read-111228.html

New Post(0)