xmlBlaster 2.2.0 API

org.xmlBlaster.client
Class XmlDbMessageWrapper

java.lang.Object
  extended by org.xmlBlaster.client.XmlDbMessageWrapper

public class XmlDbMessageWrapper
extends java.lang.Object

Wrapping a SQL request with XML, to be used in the 'content' of a message.

This helps you to send a SQL request to the xmlBlaster JDBC service from James.

See Also:
ConnectionDescriptor

Field Summary
private  java.lang.String content
           
private  Global glob
           
private static java.lang.String ME
           
private  java.lang.String passwd
           
private  java.lang.String url
           
private  java.lang.String user
           
 
Constructor Summary
XmlDbMessageWrapper(Global glob, java.lang.String user, java.lang.String passwd, java.lang.String url)
          Constructor creates XML request.
 
Method Summary
 void init(java.lang.String type, int limit, boolean confirm, java.lang.String queryStr)
          Set the query properties.
 void initQuery(int limit, boolean confirm, java.lang.String queryStr)
          Set the query properties.
 void initUpdate(boolean confirm, java.lang.String updateStr)
          Set the update/insert/delete properties.
 MsgUnit toMessage()
          Creates the complete message for you, which you can publish to xmlBlaster.
 java.lang.String toXml()
          Returns the 'message content' which is the SQL request coded in XML.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

glob

private final Global glob

ME

private static java.lang.String ME

content

private java.lang.String content

user

private java.lang.String user

passwd

private java.lang.String passwd

url

private java.lang.String url
Constructor Detail

XmlDbMessageWrapper

public XmlDbMessageWrapper(Global glob,
                           java.lang.String user,
                           java.lang.String passwd,
                           java.lang.String url)
Constructor creates XML request.

Initialize current query with init() and access it with the toXml() or the toMessage() method.

Parameters:
user - The login name to database, "postgres"
passwd - The DB password
url - Any valid JDBC url, e.g. "jdbc:postgresql://24.3.47.214/postgres");
Method Detail

initQuery

public void initQuery(int limit,
                      boolean confirm,
                      java.lang.String queryStr)
Set the query properties.

Parameters:
limit - Maximum results to deliver, 50, used to limit the number of result rows
confirm - true/false, when set to true, you get an answer
queryStr - Any valid SQL syntax, "select * from intrauser"

initUpdate

public void initUpdate(boolean confirm,
                       java.lang.String updateStr)
Set the update/insert/delete properties.

Parameters:
confirm - true/false, when set to true, you get an answer
updateStr - Any valid SQL syntax, e.g. "INSERT INTO person VALUES(name='Peter')"

init

public void init(java.lang.String type,
                 int limit,
                 boolean confirm,
                 java.lang.String queryStr)
Set the query properties.

Access the message to send with the toMessage() method. You can reuse this object for different init() calls.

Parameters:
type - "query" or "update", "insert", "delete"
limit - Maximum results to deliver, 50, used to limit the number of result rows
confirm - true/false, when set to true, you get an answer
queryStr - Any valid SQL syntax, "select * from intrauser"

toXml

public java.lang.String toXml()
                       throws XmlBlasterException
Returns the 'message content' which is the SQL request coded in XML.

Throws:
XmlBlasterException

toMessage

public MsgUnit toMessage()
                  throws XmlBlasterException
Creates the complete message for you, which you can publish to xmlBlaster.

You will receive the result set wrapped in XML with a asynchronous update().

Throws:
XmlBlasterException

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.