org.mmbase.module.database.support
Class MMInformix42Node

java.lang.Object
  |
  +--org.mmbase.module.database.support.MMSQL92Node
        |
        +--org.mmbase.module.database.support.MMInformix42Node
All Implemented Interfaces:
MMJdbc2NodeInterface

public class MMInformix42Node
extends MMSQL92Node
implements MMJdbc2NodeInterface

MMInformix42Node extends MMSQL92Node and implements the MMJdbc2NodeInterface. This class overrides the methods which needed substitution to make mmbase work with informix (tested on Informix Dynamic Server 9.2)

Version:
09 Mar 2001
Author:
Daniel Ockeloen, Mark Huijser, Pierre van Rooden

Fields inherited from class org.mmbase.module.database.support.MMSQL92Node
name
 
Constructor Summary
MMInformix42Node()
           
 
Method Summary
 boolean addField(MMObjectBuilder bul, java.lang.String fieldname)
           
 boolean changeField(MMObjectBuilder bul, java.lang.String fieldname)
           
 boolean commit(MMObjectBuilder bul, MMObjectNode node)
          Method: commit commit this node to the database
 java.lang.String convertXMLType(FieldDefs def)
           
 boolean create(MMObjectBuilder bul)
          Used to create a new database object.
 boolean createObjectTable(java.lang.String baseName)
           
 MMObjectNode decodeDBnodeField(MMObjectNode node, java.lang.String fieldname, java.sql.ResultSet rs, int i, java.lang.String prefix)
           
 boolean drop_real(MMObjectBuilder bul, java.lang.String tableName)
          will be removed once the xml setup system is done
 java.util.Vector getAllNames()
           
 byte[] getDBByte(java.sql.ResultSet rs, int idx)
          get byte of a database blob
 int getDBKey()
          getDBKey() uses a user defined routine (fetchrelkey()) at the database side to get a number (10) of keys at once.
 java.lang.String getDBText(java.sql.ResultSet rs, int idx)
          get text of a database blob
 byte[] getShortedByte(java.lang.String tableName, java.lang.String fieldname, int number)
          Method: getShortedByte get byte of a database blob
 java.lang.String getShortedText(java.lang.String tableName, java.lang.String fieldname, int number)
          Method: getShortedText get text from blob
 int insert(MMObjectBuilder bul, java.lang.String owner, MMObjectNode node)
          This method inserts a new object, normally not used (only subtables are used) Only fields with DBState value = DBSTATE_PERSISTENT or DBSTATE_SYSTEM are inserted.
 java.lang.String parseFieldPart(java.lang.String fieldname, java.lang.String dbtype, java.lang.String part)
           
 boolean removeField(MMObjectBuilder bul, java.lang.String fieldname)
           
 void removeNode(MMObjectBuilder bul, MMObjectNode node)
          Method: removeNode
 void setDBByte(int i, java.sql.PreparedStatement stmt, byte[] bytes)
          Method: setDBByte set byte array in database
 void setDBText(int i, java.sql.PreparedStatement stmt, java.lang.String body)
          Method: setDBText set text array in database
 
Methods inherited from class org.mmbase.module.database.support.MMSQL92Node
create_real, created, decodeDBnodeField, drop, getAllowedField, getConnection, getDBKeyOld, getDisallowedField, getMatchCREATE, getMMNodeSearch2SQL, getNumberString, getOTypeString, getOwnerString, getReverseHash, init, insert_real, parseFieldPart, size, tableSizeProtection, updateTable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mmbase.module.database.support.MMJdbc2NodeInterface
created, decodeDBnodeField, drop, getAllowedField, getConnection, getDisallowedField, getMMNodeSearch2SQL, getNumberString, getOTypeString, getOwnerString, init, updateTable
 

Constructor Detail

MMInformix42Node

public MMInformix42Node()
Method Detail

createObjectTable

public boolean createObjectTable(java.lang.String baseName)
Specified by:
createObjectTable in interface MMJdbc2NodeInterface
Overrides:
createObjectTable in class MMSQL92Node

create

public boolean create(MMObjectBuilder bul)
Used to create a new database object. Will be removed once the xml setup system is done. (?)
Specified by:
create in interface MMJdbc2NodeInterface
Overrides:
create in class MMSQL92Node
Parameters:
bul - Builder which will be used to create the object-table

convertXMLType

public java.lang.String convertXMLType(FieldDefs def)
Overrides:
convertXMLType in class MMSQL92Node

insert

public int insert(MMObjectBuilder bul,
                  java.lang.String owner,
                  MMObjectNode node)
