Murthy's blog
Play with SQL SE
Are you trying to achieve SQL transport in your
integration scenario along with other open esb components then you are at the
right place. Read on to unveil and to get hands dirty with SQL Service Engine.
What all you need?
a. Netbeans enterprise pack 5.5.1
b. Database specific drivers (believe me nothing else you require)
Here are the steps to achieve SQL transport
a. Create SQL Project
Create new SQL project by choosing "SQL module" from "Service
Oriented Architecture" folder.
b. Create SQL File
Create a SQL file by choosing "SQL file" from "Service Oriented Architecture" folder, this SQL file embeds the netbeans SQL editor. We can use our sql writing skills and write them in the sql file.
c. Configure and build SQL project
Now we need to configure "connectivityInfo.xml", if we want
to connect to the database using plain driver connection just need to add the
url in "database-url value" as
shown below. If we are interested in using datasource then we should provide
"jndi-name value". SQL Service
Engine gives preference to use the datasource.
<database-url value='jdbc:oracle:thin:@localhost:1521:orcl'/>
<jndi-name value=''/>
</connection>
d. Configure using CASA editor in the Composite
Application
Create "Composite Application" Project
then add the previously built SQL project to the Composite Application Project.
After building the Composite App project now we have to add the soap bindings.
(It is because the WSDL generated by SQL project would be having plain bindings
rather any protocol specific bindings, and we use CASA editor capabilities to
attach protocol specific bindings to it, amazing right)
Edit the Composite Application project to add CASA port to it, drag and drop
the SOAP bindings from the CASA editor palette, rebuild the project. We
are done with configurations of SQL project, and our project artifacts are
ready for the deployment.
More on CASA look into this blog...
http://blogs.sun.com/joshweb/entry/the_casa_editor_in_100
e. Deploy with Composite Application
Deploy the Composite Application and create a test
case to run the application. While creating the test case please select the
CASA wsdl
That's it.....!!! We did it. It is so simple isn't it?
Sample Application
Download and extract the files below. Open these projects in NetBeans
Enterprise Pack 5.5.1 Beta (find it here http://www.netbeans.info/downloads/index.php?rs=20&p=6
)
Below sample application helps user to create a simple stored procedure
which inserts data into employee and department tables using oracle database.
Before running the application, run the script to create tables which are
required to create the procedure http://blogs.sun.com/narayana/resource/CreateTables.sql.
(We can as well create these tables using SQL Service Engine)
1. MySQLApp.zip (SQL project) http://blogs.sun.com/narayana/resource/MySQLApp.zip
2. MySQLJBI.zip (Composite Application
project) http://blogs.sun.com/narayana/resource/MySQLJBI.zip
Posted at 05:22PM Mar 14, 2007 by pedapudinarayana in Sun | Comments[2]
Wednesday Mar 14, 2007
Narayana,
Very good article, keep it up.
Regards
Narasimha
Posted by Narasimha Rao Konjeti on August 21, 2007 at 01:23 PM IST #
hi,
im creating a school management system based around BPEL. Can you tell if i can use the SQL Module to manipulate data from a database (e.g. Insert new data and view data) which i can then use in a BPEL process. Tips or Steps would be helpful.
Thanks in advance.
Posted by Azzy on December 07, 2007 at 04:34 AM IST #