now using java code to perform queries; javascript simply displays result