/** * Instantiate and populate a node object from the next item in the result set of a node query. * * @param query string * @return Node */ protected Node nodeFromQueryRS(String query) throws DatabaseException { Node node = null; if (dbr.psRSNext(query)) { // String columns = org.apache.commons.lang.StringUtils.join(dbr.psRSColumnNames(query), ", // "); // System.out.println("columns: [" + columns + "]"); node = new Node(); Long id = dbr.psRSGetBigInt(query, "ID"); String name = dbr.psRSGetVarChar(query, "NAME"); String type = dbr.psRSGetVarChar(query, "TYPE"); Double longitude = dbr.psRSGetDouble(query, "X"); Double latitude = dbr.psRSGetDouble(query, "Y"); node.setId(id); node.setName(name); node.setType(type); node.setLongitude(longitude); node.setLatitude(latitude); } return node; }