|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.protocol.jdbc.XmlDBAdapter
public class XmlDBAdapter
For every database access, an instance of this class does the work in a dedicated thread.
Field Summary | |
---|---|
private byte[] |
content
|
private Global |
glob
|
private static java.util.logging.Logger |
log
|
private static java.lang.String |
ME
|
private NamedConnectionPool |
namedPool
|
Constructor Summary | |
---|---|
XmlDBAdapter(Global glob,
byte[] content,
NamedConnectionPool namedPool)
Create the worker instance to handle a single RDBMS request. |
Method Summary | |
---|---|
private org.w3c.dom.Document |
createDocument()
Parse the XML encoded SQL statement. |
private org.w3c.dom.Document |
createEmptyDocument()
|
private org.w3c.dom.Document |
createUpdateDocument(int rowsAffected,
ConnectionDescriptor descriptor)
|
private MsgUnit[] |
getResponseMessage(byte[] content,
java.lang.String contentMimeExtended)
Create the result/exception/return message. |
private MsgUnit[] |
getResponseMessage(org.w3c.dom.Document doc)
SELECT results in XML. |
MsgUnit[] |
query()
Query the database. |
private org.w3c.dom.Document |
queryDB(ConnectionDescriptor descriptor)
Query the database. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String ME
private final Global glob
private static java.util.logging.Logger log
private byte[] content
private NamedConnectionPool namedPool
Constructor Detail |
---|
public XmlDBAdapter(Global glob, byte[] content, NamedConnectionPool namedPool)
content
- The SQL statementnamedPool
- A pool of JDBC connections for the RDBMS usersMethod Detail |
---|
public MsgUnit[] query()
<?xml version="1.0" encoding="UTF-8"?> <dbadapterresults> <row> 1 row(s) were affected during the update. </row> </dbadapterresults>SELECT results look like this:
<?xml version="1.0" encoding="UTF-8"?> <dbadapterresults> <desc> <numcolumns>2</numcolumns> <columnnames> <column>NAME</column> <column>AGE</column> </columnnames> <rownum>2</rownum> </desc> <results> <row> <NAME> Ben </NAME> <AGE> 6 </AGE> </row> <row> <NAME> Tim </NAME> <AGE> 8 </AGE> </row> </results> </dbadapterresults>Exceptions like this:
<exception id='" + id + "'> <class>JavaClass</class> <reason><![cdata[ bla bla ]]></reason> </exception>
private org.w3c.dom.Document createDocument() throws java.lang.Exception
java.lang.Exception
private org.w3c.dom.Document queryDB(ConnectionDescriptor descriptor) throws XmlBlasterException
XmlBlasterException
private org.w3c.dom.Document createEmptyDocument() throws XmlBlasterException
rowsAffected
- descriptor
-
XmlBlasterException
private org.w3c.dom.Document createUpdateDocument(int rowsAffected, ConnectionDescriptor descriptor) throws XmlBlasterException
rowsAffected
- descriptor
-
XmlBlasterException
private MsgUnit[] getResponseMessage(org.w3c.dom.Document doc)
private MsgUnit[] getResponseMessage(byte[] content, java.lang.String contentMimeExtended)
content
- contentMimeExtended
- Informative only, "XmlBlasterException" or "QueryResults"
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |