[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to use the DB Adapter

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

First things first.  Do an update and do a make all.

Add the following line to your xmlBlaster.properties file:

It is a comma delimited list of databse drivers.  Use as many as you
The appropriate driver class files(jar) must be in your classpath.
(If you are using jdk 1.2, having the jar file in jre/lib/ext will
not do you any good.  It must be in the CLASSPATH.  This is due
to the bootstrapping of jaco)

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

Start up the XmlDBAdapter (jaco
(To exit the adapter, type 'q' in the console).

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

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

	-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
	-confirm (true|false) true by default - when set to true, you get an
	-limit (any integer) 50 by default - used to limit the number of rows

	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

For an example of what to expect, please look over the .xml files
in demo/javaclients/jdbc.  Most exceptions are caught and returned in
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
jmbirchfield at proteus-technologies.com