Loading ...
Sorry, an error occurred while loading the content.

more on getting embedded ... RE: [Firebird-Java] Once again ... Re: Firebird Embedded deploying with Java

Expand Messages
  • palmer ristevski
    Hi Roman, A while back you gave me some code for Client-Server and Emebedded : See below : *************************************************** FBManager m =
    Message 1 of 10 , Oct 3, 2009
    • 0 Attachment
      Hi Roman,

      A while back you gave me some code for Client-Server and Emebedded :
      See below :

      ***************************************************
      FBManager m = new FBManager();
      m.setServer(host);
      m.setPort(3050); //optional
      m.start();
      // recreate if db exists
      m.setForceCreate(true);
      m.createDatabase(path, user, password);
      m.stop();

      for embedded:

      FBManager m = new FBManager("EMBEDDED");
      m.start();
      // recreate if db exists
      m.setForceCreate(true);
      m.createDatabase(path, user, password);
      m.stop();
      *******************************************************

      The Client-Server stuff worked well.

      I had problems with embedded, but i knew it was me not understanding which files i needed, and just general
      now knowing the ideas for embedded operation properly.

      You helped me out again by telling me I need the following files :
      "In order to use fbembed.dll you need jaybird-x.x.x.jar and jaybirdXX.dll."

      And you told me to look up some of the release notes :

      Roman said :
      "Also you can check "Using Type 2 and Embedded Server driver" in release

      notes (beginning from page 11 in PDF) - if there are unclear parts,

      please ask questions here and/or help to formulate them better."

      Now with my research, I have come to the conclusion that the documentation is not clear.
      There is documentation in the release notes but it addresses the COM-developer using VB or VC++,
      not the Java guy.

      I found some other developer forum site saying that you need many more files, see here :

      &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
      http://forums.devshed.com/firebird-sql-development-61/newby-question-java-application-with-firebird-embedded-256848.html


      I had solved the problem.

      copy fbembed.dll without renaming it to the java application root directory. Also copy firebird.conf, firebird.msg and intl directory.

      Then, in the database URL write something like this: "jdbc:firebirdsql:embedded:c:\\data\\testdb.fdb"

      It should work...

      &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

      Also with a colleague of mine we were wondering if for embedded mode we need to use a different string than
      this one:
      "org.firebirdsql.jdbc.FBDriver", this can from code from documentation below:



      // The newInstance() call is a work around for some

      // broken Java implementations



      Class.forName("org.firebirdsql.jdbc.FBDriver").newInstance();



      }

      catch (Exception E) {

      System.err.println("Unable to load driver.");

      E.printStackTrace();

      }




      I also found this :(but does not seem to talk to Java dev)
      http://www.firebirdsql.org/manual/ufb-cs-embedded.html#ufb-cs-embedded-windows


      Also anther problem is that when I put the JayBird.jar file in the class path in NetBeans IDE,
      I don't seem to be able to put the .dll files in the class path. But I put the .dll files in the same
      directory as the .jar file.


      SO in the end you see the documentation on getting EMBEDDED mode working is all over the place.
      It is difficult to get all the information one needs in one place.


      Has anybody made an effort to put all the steps required to get embedded mode of Firebird working,
      on a blog site or something.

      If I ever get this working I will write out a document in detail and share it with everyone.


      Regards,


      Palmer





      To: Firebird-Java@yahoogroups.com
      From: roman@...
      Date: Tue, 7 Apr 2009 17:59:24 +0200
      Subject: Re: [Firebird-Java] Once again ... Re: Firebird Embedded deploying with Java





















      > So even if one was to not use it in embedded mode,

      > my question is still whether the Jaybird JAR file

      > is a total re-write of Firebird database engine in Java

      > hence it is all in this file.



      No, it is not. jaybird-x.x.x-full.jar is a JAR that contains also

      dependent libraries for those that have simple setup, want to take a jar

      file and do not bother themselves with other dependencies. Can lead to

      lib conflicts.



      > OR is is just a driver to connect to the FireBird engine

      > which is just a ".dll" file.



      In order to use fbembed.dll you need jaybird-x.x.x.jar and jaybirdXX.dll.



      > Once again I wish to know what files

      > are important to just get started.



      What about reading "Distribution package" chapter from release notes

      (page 8 in PDF)?



      Also you can check "Using Type 2 and Embedded Server driver" in release

      notes (beginning from page 11 in PDF) - if there are unclear parts,

      please ask questions here and/or help to formulate them better.



      Roman




















      _________________________________________________________________
      Hotmail: Trusted email with powerful SPAM protection.
      http://clk.atdmt.com/GBL/go/177141665/direct/01/

      [Non-text portions of this message have been removed]
    • Mark Rotteveel
      ... I don t normally use embedded, but simply copying the contents of the Firebird embedded Zip + jaybird21.dll into the root of my Netbeans project makes
      Message 2 of 10 , Oct 11, 2009
      • 0 Attachment
        palmer ristevski wrote:

        > Also anther problem is that when I put the JayBird.jar file in the class path in NetBeans IDE,
        > I don't seem to be able to put the .dll files in the class path. But I put the .dll files in the same
        > directory as the .jar file.

        > SO in the end you see the documentation on getting EMBEDDED mode working is all over the place.
        > It is difficult to get all the information one needs in one place.

        > Has anybody made an effort to put all the steps required to get embedded mode of Firebird working,
        > on a blog site or something.

        I don't normally use embedded, but simply copying the contents of the
        Firebird embedded Zip + jaybird21.dll into the root of my Netbeans
        project makes everything just work. That is without specifying
        java.library.path or the system PATH, or without using
        System.load(<absolute-path-to-jaybird21.dll>).

        Of course to get it working outside of Netbeans will probably need some
        additional tweaking of the ANT build.xml to get a complete distribution.

        This isn't the prettiest solution, but it does work!
        --
        Mark Rotteveel
      • palmer ristevski
        OK! Thanks for the input Mark. I ll give it a try! P To: Firebird-Java@yahoogroups.com From: Avalanche1979@gmx.net Date: Sun, 11 Oct 2009 20:04:26 +0200
        Message 3 of 10 , Oct 11, 2009
        • 0 Attachment
          OK!
          Thanks for the input Mark.
          I'll give it a try!

          P

          To: Firebird-Java@yahoogroups.com
          From: Avalanche1979@...
          Date: Sun, 11 Oct 2009 20:04:26 +0200
          Subject: Re: more on getting embedded ... RE: [Firebird-Java] Once again ... Re: Firebird Embedded deploying with Java





















          palmer ristevski wrote:



          > Also anther problem is that when I put the JayBird.jar file in the class path in NetBeans IDE,

          > I don't seem to be able to put the .dll files in the class path. But I put the .dll files in the same

          > directory as the .jar file.



          > SO in the end you see the documentation on getting EMBEDDED mode working is all over the place.

          > It is difficult to get all the information one needs in one place.



          > Has anybody made an effort to put all the steps required to get embedded mode of Firebird working,

          > on a blog site or something.



          I don't normally use embedded, but simply copying the contents of the

          Firebird embedded Zip + jaybird21.dll into the root of my Netbeans

          project makes everything just work. That is without specifying

          java.library.path or the system PATH, or without using

          System.load(<absolute-path-to-jaybird21.dll>).



          Of course to get it working outside of Netbeans will probably need some

          additional tweaking of the ANT build.xml to get a complete distribution.



          This isn't the prettiest solution, but it does work!

          --

          Mark Rotteveel




















          _________________________________________________________________
          Hotmail: Powerful Free email with security by Microsoft.
          http://clk.atdmt.com/GBL/go/171222986/direct/01/

          [Non-text portions of this message have been removed]
        • Mark Rotteveel
          I will try some cleaner solutions tonight, but those involve either classloader-hacking using reflection or writing a new classloader. Mark ... -- GRATIS
          Message 4 of 10 , Oct 11, 2009
          • 0 Attachment
            I will try some 'cleaner' solutions tonight, but those involve either classloader-hacking using reflection or writing a new classloader.

            Mark

            > OK!
            > Thanks for the input Mark.
            > I'll give it a try!
            >
            > P

            --
            GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
            Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
          Your message has been successfully submitted and would be delivered to recipients shortly.