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 dynamic server.

Tested on:

Version:
$Id: MMInformix42Node.java,v 1.41.2.5 2003/04/24 13:04:08 mark Exp $
Author:
Daniel Ockeloen, Mark Huijser, Pierre van Rooden

Fields inherited from class org.mmbase.module.database.support.MMSQL92Node
allowed2disallowed, disallowed2allowed, mmb, name, parser, typeMapping
 
Constructor Summary
MMInformix42Node()
          Class Constructor
 
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)
          Converts XML-field-definition to a string ???
 boolean create(MMObjectBuilder bul)
          Creates the database-table for the specified builder
 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.
 int getDBKeyOld()
          Overriding getDBKeyOld because the one in MMSQL92Node doesn't really work
 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.
 boolean isAllowedParentBuilder(MMObjectBuilder builder)
          Returns whether this database support layer allows for builder to be a parent builder (that is, other builders can 'extend' this builder and its database tables).
 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)
          Add a byte-array to the PreparedStatement
 void setDBClob(int i, java.sql.PreparedStatement stmt, java.lang.String body)
          Creates a smart large object in the database using the MMBase character encoding, and sets the field using PreparedStatement.setClob.
 void setDBText(int i, java.sql.PreparedStatement stmt, java.lang.String body)
          Inserts the given string into the passed PreparedStatement using the MMBase characterencoding.
 
Methods inherited from class org.mmbase.module.database.support.MMSQL92Node
create_real, created, decodeDBnodeField, decodeStringField, drop, getAllowedField, getConnection, getDisallowedField, getMatchCREATE, getMMNodeSearch2SQL, getNumberString, getOTypeString, getOwnerString, getReverseHash, init, insert_real, matchType, parseFieldPart, registerParentBuilder, 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, registerParentBuilder, updateTable
 

Constructor Detail

MMInformix42Node

public MMInformix42Node()
Class Constructor
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)

Creates the database-table for the specified builder

Specified by:
create in interface MMJdbc2NodeInterface
Overrides:
create in class MMSQL92Node
Parameters:
bul - Builder which will be used to create the object-table
Returns:
true if the creation succeeded

convertXMLType

public java.lang.String convertXMLType(FieldDefs def)
Converts XML-field-definition to a string ???
Overrides:
convertXMLType in class MMSQL92Node
Parameters:
def - FieldDef
Returns:
converted fieldDef

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

isAllowedParentBuilder

public boolean isAllowedParentBuilder(MMObjectBuilder builder)
Returns whether this database support layer allows for builder to be a parent builder (that is, other builders can 'extend' this builder and its database tables).
Specified by:
isAllowedParentBuilder in interface MMJdbc2NodeInterface
Overrides:
isAllowedParentBuilder in class MMSQL92Node
Parameters:
builder - the builder to test
Returns:
true if the builder can be extended
Since:
MMBase-1.6

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)
Inserts the given string into the passed PreparedStatement using the MMBase characterencoding.
Overrides:
setDBText in class MMSQL92Node
Parameters:
i - parameterIndex - the first parameter is 1, the second is 2, ...
stmt - PreparedStatement - holds a precompiled SQL statement
body - String that needs to be added to the statement

setDBClob

public void setDBClob(int i,
                      java.sql.PreparedStatement stmt,
                      java.lang.String body)
Creates a smart large object in the database using the MMBase character encoding, and sets the field using PreparedStatement.setClob.
Parameters:
i - parameterIndex the first parameter is 1, the second one is 2, ...
stmt - object that represents a precompiled SQL Statement
body - value that needs to be inserted/updated

setDBByte

public void setDBByte(int i,
                      java.sql.PreparedStatement stmt,
                      byte[] bytes)
Add a byte-array to the PreparedStatement
Specified by:
setDBByte in interface MMJdbc2NodeInterface
Overrides:
setDBByte in class MMSQL92Node
Parameters:
i - parameterIndex the first parameter is 1, the second one is 2, ...
stmt - object that represents a precompiled SQL Statement
bytes - bytearray that needs to be inserted/updated

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

getDBKeyOld

public int getDBKeyOld()
Overriding getDBKeyOld because the one in MMSQL92Node doesn't really work
Overrides:
getDBKeyOld 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 new bunch of 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 interface: org.mmbase.module.database.support.MMJdbc2NodeInterface
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 build 1.6.5.20030923