...
No Format |
---|
SELECT * from TimeSeriesgraphs WHERE filterId = 'ImportSHEF' AND parameterId = 'FMAT' AND locationId = 'DETO3IL' AND time BETWEEN '2008-12-19 12:00:00' AND '2008-12-23 12:00:00' AND height = 100 AND width = 150 |
Example code
Here follows some example code of how client applications can set up a connection to a JDBC server hosted by a FEWS OC.
Setting up a connection in JAVA
Before starting the client will require the following library: vjdbc-1.6.5.jar. This library can be found in the bin directory of the FEWS system.
Code Block |
---|
Class.forName("de.simplicit.vjdbc.VirtualDriver").newInstance();
Connection con = DriverManager.getConnection("jdbc:vjdbc:rmi://localhost:2000/VJdbc,FewsDataStore");
//example get Locations
Statement stmt = con.createStatement();
ResultSet set = stmt.executeQuery("SELECT * from Locations");
int size = 0;
while (set.next()) {
System.out.print("Name:" + set.getString("name"));
System.out.print(", Id:" + set.getString("Id"));
System.out.print(", X:" + set.getString("x"));
System.out.print(", y:" + set.getString("y") + "\n");
size++;
}
System.out.println("Result set size: " + size);
|
Miscellaneous
Using a different port number (available 200901)
...