xtrim Posted December 17, 2006 Posted December 17, 2006 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...
ave! Posted December 20, 2006 Posted December 20, 2006 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.
Recommended Posts
This topic is 6547 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now