1 2 Previous Next 19 Replies Latest reply on May 10, 2017 9:17 AM by fmpdude

    JDBC, connect to another computer on the same network

    lancelot

      Hi,

       

      I've a local network at home where FMP is opened on a computer, let's call it computer A.

      JDBC sharing is enabled as well as Network sharing.

      The IP address of this computer is static.

       

      I've another computer, let's call it computer B, where the FMP files from computer A are opened remotly.

      I want to run a Java program on computer B to establish a connection with the FMP files from computer A.

      I'm currently using this line of code, which isn't working :

       

      connexion = DriverManager.getConnection("jdbc:filemaker://"+ipAddressComputerA+"/myDatabase", "Admin", "");

       

      Also, the library "fmjdbc.jar" is imported.

       

      It seems obvious but I've struggled many days on this issue.

      Do you have any idea on how to establish the connection ? Should I specify a port for the connection ?

       

      Many thanks.

        • 1. Re: JDBC, connect to another computer on the same network
          user19752

          You can't.

          Up to five connections and supports local access (same computer) only.

          You need set up xDBC sharing on B computer, or use FileMaker Server.

          • 2. Re: JDBC, connect to another computer on the same network
            taylorsharpe

            I think xDBC connections only work with FileMaker Server and not FileMaker Pro.  Can someone else confirm that?

            • 3. Re: JDBC, connect to another computer on the same network
              user19752

              It should work on Pro, I quoted from p.7 of https://fmhelp.filemaker.com/docs/15/en/fm15_odbc_jdbc_guide.pdf

               

              I used ODBC with 1 conection on Pro many times.

              • 4. Re: JDBC, connect to another computer on the same network
                lancelot

                What's the difference between xDBC and JDBC ?

                • 5. Re: JDBC, connect to another computer on the same network
                  user19752

                  x in xDBC is "wild card", JDBC is one of xDBC, another one is ODBC.

                  1 of 1 people found this helpful
                  • 6. Re: JDBC, connect to another computer on the same network
                    fmpdude

                    JDBC is the Java Open Database Connectivity.  I use JDBC with FileMaker all the time and it works great. However, it's used to access FileMaker from a program outside FileMaker.

                     

                    When you want to have FileMaker itself access some other database ...that's ODBC. At least that's how it's set up in FMP.

                     

                    ------

                     

                    I don't think you can have FileMaker in the JDBC loop since FMP can't initiate JDBC calls itself - at least without some plug-in I'm not aware of (MBS?).

                     

                    Just have your Java code access the shared (via the Sharing menu) FileMaker Database solutions one at a time, but don't expect FMP to initiate JDBC calls inside some kind of chained JDBC calls.

                     

                    As stated above, you need to allow ODBC/JDBC:

                     

                    For JDBC to work:

                     

                    1. You need to add the FileMaker JDBC jar file to your Java code's classpath.

                    2. Set up a connection in your Java code to the right IP address (or to localhost, or whatever).


                    The machine your Java code is connecting to can be .... anywhere, not just the local network.

                     

                    You can do all this in FMP or FMPA.

                     

                    FMS would be super convenient for Internet JDBC connectivity, but not required.

                     

                    Note: both FileMaker's ODBC and JDBC drivers are in the FileMaker download.

                     

                    Let me know if I can help, OK?

                     

                    HOPE THIS HELPS.

                    2 of 2 people found this helpful
                    • 7. Re: JDBC, connect to another computer on the same network
                      lancelot

                      Thanks a lot for this usefull information.

                       

                      I did what you said to make a JDBC connection and it works great when I'm running the Java program on the computer where FMP is running.

                       

                      The thing I can't do is to run the Java program on a computer and access FMP databases which are running on another computer. Is this possible to do this with JDBC without using FileMaker Server ?

                      • 8. Re: JDBC, connect to another computer on the same network
                        fmpdude

                        Sure. If I understand what you're saying it should work fine without FMS. FMS would be preferred on the Internet/WAN, naturally.

                         

                        Ok, so back to local...If you have an another computer on your network where the FileMaker app is open and sharing enabled for JDBC, you just need to adjust the connection string in your Java class on the other computer to use the IP Address of that computer where FileMaker is open.

                         

                        On Windows use the command "ipconfig" to get the IP address of the computer you're on.

                         

                        On Mac use the command "Ifconfig" to get the IP address of the computer you're on.

                         

                        If it doesn't work, please post back more details with IP addresses and your Java connection string for FMP.

                         

                        HOPE THIS HELPS.

                        1 of 1 people found this helpful
                        • 9. Re: JDBC, connect to another computer on the same network
                          lancelot

                          Here is the code I use in Java to connect to my 3 FMP files :

                           

                          bddDossierInformatique = DriverManager.getConnection("jdbc:filemaker://"+ipAddress+"/Dossier Informatique", "admin", "");
                          bddProduits = DriverManager.getConnection("jdbc:filemaker://"+ipAddress+"/A TARIFS 1 Produits", "admin", "");
                          bddFacture = DriverManager.getConnection("jdbc:filemaker://"+ipAddress+"/FACTURE SARL", "admin", "");
                          

                           

                          ipAddress equals the IP address of the computer where FMP is opened, in my case 192.168.1.23 (by the way, do I need to specify a port ?)

                          JDBC Sharing and Network sharing are enabled in FMP.

                          No authentification is required to open the FMP files so I just wrote "admin" and "" for authentification in the java code.

                           

                          Files on the program's folder are :

                           

                          - myProgram.jar

                          - lib

                          - fmjdbc.jar (the jdbc driver)

                           

                           

                          Right now I open FMP on a computer and run the Java program on another computer.

                          Do I also need to open FMP on the computer where I run the program ?

                           

                          I really appreciate your help, please let me know if you need any further information.

                          • 10. Re: JDBC, connect to another computer on the same network
                            fmpdude

                            Darn it! Looks like I was wrong. It "should" work, but FMI (marketing) appears to have blocked this productivity attempt on your part.

                             

                            To really test your situation, I fired up Intellij IDEA on my Windows box and tried to access a ZIp Code database on my Mac. To my supreme disappointment, I see that FMI has installed yet another irritating limitation to get you to FMS!

                             

                            It seems they have decided to further frustrate us by having the limitation that you can only use xDBC on the same box where FileMaker is installed. (Transparent attempt to get you to pay for FMS, I'm guessing.)

                             

                            FMI: What??? Why??? This is an utterly silly, ridiculous, irritating, and, really, pointless limitation!!!

                             

                            Therefore, if you have any way to use MySQL instead of FMP, you would have zero issues with JDBC and MySQL servers ANYWHERE on your network or ANWHERE on the Internet as a whole. Assuming you have permissions and an IP address, of course.

                             

                            I continue to be amazed by the attempts to "chute" us into an overly expensive FMS situation that should be in many cases totally unnecessary.

                             

                            If this were me, I'd skip FMP for this project and use MySQL or some other non-limiting data solution. I've written data conversion routines between FMP and MySQL and between FMP and SQL Server and now use those platforms nearly exclusively after six years with FMP.

                             

                            I hope FMI wakes up and stops irritating their developers. Jeeez!!!!

                             

                            Due to the many, many, many, many, ...., missing features in FMP (>30 that I've documented, now >31 with this JDBC revelation) which kept me from being productive, I no longer use, or plan to use, FMP for any new projects. I only have two small legacy FMP projects. That's it. I had hoped for a lot more six years ago. Whatever.

                             

                            HOPE THIS HELPS.

                            1 of 1 people found this helpful
                            • 11. Re: JDBC, connect to another computer on the same network
                              lancelot

                              This is so irritating and I doubt FMI will change anything...

                               

                              I've multiple licences for FileMaker Pro.

                              Let's say I install FMP on both computers, then open my fmp files on the first computer and open remotely the files from the first computer on the second computer, and finally make a JDBC connection on the second computer with the files I opened remotely.

                              Technically it amounts to make a JDBC connection on the localhost and it's authorize by FMP.

                              Do you think this can work ?

                               

                              Another question, if I've to purchase FileMaker Server and want all my computers to be able to connect to it, would I only need a single licence or as many licences as I have computers ?

                              • 12. Re: JDBC, connect to another computer on the same network
                                fmpdude

                                After the ridiculous pricing FMS models started, I stopped considering it after version 13 for anything server related. So, I can't answer FMS questions.

                                 

                                If you contrast FMI's behavior with, say, MS (and I'm no big fan of MS), MS works ACTIVELY with their developers on just about every front to help make them successful. I'm baffled by the transparent attempts to force you toward FMS and thwart basic productivity for FMP (without paying, paying, ...). The only reason I can see that FMI would stop you from connecting to another version of FMP on another machine is a marketing decision to try to force you in to FMS. No other "technical" program works that way.

                                 

                                In any case, you'll have to experiment with your configuration ideas. but I doubt, given the "marketing restriction" with FMP you'll be able to connect to another machine using JDBC.

                                 

                                If you need a real server situation, I'd set up a server, install MySQL and be done with it (FREE, NO FMS needed, NO concurrent user connections FEES, FEES, FEES).

                                 

                                I wish I could be more positive about this. Hopefully FMI will lower prices, remove the rediculous concurrent connection "model" ($$$) in FMS, and remove silly restrictions that limit developer productivity and only make them stop using their software for new projects as I've done.

                                 

                                Even though in version 15, you still can't (baffling) even search/replace in a script, I actually still like FMP for the little I still use it for.

                                 

                                HOPE THIS HELPS.

                                • 13. Re: JDBC, connect to another computer on the same network
                                  user19752

                                  You don't need additional licence for xDBC or CWP connections, need only a server licence.

                                  But I couldn't find term in "FileMaker Store: Legacy Licensing options "

                                  • 14. Re: JDBC, connect to another computer on the same network
                                    fmpdude

                                    Agreed, FMS solves the issue and would be the best (and, thanks to FMI marketing), the ONLY way to access any remote FMP File - even on another machine in your own network.

                                     

                                    Just be prepared to spend ... lots.

                                    1 2 Previous Next