January 28, 200520 yr Newbies Hello! I am trying to connect to a Filemaker 5 (.fp5) file from a Java program using JDBC (driver fmpjdbc12.jar). No matter what I put after the second colon in the getConnection("jdbc:fmpro:c:test.fp5") function, I always get the following error upon execution (it compiles fine) JAVA.SQL.SQLException: [973] invalid database It appears that I have the driver installed correctly, because I can comment out the second line below and it compiles fine. Also, I am able to connect to an Access database using a different driver. I have the file "test.fp5" in the correct folder and open. My code is pasted below: Class.forName("com.fmi.jdbc.JdbcDriver"); Connection con = DriverManager.getConnection("jdbc:fmpro:c:test.fp5"); I am desperate for help. I am flat out of ideas and things to try. Can anyone help me out?
January 31, 200520 yr Author Newbies I got it!!! Yes, it is possible to connect to a FMP 5.5 database through a JDBC connection in a Java app. You have to get the port number right, enable the web companion, install the JDBC driver, and a few days later...it works. Here is the code for anyone else who has ever had this problem: the file is test.fp5 Connection con = DriverManager.getConnection("jdbc:fmpro:http://localhost:80/"); DriverManager Statement s = con.createStatement(); s.execute("SELECT * FROM test"); ResultSet rs = s.getResultSet(); if (rs != null) while ( rs.next() ) { System.out.println("Data from test: " + rs.getString(1) ); }
Create an account or sign in to comment