org.mmbase.module.database.support
Class MMOracle

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

public class MMOracle
extends MMSQL92Node
implements MMJdbc2NodeInterface

MMSQL92Node implements the MMJdbc2NodeInterface for sql92 types of database this is the class used to abstact the query's needed for mmbase for each database.

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

Field Summary
 java.lang.String name
           
 
Constructor Summary
MMOracle()
           
 
Method Summary
 boolean commit(MMObjectBuilder bul, MMObjectNode node)
          commit this node to the database
 java.lang.String convertXMLType(FieldDefs def)
           
 boolean create_real(MMObjectBuilder bul, java.lang.String tableName)
          will be removed once the xml setup system is done
 boolean create(MMObjectBuilder bul)
           
 boolean created(java.lang.String tableName)
          tells if a table already exists
 boolean createObjectTable(java.lang.String baseName)
           
 MMObjectNode decodeDBnodeField(MMObjectNode node, java.lang.String fieldname, java.sql.ResultSet rs, int i)
           
 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
 boolean drop(MMObjectBuilder bul)
           
 java.lang.String getAllowedField(java.lang.String disallowedfield)
           
 MultiConnection getConnection(JDBCInterface jdbc)
           
 byte[] getDBByte(java.sql.ResultSet rs, int idx)
          get byte of a database blob
 int getDBKey()
          gives an unique number this method will work with multiple mmbases
 int getDBKeyOld()
           
 java.lang.String getDBText(java.sql.ResultSet rs, int idx)
          get text of a database blob
 java.lang.String getDisallowedField(java.lang.String allowedfield)
           
 java.lang.String getMatchCREATE(java.lang.String tableName)
          gets the sytax of the create statement for current database.
 java.lang.String getMMNodeSearch2SQL(java.lang.String where, MMObjectBuilder bul)
           
 java.lang.String getNumberString()
           
 java.lang.String getOTypeString()
           
 java.lang.String getOwnerString()
           
 java.util.Hashtable getReverseHash(java.util.Hashtable in)
           
 byte[] getShortedByte(java.lang.String tableName, java.lang.String fieldname, int number)
          get byte of a database blob
 java.lang.String getShortedText(java.lang.String tableName, java.lang.String fieldname, int number)
          get text from blob
 void init(MMBase mmb, XMLDatabaseReader parser)
           
 int insert_real(MMObjectBuilder bul, java.lang.String owner, MMObjectNode node, java.lang.String tableName)
           
 int insert(MMObjectBuilder bul, java.lang.String owner, MMObjectNode node)
          Insert: 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, int dbtype, java.lang.String part)
           
 void removeNode(MMObjectBuilder bul, MMObjectNode node)
          removeNode
 void setDBByte(int i, java.sql.PreparedStatement stmt, byte[] bytes)
          set byte array in database
 void setDBText(int i, java.sql.PreparedStatement stmt, java.lang.String body)
          set text array in database
 int size(java.lang.String tableName)
          return number of entries consisting in given table
 boolean updateTable(MMObjectBuilder bul)
           
 
Methods inherited from class org.mmbase.module.database.support.MMSQL92Node
addField, changeField, removeField, tableSizeProtection
 
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
addField, changeField, removeField
 

Field Detail

name

public java.lang.String name
Constructor Detail

MMOracle

public MMOracle()
Method Detail

init

public void init(MMBase mmb,
                 XMLDatabaseReader parser)
Specified by:
init in interface MMJdbc2NodeInterface
Overrides:
init in class MMSQL92Node

decodeDBnodeField

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

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

getMMNodeSearch2SQL

public java.lang.String getMMNodeSearch2SQL(java.lang.String where,
                                            MMObjectBuilder bul)
Specified by:
getMMNodeSearch2SQL in interface MMJdbc2NodeInterface
Overrides:
getMMNodeSearch2SQL in class MMSQL92Node

parseFieldPart

public java.lang.String parseFieldPart(java.lang.String fieldname,
                                       int dbtype,
                                       java.lang.String part)
Overrides:
parseFieldPart in class MMSQL92Node

getShortedText

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

getShortedByte

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

getDBByte

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

getDBText

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

insert

public int insert(MMObjectBuilder bul,
                  java.lang.String owner,
                  MMObjectNode node)
Insert: 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.

insert_real

public int insert_real(MMObjectBuilder bul,
                       java.lang.String owner,
                       MMObjectNode node,
                       java.lang.String tableName)
Overrides:
insert_real in class MMSQL92Node

setDBText

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

setDBByte

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

commit

public boolean commit(MMObjectBuilder bul,
                      MMObjectNode node)
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)
removeNode
Specified by:
removeNode in interface MMJdbc2NodeInterface
Overrides:
removeNode in class MMSQL92Node

getDBKey

public int getDBKey()
gives an unique number this method will work with multiple mmbases
Specified by:
getDBKey in interface MMJdbc2NodeInterface
Overrides:
getDBKey in class MMSQL92Node
Returns:
unique number

getDBKeyOld

public int getDBKeyOld()
Overrides:
getDBKeyOld in class MMSQL92Node

created

public boolean created(java.lang.String tableName)
tells if a table already exists
Specified by:
created in interface MMJdbc2NodeInterface
Overrides:
created in class MMSQL92Node
Returns:
true if table exists

size

public int size(java.lang.String tableName)
return number of entries consisting in given table
Overrides:
size in class MMSQL92Node
Parameters:
tableName - the table that has to be counted

create

public boolean create(MMObjectBuilder bul)
Specified by:
create in interface MMJdbc2NodeInterface
Overrides:
create in class MMSQL92Node

create_real

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

drop

public boolean drop(MMObjectBuilder bul)
Specified by:
drop in interface MMJdbc2NodeInterface
Overrides:
drop in class MMSQL92Node

drop_real

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

updateTable

public boolean updateTable(MMObjectBuilder bul)
Specified by:
updateTable in interface MMJdbc2NodeInterface
Overrides:
updateTable in class MMSQL92Node

createObjectTable

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

convertXMLType

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

getMatchCREATE

public java.lang.String getMatchCREATE(java.lang.String tableName)
gets the sytax of the create statement for current database.
Overrides:
getMatchCREATE in class MMSQL92Node

getReverseHash

public java.util.Hashtable getReverseHash(java.util.Hashtable in)
Overrides:
getReverseHash in class MMSQL92Node

getDisallowedField

public java.lang.String getDisallowedField(java.lang.String allowedfield)
Specified by:
getDisallowedField in interface MMJdbc2NodeInterface
Overrides:
getDisallowedField in class MMSQL92Node

getAllowedField

public java.lang.String getAllowedField(java.lang.String disallowedfield)
Specified by:
getAllowedField in interface MMJdbc2NodeInterface
Overrides:
getAllowedField in class MMSQL92Node

getConnection

public MultiConnection getConnection(JDBCInterface jdbc)
                              throws java.sql.SQLException
Specified by:
getConnection in interface MMJdbc2NodeInterface
Overrides:
getConnection in class MMSQL92Node

getNumberString

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

getOTypeString

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

getOwnerString

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


MMBase 2001