Holger's
Java API

com.antelmann.cddb
Class SQLCDDB

java.lang.Object
  extended by com.antelmann.cddb.SQLCDDB
All Implemented Interfaces:
CDDB

public class SQLCDDB
extends Object
implements CDDB

A very simple CDDB implementation that uses a SQL database for CDs and tracks. The following tables with their columns are preassumed for the given connection:

 table CD      table track   table CDID
 --------      -----------   -----------
 discID        discID        discID
 title         trackNo       QueryString
 artist        title
 year          artist
 length        length
 extension     extension
 
All columns are text columns except year (which is a number representing the year), length (which is a number representing seconds) and trackNo (another number). The fields should also exist in the order given above.

Author:
Holger Antelmann

Constructor Summary
SQLCDDB(Connection con)
           
 
Method Summary
 String[] getCategories()
          returns the available categories under which the CDInfo entries are stored - in accordance to the CDDB standard
 CDDBRecord[] queryCD(CDID cd)
          fuzzy matches are currently not supported
 CDInfo readCDInfo(CDDBRecord record)
          not supported, yet
 void writeCDInfo(CDInfo cdinfo)
          allows to submit CD information to the database - if the operation is permitted by the database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLCDDB

public SQLCDDB(Connection con)
Method Detail

getCategories

public String[] getCategories()
Description copied from interface: CDDB
returns the available categories under which the CDInfo entries are stored - in accordance to the CDDB standard

Specified by:
getCategories in interface CDDB

queryCD

public CDDBRecord[] queryCD(CDID cd)
                     throws IOException
fuzzy matches are currently not supported

Specified by:
queryCD in interface CDDB
Throws:
IOException
See Also:
CDDBRecord.isExactMatch()

readCDInfo

public CDInfo readCDInfo(CDDBRecord record)
not supported, yet

Specified by:
readCDInfo in interface CDDB
See Also:
CDDB.queryCD(CDID)

writeCDInfo

public void writeCDInfo(CDInfo cdinfo)
                 throws IOException,
                        CDDBProtocolException
Description copied from interface: CDDB
allows to submit CD information to the database - if the operation is permitted by the database. In the case that the operation is not allowed by the server, a CDDBProtocolException may be thrown.

Specified by:
writeCDInfo in interface CDDB
Throws:
IOException
CDDBProtocolException


(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads