DBScriptTest.jws Sample

This topic inludes the source code for the DBScriptTest.jws Sample.

Sample Location

This sample is located in the following directory in your WebLogic Workshop installation:

BEA_HOME/weblogic81/samples/workshop/ExtensionDevKit/ControlDevKit/DBScripter/docs/samples/partners/DBScripter/DBScripterSample/ScriptTest/test/

Sample Source Code


01 package test;
02 
03 import com.bea.control.JwsContext;
04 
05 public class DBScriptTest implements com.bea.jws.WebService
06 
07     /**
08      * @common:control
09      */
10     private test.DsPointBaseTest dsPointBaseTest;
11 
12     // because "samples" needs to be part of the package name
13 
14 
15     public Callback callback;
16 
17     /** @common:context */ 
18     JwsContext context; 
19 
20     public interface Callback
21     {
22 
23         /**
24          * @jws:conversation phase="finish"
25          */
26         void onScriptDone(java.lang.String arg0);
27     }
28 
29     /**
30      * This method creates two new Data Sources to the existing PointBase database.  These data sources are
31      * DsPointBaseTest and DsPointBaseTestNoTx.  The "NoTx" data source sets the flag to not participate 
32      * in global transactions.   
33      <br>
34      * Suggested parameters: 
35      <br><b>Server: </b>//localhost
36      <br><b>Port: </b>9093 (workshop domain)
37      <br><b>Database: </b>workshop (workshop domain)
38      <br><b>User: </b>PBPUBLIC
39      <br><b>Password: </b>PBPUBLIC
40      * @common:operation
41     */
42     public java.lang.String createDsPointBaseTest(java.lang.String server, java.lang.String port, java.lang.String database, java.lang.String user, java.lang.String password)
43     {
44         return dsPointBaseTest.createDsPointBaseTest(server,port,database,user,password);
45     }
46 
47     /**
48      * This method runs a script against the data source.
49      * The value is assumed to be an absolute file path.
50      * @common:operation
51      * @jws:conversation phase="start"
52      */
53     public void runFileScript(java.lang.String filePath)
54     {
55         dsPointBaseTest.runFileScript(filePath);
56     }
57 
58     public void dsPointBaseTest_onScriptDone(java.lang.String arg0)
59     {
60         callback.onScriptDone(arg0);
61     }
62 
63 
64     /**
65      * In this method the path is stored as an annotation.  
66      * It refers to a resource file in the control jar
67      <br>
68      * @common:operation
69      * @jws:conversation phase="start"
70      */
71     public void runScriptInstnwind()
72     {
73         dsPointBaseTest.runScriptInstnwind();
74     }
75