com.xmlserv.app.shared
Class DBList
java.lang.Object
|
+--com.xmlserv.app.shared.DBList
- public class DBList
- extends java.lang.Object
Read a list of values from a given table, preparing data for a <select> tag.
Constructor Summary |
DBList()
|
DBList(java.sql.Connection con,
java.lang.String tablename,
java.lang.String idcol,
java.lang.String displaycol)
|
Method Summary |
java.lang.String |
getId(int pos)
|
java.lang.String |
getValue(int pos)
|
static void |
main(java.lang.String[] args)
|
int |
size()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DBList
public DBList()
DBList
public DBList(java.sql.Connection con,
java.lang.String tablename,
java.lang.String idcol,
java.lang.String displaycol)
throws java.sql.SQLException
- Parameters:
con
- Connection object.tablename
- The table to read.idcol
- The column containing the (unique) key to be used as the value later on.displaycol
- The column containing the value to show to the user.
size
public int size()
getId
public java.lang.String getId(int pos)
getValue
public java.lang.String getValue(int pos)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
main
public static void main(java.lang.String[] args)