public class DBAccess
extends java.lang.Object
Constructor and Description |
---|
DBAccess() |
Modifier and Type | Method and Description |
---|---|
boolean |
createBLOBTable(java.sql.Connection con, java.lang.String tablename)
Create BLOB table
|
boolean |
createXMLTable(java.sql.Connection con, java.lang.String tablename)
Create XML table
|
boolean |
deleteBLOBName(java.sql.Connection con, java.lang.String tablename, java.lang.String xmlname)
Delete binary file from BLOB table
|
boolean |
deleteXMLName(java.sql.Connection con, java.lang.String tablename, java.lang.String xmlname)
Delete file from XML table
|
boolean |
dropBLOBTable(java.sql.Connection con, java.lang.String tablename)
Delete BLOB table
|
boolean |
dropXMLTable(java.sql.Connection con, java.lang.String tablename)
Delete XML table
|
byte[] |
getBLOBData(java.sql.Connection con, java.lang.String tablename, java.lang.String xmlname)
Retrieve binary file from BLOB table
|
int |
getNameSize()
Returns the size of the field where the filename is kept.
|
java.lang.String |
getXMLData(java.sql.Connection con, java.lang.String tablename, java.lang.String xmlname)
Retrieve text file from XML table
|
java.lang.String[] |
getXMLNames(java.sql.Connection con, java.lang.String tablename)
Returns all file names in XML table
|
java.lang.String[] |
getXMLTableNames(java.sql.Connection con, java.lang.String tablePrefix)
Gets all XML tables with names starting with a given string
|
boolean |
insertBLOBData(java.sql.Connection con, java.lang.String tablename, java.lang.String xmlname, byte[] xmldata)
Inserts binary file as a row in BLOB table
|
boolean |
insertXMLData(java.sql.Connection con, java.lang.String tablename, java.lang.String xmlname, java.lang.String xmldata)
Inserts text file as a row in XML table
|
boolean |
isXMLTable(java.sql.Connection con, java.lang.String tablename)
Check if the table is XML table.
|
boolean |
replaceXMLData(java.sql.Connection con, java.lang.String tablename, java.lang.String xmlname, java.lang.String xmldata)
Replace text file as a row in XML table
|
boolean |
xmlTableExists(java.sql.Connection con, java.lang.String tablename)
Checks if the XML table exists
|
public int getNameSize()
public boolean isXMLTable(java.sql.Connection con, java.lang.String tablename) throws java.lang.Exception
con
- - the Connection objecttableName
- - the table name to testjava.lang.Exception
public java.lang.String[] getXMLTableNames(java.sql.Connection con, java.lang.String tablePrefix) throws java.lang.Exception
con
- - the Connection objecttablePrefix
- - table prefix stringjava.lang.Exception
public boolean insertXMLData(java.sql.Connection con, java.lang.String tablename, java.lang.String xmlname, java.lang.String xmldata) throws java.sql.SQLException, java.io.IOException
con
- - the Connection objecttablename
- - the table namexmlname
- - the file namexmldata
- - string with the file datajava.sql.SQLException
java.io.IOException
public boolean insertBLOBData(java.sql.Connection con, java.lang.String tablename, java.lang.String xmlname, byte[] xmldata) throws java.sql.SQLException, java.io.IOException
con
- - the Connection objecttablename
- - the table namexmlname
- - the file namexmldata
- - byte array with file datajava.sql.SQLException
java.io.IOException
public boolean replaceXMLData(java.sql.Connection con, java.lang.String tablename, java.lang.String xmlname, java.lang.String xmldata) throws java.lang.Exception
con
- - the Connection objecttablename
- - the table namexmlname
- - the file namexmldata
- - string with the file datajava.lang.Exception
public boolean xmlTableExists(java.sql.Connection con, java.lang.String tablename) throws java.lang.Exception
con
- - the Connection objecttablename
- - the table namejava.lang.Exception
public boolean dropXMLTable(java.sql.Connection con, java.lang.String tablename) throws java.lang.Exception
con
- - the Connection objecttablename
- - the table namejava.lang.Exception
public boolean dropBLOBTable(java.sql.Connection con, java.lang.String tablename) throws java.lang.Exception
con
- - the Connection objecttablename
- - the table namejava.lang.Exception
public boolean createXMLTable(java.sql.Connection con, java.lang.String tablename) throws java.lang.Exception
con
- - the Connection objecttablename
- - the table namejava.lang.Exception
public boolean createBLOBTable(java.sql.Connection con, java.lang.String tablename) throws java.lang.Exception
con
- - the Connection objecttablename
- - the table namejava.lang.Exception
public java.lang.String[] getXMLNames(java.sql.Connection con, java.lang.String tablename) throws java.lang.Exception
con
- - the Connection objecttablename
- - the table namejava.lang.Exception
public java.lang.String getXMLData(java.sql.Connection con, java.lang.String tablename, java.lang.String xmlname) throws java.sql.SQLException
con
- - the Connection objecttablename
- - the table namexmlname
- - the file namejava.sql.SQLException
public byte[] getBLOBData(java.sql.Connection con, java.lang.String tablename, java.lang.String xmlname) throws java.sql.SQLException
con
- - the Connection objecttablename
- - the table namexmlname
- - the file namejava.sql.SQLException
public boolean deleteBLOBName(java.sql.Connection con, java.lang.String tablename, java.lang.String xmlname) throws java.lang.Exception
con
- - the Connection objecttablename
- - the table namexmlname
- - the file namejava.lang.Exception
public boolean deleteXMLName(java.sql.Connection con, java.lang.String tablename, java.lang.String xmlname) throws java.lang.Exception
con
- - the Connection objecttablename
- - the table namexmlname
- - the file namejava.lang.Exception