Board index » jbuilder » displaying query in a servlet
Paul Iddon
![]() JBuilder Developer |
displaying query in a servlet2005-02-14 12:40:18 AM jbuilder2 Hi Im having trouble with a servlet displaying the contents of a query. Im just testing the code out, its not a proper application, I just want to see what I can do. Anyway I have a database connected, and I have created a query which dispays one of the records, the servlet will then display that record on a page using the PrintWriter method. and using this code String test = coordxquery.getstring("roomcoordX"); and then printing by using out.printin(test) Problem is everytime I try and create this I get a tomcat error. See com.borland.dx.dataset.DataSetException error code: BASE+10 com.borland.dx.dataset.DataSetException: Unknown column name: roomcoordX at com.borland.dx.dataset.DataSetException.c(Unknown Source) I realise its the column name Im having probkems with, but I thought I had created the code to query this: database1.setConnection(new ConnectionDescriptor("jdbc:odbc:database", "", "", true, "sun.jdbc.odbc.JdbcOdbcDriver")); coordxquery.setSchemaName(""); coordxquery.setSort(new com.borland.dx.dataset.SortDescriptor("", new String[] {"roomcoordX"}, new boolean[] {true, }, null, 0)); coordxquery.setAccumulateResults(true); coordxquery.setQuery(new com.borland.dx.sql.dataset.QueryDescriptor( database1, "SELECT roomcoordX FROM tblroom GROUP BY tblroom.roomcoordX", null, true, Load.ALL)); Ok I know its probably something simple, and im proving that Im a right newb, but can anybody help with this? Thank you Paul |