javazoom.upload
Class DefaultDBStore

java.lang.Object
  |
  +--javazoom.upload.DBStore
        |
        +--javazoom.upload.DefaultDBStore

public class DefaultDBStore
extends DBStore

This class implements a generic DBStore.


Constructor Summary
DefaultDBStore()
           
 
Method Summary
 void connect(java.lang.Object p1, java.lang.Object p2, java.lang.Object p3)
          Connects to database store.
 int countFiles()
          Counts database entries.
 java.sql.Connection getConnection()
          Returns JDBC Connection.
 int getLastId()
          Return last id used for UPLOADID column.
 void reset()
          Deletes entries in database store.
 void store(UploadFile file, boolean overwrite)
          Depending on overwrite state, inserts or updates file in store.
 
Methods inherited from class javazoom.upload.DBStore
setConnection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDBStore

public DefaultDBStore()
Method Detail

getConnection

public java.sql.Connection getConnection()
Description copied from class: DBStore
Returns JDBC Connection.

Overrides:
getConnection in class DBStore
Returns:
JDBC connection.

getLastId

public int getLastId()
Return last id used for UPLOADID column.

Returns:
last id

connect

public void connect(java.lang.Object p1,
                    java.lang.Object p2,
                    java.lang.Object p3)
             throws java.lang.Exception
Connects to database store.

Specified by:
connect in class DBStore
Parameters:
p1 - Driver string or Jdbc connection
p2 - URL String
p3 - Credentials properties
Throws:
java.lang.Exception

countFiles

public int countFiles()
               throws java.lang.Exception
Counts database entries.

Specified by:
countFiles in class DBStore
Returns:
number of entries in database store
Throws:
java.lang.Exception

store

public void store(UploadFile file,
                  boolean overwrite)
           throws java.lang.Exception
Depending on overwrite state, inserts or updates file in store.

Specified by:
store in class DBStore
Parameters:
file - input file
overwrite - enables/disables overwrite
Throws:
java.lang.Exception

reset

public void reset()
           throws java.lang.Exception
Deletes entries in database store.

Specified by:
reset in class DBStore
Throws:
java.lang.Exception