Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7234 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

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)B)

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?

  • Newbies
Posted

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

}

This topic is 7234 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.