December 17, 200619 yr Hi, Does anyone have a WORKING JDBC example (Java code) that connects with Filemaker?? I've been trying for a week ( ) now with the examples Filemaker Server 8.5 has on the disc... Can't get it to work... Please help...
December 20, 200619 yr How about this? 1. Create a database (Untitled.fp7). 2. Create a field. 3. Go to browse mode and create a few records with proper value. 4. Publish the file using ODBC/JDBC protocol. 5. Create a java source (JdbcTest.java). 6. Compile (javac JdbcTest.java). 7. Execute (java -cp .:sljc.jar JdbcTest). -- Contents of JdbcTest.java import java.sql.*; public class JdbcTest { public static void main(String[] args) { try { Class.forName("com.ddtek.jdbc.sequelink.SequeLinkDriver"); // Load driver. Connection con = DriverManager.getConnection( "jdbc:sequelink://127.0.0.1:2399;serverdatasource=Untitled", "admin", "" ); // Get connection. final String sql = "select * from Untitled"; Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery(sql); while (rs.next()) { System.out.println("value = " + rs.getString(1)); } con.close(); // Closing connection. } catch ( Exception e ) { e.printStackTrace(); } } } Hope this helps.
Create an account or sign in to comment