Versions Compared

Key

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

...

  • Give it the Alias "<OC-Name> JDBC"
  • Select the vjdbc driver
  • Enter the database URL: "jdbc:vjdbc:rmi://<host>:2000/VJdbc,FewsDataStoreFewsDatabase" (under <host>, enter the machine where the fews jdbc application runs. You can get the IP adress by typing ipconfig in the command line of the Server). The number "2000" is the default port number, the correct port number is shown in the FEWS log file on the Server when it is started.

...

  • Make sure you add the vjdbc.jar and commons-logging-1.1.jar file to the classpath
  • The url is: jdbc:vjdbc:rmi://<host>:2000/VJdbc,FewsDataStore FewsDatabase (under <host>, enter the machine's IP or server name where the FEWS JDBC application runs)

...

Code Block
Connection con = DriverManager.getConnection("jdbc:vjdbc:rmi://localhost:2000/VJdbc,FewsDataStoreFewsDatabase");

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

...