Please read the requirements

   http://www.xmlBlaster.org/xmlBlaster/doc/requirements/engine.service.rdbms.html
   http://www.xmlBlaster.org/xmlBlaster/doc/requirements/engine.service.rdbms.jdbcpool.html

for an explanation and an example how to use.


Ok, so this is a quick and dirty 'HOWTO' for the DB adapter.

Note that you can query a database over xmlBlaster synchronously
usig the get() method (see XmlDBClientSync) or asynchronously
using the publish()/callback.update() methods (see XmlDBClient).

In the synchronous way, the get() method is blocking until
the database result is ready,
whereas the asynchronous mode sends the query to the database (no blocking)
and the result is returned later with the update() method.

================================================================
Add the following line to your xmlBlaster.properties file (if not there already):

   JdbcDriver.drivers=oracle.jdbc.driver.OracleDriver,org.gjt.mm.mysql.Driver,postgresql.Driver

   ProtocolPlugin[JDBC][1.0]=org.xmlBlaster.protocol.jdbc.JdbcDriver

   CbProtocolPlugin[JDBC][1.0]=org.xmlBlaster.protocol.jdbc.CallbackJdbcDriver

JdbcDriver.drivers is a comma delimited list of databse drivers.
Use as many as you like.
The appropriate driver class files(jar) must be in your classpath.
================================================================

Start up the server (java org.xmlBlaster.Main)

-----TESTING-----
You will need access to a database!
You can use the XmlDBClient unchanged if you don't mind typing a lot.
To invoke the client, try something similar to the following:

java javaclients.jdbc.XmlDBClient
        -url "jdbc:postgresql://24.3.47.214/postgres"
        -user postgres
        -pass secret
        -query "select * from foo_table"
        -limit 50
        -confirm true

or to invoke an update:

   java javaclients.jdbc.XmlDBClient \
     -url "jdbc:oracle:thin:@localhost:1521:MARCEL" \
     -user marcel \
     -pass secret \
     -type update \
     -query "INSERT INTO myTable VALUES( '1', to_date('0816', 'hh24mi'), 'james', 'START')"

Options:
        -url (any valid JDBC url)
        -user (valid DB username)
        -pass (valid DB password)
        -query (any valid SQL syntax)
        -type (query|update) query by default - determines the interaction with db
        -confirm (true|false) true by default - when set to true, you get an answer
        -limit (any integer) 50 by default - used to limit the number of rows returned

NOTE:
        If you are querying, set your -type to 'query'.
        If you are updating (insert, update, delete) set -type to 'update'.
        If you are updating and don't want a confirmation, set -confirm to 'false'.

For an example of what to expect, please look over the .xml files
located in demo/javaclients/jdbc.

Most exceptions are caught and returned in the appropriate xml message.
There are still one or two bugs that need to be squashed,
but I am working on those.

If you have any difficulty or questions, feel free to send me an email at
jmbirchfield@proteus-technologies.com

Jim


