Last Site Update: 18 January 2010

GWAP API

Class

   java.lang.Object
     extended byHumanComputation.GWAP.Database
   public abstract class Database
   extends java.lang.Object

This class represents the database interface between a GWAP server and a database server.

Constructor

  • Database

    public Database() Creates an empty database interface.

Method

protected
java.sql.Connection
getConnection ( )
Get connection to the database
absract
java.lang.String
getParameter (java.lang.String input)
Get the content of parameters
protected voidsetConnection (java.sql.Connection con)
Set the database connection
abstract voidwriteRecord (java.lang.String input)
Keep the records to the database

Method Detail

  • getConnection

    protected final java.sql.Connection getConnection()

    Gets connection to the database. (This method cannot be overridden.)

      Returns -
      the database connection of this database interface
      See also -
      Connection

     

  • getParameter

    public abstract java.lang.String getParameter(java.lang.String input)

    Gets the content of parameters. (This method must be overridden.)

      Parameters -
      input - a signal string which represents special information
      Returns -
      the XML formatted string which contains information of inputs

     

  • setConnection

    protected final void setConnection(java.sql.Connection con)

    Set the database connection. (This method cannot be overridden.)

      Parameters -
      con - the database connection
      See also -
      Connection

     

  • writeRecord

    public abstract void writeRecord(java.lang.String input)

    Keep the records to the database. (This method must be overridden.)

      Parameters -
      input - the XML formatted string which contains information