I find it easiest to use village methods in a case like this.
eg

public Vector doQuery() {
  String sql = "Select mycol from mytable";
  Vector results = new Vector();
  Vector records = new Vector();
  try {
    records = mytablePeer.executeQuery(sql);
  }
  catch(Exception e) {}

  for (int i=0;i < records .size(); i++) {
    Record rec = (Record)records.elementAt(i);
    results.add(rec.getValue(1).as...();
  }

  return results;
}

Look at Village for more details on the API to use.
http://www.working-dogs.com/index.php?SCREEN=village

Hope this helps a little.

Jon

-----Original Message-----
From: Marco Knuettel [mailto:[EMAIL PROTECTED]]
Sent: 07 September 2001 10:42
To: [EMAIL PROTECTED]
Subject: Getting out only 1 Column from the Database


Hi,
I want to query the database for only one column, but if i use the
criteria-object with addSelectColumn() I get an Exception :-((

com.workingdogs.village.DataSetException: Only 1 columns exist!
at com.workingdogs.village.Record.getValue(Record.java:546)
at
Im.dnstool.db.BaseRootserverPeer.populateObject(BaseRootserverPeer.java:173)

at
Im.dnstool.db.BaseRootserverPeer.row2Object(BaseRootserverPeer.java:154)

at
Im.dnstool.db.BaseRootserverPeer.populateObjects(BaseRootserverPeer.java:249
)

at
Im.dnstool.db.BaseRootserverPeer.doSelect(BaseRootserverPeer.java:183)

Whats wrong??

I use the tdk 2.1!

thx
Marco


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--------------------------------------------------
DISCLAIMER: This message contains proprietary
information some or all of which may be
confidential and/or legally privileged. It is for
the intended recipient only who may use and apply
the information only for the intended purpose.
Internet communications are not secure and
therefore the British Biotech group does not
accept legal responsibility for the contents of
this message. Any views or opinions presented are
only those of the author and not those of the
British Biotech group. If you are not the intended
recipient please delete this e-mail and notify the
author immediately by calling ++44 (0)1865 748747;
do not use, disclose, distribute, copy, print or
rely on this e-mail.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to