This method inserts a new object, normally not used (only subtables are used) Only fields with DBState value = DBSTATE_PERSISTENT or DBSTATE_SYSTEM are inserted. Fields with DBstate values = DBSTATE_VIRTUAL or any other value are skipped.
Specified by:
insert in interface MMJdbc2NodeInterface
Overrides:
insert in class MMSQL92Node
Parameters:
bul - The MMObjectBuilder.
owner - The nodes' owner.
node - The current node that's to be inserted.
Returns:
The DBKey number for this node, or -1 if an error occurs.

decodeDBnodeField

public MMObjectNode decodeDBnodeField(MMObjectNode node,
                                      java.lang.String fieldname,
                                      java.sql.ResultSet rs,
                                      int i,
                                      java.lang.String prefix)
Specified by:
decodeDBnodeField in interface MMJdbc2NodeInterface
Overrides:
decodeDBnodeField in class MMSQL92Node

getDBText

public java.lang.String getDBText(java.sql.ResultSet rs,
                                  int idx)
Description copied from class: MMSQL92Node
get text of a database blob
Specified by:
getDBText in interface MMJdbc2NodeInterface
Overrides:
getDBText in class MMSQL92Node

getDBByte

public byte[] getDBByte(java.sql.ResultSet rs,
                        int idx)
Description copied from class: MMSQL92Node
get byte of a database blob
Specified by:
getDBByte in interface MMJdbc2NodeInterface
Overrides:
getDBByte in class MMSQL92Node

parseFieldPart

public java.lang.String parseFieldPart(java.lang.String fieldname,
                                       java.lang.String dbtype,
                                       java.lang.String part)

getShortedByte

public byte[] getShortedByte(java.lang.String tableName,
                             java.lang.String fieldname,
                             int number)
Method: getShortedByte get byte of a database blob
Specified by:
getShortedByte in interface MMJdbc2NodeInterface
Overrides:
getShortedByte in class MMSQL92Node

getShortedText

public java.lang.String getShortedText(java.lang.String tableName,
                                       java.lang.String fieldname,
                                       int number)
Method: getShortedText get text from blob
Specified by:
getShortedText in interface MMJdbc2NodeInterface
Overrides:
getShortedText in class MMSQL92Node

setDBText

public void setDBText(int i,
                      java.sql.PreparedStatement stmt,
                      java.lang.String body)
Method: setDBText set text array in database
Overrides:
setDBText in class MMSQL92Node

setDBByte

public void setDBByte(int i,
                      java.sql.PreparedStatement stmt,
                      byte[] bytes)
Method: setDBByte set byte array in database
Specified by:
setDBByte in interface MMJdbc2NodeInterface
Overrides:
setDBByte in class MMSQL92Node

commit

public boolean commit(MMObjectBuilder bul,
                      MMObjectNode node)
Method: commit commit this node to the database
Specified by:
commit in interface MMJdbc2NodeInterface
Overrides:
commit in class MMSQL92Node

removeNode

public void removeNode(MMObjectBuilder bul,
                       MMObjectNode node)
Method: removeNode
Specified by:
removeNode in interface MMJdbc2NodeInterface
Overrides:
removeNode in class MMSQL92Node

getDBKey

public int getDBKey()
getDBKey() uses a user defined routine (fetchrelkey()) at the database side to get a number (10) of keys at once. The fetched keys will be returned to the requester until all numbers are used, then getDBKey will fetch a bunch of new keys ... See http://www.mmbase.org/ for an sql-script that creates the User Defined Routine you need.
Specified by:
getDBKey in interface MMJdbc2NodeInterface
Overrides:
getDBKey in class MMSQL92Node
Following copied from class: org.mmbase.module.database.support.MMSQL92Node
Returns:
unique number

getAllNames

public java.util.Vector getAllNames()

addField

public boolean addField(MMObjectBuilder bul,
                        java.lang.String fieldname)
Specified by:
addField in interface MMJdbc2NodeInterface
Overrides:
addField in class MMSQL92Node

removeField

public boolean removeField(MMObjectBuilder bul,
                           java.lang.String fieldname)
Specified by:
removeField in interface MMJdbc2NodeInterface
Overrides:
removeField in class MMSQL92Node

changeField

public boolean changeField(MMObjectBuilder bul,
                           java.lang.String fieldname)
Specified by:
changeField in interface MMJdbc2NodeInterface
Overrides:
changeField in class MMSQL92Node

drop_real

public boolean drop_real(MMObjectBuilder bul,
                         java.lang.String tableName)
Description copied from class: MMSQL92Node
will be removed once the xml setup system is done
Overrides:
drop_real in class MMSQL92Node


MMBase 2001