Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The JDBC Interface provides a virtual access to (virtual) FEWS tables. The JDBC server allows a client application to query the available tables. However not all SQL query statements are supported. Also the type of SQL statements allowed on a table varies per table. See the section on #SQL queries for more details.

Fews JDBC data model

Image Added

The following information is available through the JDBC Server:

...

No Format
SELECT * from TimeSeriesgraphs
WHERE filterId = 'ImportSHEF'
AND (parameterId = 'FMAT' OR parameterId = 'FMAT2')
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
No Format
SELECT * from TimeSeriesgraphs
WHERE filterId = 'ImportSHEF'
AND (parameterId = 'FMAT' OR parameterId = 'FMAT2' OR parameterId = 'FMAT3')
AND (locationId = 'DETO3IL' OR locationId = 'DETO3IL2' OR locationId = 'DETO3IL3') 
AND time BETWEEN '2008-12-19 12:00:00'  AND '2008-12-23 12:00:00'
AND height = 100 AND width = 150

...

Example of a graph query which will plot the data in GMT-1:

No Format
SELECT * 
FROM TimeSeriesgraphs
WHERE filterId = 'Ott_ruw' 
AND parameterId = 'H.diepte'
AND (locationId = '10.H.59'  OR locationId = '15.H.20')
AND time BETWEEN '2008-05-01 00:00:00'  AND '2008-05-01 10:00:00'
AND height = 500 AND width = 750 AND timezone='GMT-1';

...

No special jars other than the ones provided by the JRE are required.

Code Block

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");

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");
}

Miscellaneous

Using a different port number (available 200901)

...