org.mmbase.module.database.support
Class PostgreSQL

java.lang.Object
  extended byorg.mmbase.module.database.support.BaseJdbc2Node
      extended byorg.mmbase.module.database.support.Sql92SingleFields
          extended byorg.mmbase.module.database.support.PostgreSQL
All Implemented Interfaces:
MMJdbc2NodeInterface, SearchQueryHandler
Direct Known Subclasses:
PostgreSQL71, PostgreSQL72

Deprecated. This code is scheduled for removal once MMBase has been fully converted to the new StorageManager implementation.

public class PostgreSQL
extends Sql92SingleFields
implements MMJdbc2NodeInterface

7.2 is the first release of the JDBC Driver that supports the byte data type. The introduction of this functionality in 7.2 has introduced a change in behavior as compared to previous releases. In 7.2 the methods getBytes(), setBytes(), getBinaryStream(), and setBinaryStream() operate on the bytea data type. In 7.1 these methods operated on the OID data type associated with Large Objects. It is possible to revert the driver back to the old 7.1 behavior by setting the compatible property on the Connection to a value of 7.1
To use the bytea data type you should simply use the getBytes(), setBytes(), getBinaryStream(), or setBinaryStream() methods.
To use the Large Object functionality you can use either the LargeObject API provided by the PostgreSQL JDBC Driver, or by using the getBLOB() and setBLOB() methods.
Important: For PostgreSQL, you must access Large Objects within an SQL transaction. You would open a transaction by using the setAutoCommit() method with an input parameter of false.
Note: In a future release of the JDBC Driver, the getBLOB() and setBLOB() methods may no longer interact with Large Objects and will instead work on bytea data types. So it is recommended that you use the LargeObject API if you intend to use Large Objects.
More info for differences between Postgresql versions: http://www.postgresql.org/idocs/index.php?jdbc-binary-data.html Postgresql driver for MMBase

Since:
MMBase-1.7
Version:
$Id: PostgreSQL.java,v 1.5.2.1 2004/06/15 21:38:35 robmaris Exp $
Author:
Eduard Witteveen

Field Summary
 
Fields inherited from class org.mmbase.module.database.support.Sql92SingleFields
allowed2disallowed, disallowed2allowed, mmb
 
Fields inherited from interface org.mmbase.storage.search.SearchQueryHandler
FEATURE_MAX_NUMBER, FEATURE_OFFSET, SUPPORT_NONE, SUPPORT_NORMAL, SUPPORT_OPTIMAL, SUPPORT_WEAK
 
Constructor Summary
PostgreSQL()
          Deprecated.  
 
Method Summary
 boolean addField(MMObjectBuilder bul, java.lang.String fieldname)
          Deprecated.  
 boolean changeField(MMObjectBuilder bul, java.lang.String fieldname)
          Deprecated.  
 boolean commit(MMObjectBuilder bul, MMObjectNode node)
          Deprecated. commit this node to the database Has been overridden, since postgresql needs a transaction for storing binaries TODO: verify that this is also needed for 72!
 boolean create(MMObjectBuilder bul)
          Deprecated.  
protected  boolean createNumberCheck()
          Deprecated.  
 boolean createObjectTable(java.lang.String notUsed)
          Deprecated. is next function nessecary?
protected  boolean createSequence()
          Deprecated.  
protected  java.lang.String getDbFieldDef(FieldDefs def, MMObjectBuilder bul)
          Deprecated.  
 int getDBKey()
          Deprecated. Retrieves a new unique number, which can be used to inside objectTableName() table
protected  int insertRecord(MMObjectBuilder bul, java.lang.String owner, MMObjectNode node)
          Deprecated.  
 boolean removeField(MMObjectBuilder bul, java.lang.String fieldname)
          Deprecated.  
 
Methods inherited from class org.mmbase.module.database.support.Sql92SingleFields
changeMetaData, created, decodeDBnodeField, decodeDBnodeField, drop, getAllowedField, getConnection, getDBByte, getDbFieldType, getDBText, getDisallowedField, getInheritBuilder, getInheritTableName, getMMNodeSearch2SQL, getNumberString, getOTypeString, getOwnerString, getShortedByte, getShortedText, init, insert, isAllowedParentBuilder, isBuilderField, isInheritedField, isReferenceField, numberCheckNameName, objectTableName, registerParentBuilder, removeNode, sequenceTableName, setDBByte, setValuePreparedStatement, updateTable
 
Methods inherited from class org.mmbase.module.database.support.BaseJdbc2Node
getNodes, getSupportLevel, getSupportLevel, init
 
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, decodeDBnodeField, drop, getAllowedField, getConnection, getDBByte, getDBText, getDisallowedField, getMMNodeSearch2SQL, getNumberString, getOTypeString, getOwnerString, getShortedByte, getShortedText, init, insert, isAllowedParentBuilder, registerParentBuilder, removeNode, setDBByte, updateTable
 
Methods inherited from interface org.mmbase.storage.search.SearchQueryHandler
getNodes, getSupportLevel, getSupportLevel
 

Constructor Detail

PostgreSQL

public PostgreSQL()
Deprecated. 
Method Detail

createSequence

protected boolean createSequence()
Deprecated. 
Specified by:
createSequence in class Sql92SingleFields

createNumberCheck

protected boolean createNumberCheck()
Deprecated. 

create

public boolean create(MMObjectBuilder bul)
Deprecated. 
Specified by:
create in interface MMJdbc2NodeInterface
Specified by:
create in class Sql92SingleFields

getDbFieldDef

protected java.lang.String getDbFieldDef(FieldDefs def,
                                         MMObjectBuilder bul)
Deprecated. 
Specified by:
getDbFieldDef in class Sql92SingleFields

insertRecord

protected int insertRecord(MMObjectBuilder bul,
                           java.lang.String owner,
                           MMObjectNode node)
Deprecated. 
Specified by:
insertRecord in class Sql92SingleFields

commit

public boolean commit(MMObjectBuilder bul,
                      MMObjectNode node)
Deprecated. 
commit this node to the database Has been overridden, since postgresql needs a transaction for storing binaries TODO: verify that this is also needed for 72!

Specified by:
commit in interface MMJdbc2NodeInterface
Specified by:
commit in class Sql92SingleFields

addField

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

removeField

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

changeField

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

getDBKey

public int getDBKey()
Deprecated. 
Retrieves a new unique number, which can be used to inside objectTableName() table

Specified by:
getDBKey in interface MMJdbc2NodeInterface
Specified by:
getDBKey in class Sql92SingleFields
Returns:
a new unique number for new nodes or -1 on failure

createObjectTable

public boolean createObjectTable(java.lang.String notUsed)
Deprecated. 
Description copied from class: Sql92SingleFields
is next function nessecary?

Specified by:
createObjectTable in interface MMJdbc2NodeInterface
Overrides:
createObjectTable in class Sql92SingleFields


MMBase build 1.7.1.20041002