update emp SET sal=sal+500 where ename=:{myname VARCHAR}The expression, :{<variable> <variable_type>} defines a host variable of a particular SQL type. The expression is used in service-config.xml file to define variables in a DML statement, similarly to the symbol ? used in JDBC SQL statements.
To run this demo you need to ensure that you have installed the required software and set up your environment. In addition, an installation of the Oracle database is required.
<data-source
class="com.evermind.sql.DriverManagerDataSource"
name="OracleDS"
location="jdbc/OracleCoreDS"
xa-location="jdbc/xa/OracleXADS"
ejb-location="jdbc/OracleDS"
connection-driver="oracle.jdbc.driver.OracleDriver"
username="scott"
password="tiger"
url="jdbc:oracle:thin:@<host>:<port>:<sid>"
inactivity-timeout="30"
/>
java -jar oc4j.jar
jdbc:oracle:thin:@<host>:<port>:<sid>
antin the current directory. The last target "run-client" should give the following result:
[java] *** DML Update Return: 1This step accomplish several tasks including assembling, deploying, binding the application and then running the client. In the next section, Step 5a (Alternative to Step 5), we will detail how this step is implemented with separate commands.
java -jar $ORACLE_HOME/webservices/wsa.jar -config service-config.xmlThis step publishes queries defined in service-config.xml into Webservices. The following files will be generated.
java -jar $J2EE_HOME/admin.jar ormi://localhost admin welcome -deploy -file dist/dml.ear -deploymentName dml
java -jar $J2EE_HOME/admin.jar ormi://localhost admin welcome -bindWebApp dml dml-web http-web-site /dml
java -jar $ORACLE_HOME/webservices/wsa.jar -config client-config.xmlThe client proxy will be generated in the subdirectory build/classes/client.
Compile and run the client program using the ANT commands:
%ant compile-clientThe target "run-client" will give the result described in Section 5.
%ant run-client
http://localhost:8888/dml/dml