3 Replies Latest reply on Nov 12, 2004 9:32 PM by shiraz memon

    Having problem in connecting with firebird database

    shiraz memon Newbie

      Hi

      I have tried the session bean connecting with hypersonic databse it works well. But i could not make it possible with firebird/interbase. I have paseted firebird-ds.xml at JBOSS_HOME/server/default/deploy and also firebirdsql.rar within the same directory as directed by Jaybird doc. And i also changed the name of referrence in ejb-jar.xml i.e. from java:/DefaultDS to java:/FirebirdDS

      I have set the username, path and database file path in the above mentioned files. For making me clear i am pasting the code of the above files as follows:

      firebird-ds.xml


      <?xml version="1.0" encoding="UTF-8"?>
      
       <!-- ==================================================================== -->
       <!-- New ConnectionManager setup for firebird dbs using jca-jdbc xa driver-->
       <!-- Build jmx-api (build/build.sh all) and view for config documentation -->
       <!-- ==================================================================== -->
      
      <connection-factories>
      
       <!--FBManager can be used to create and drop databases.
       Drop is especially useful during testing, since it
       assures a clean start next time. -->
       <mbean code="org.firebirdsql.management.FBManager" name="jboss.jca:service=FirebirdManager">
       <attribute name="FileName">D:/Program Files/Firebird/Firebird_1_5/examples/TAX.FDB</attribute>
       <attribute name="UserName">sysdba</attribute>
       <attribute name="Password">sa</attribute>
       <attribute name="CreateOnStart">true</attribute>
       <attribute name="DropOnStop">false</attribute>
       </mbean>
      
       <tx-connection-factory>
      
       <jndi-name>FirebirdDS</jndi-name>
      
       <xa-transaction/>
      
       <rar-name>firebirdsql.rar</rar-name>
      
       <adapter-display-name>Firebird Database Connector</adapter-display-name>
      
       <config-property name="Database" type="java.lang.String">localhost/3050:D:/Program Files/Firebird/Firebird_1_5/examples/TAX.FDB</config-property>
      
       <user-name>sysdba</user-name>
      
       <password>sa</password>
      
       additional properties. only use one way of setting tx isolation, please
       <config-property name="TransactionIsolation"></config-property>
       <config-property name="TransactionIsolationName">TRANSACTION_READ_COMMITTED</config-property>
       <config-property name="BlobBufferLength"></config-property>
       <config-property name="Encoding"></config-property>
      
      
       <min-pool-size>0</min-pool-size>
       <!-- sql to call when connection is created
       <new-connection-sql>some arbitrary sql</new-connection-sql>
       -->
      
       <!-- sql to call on an existing pooled connection when it is obtained from pool
       <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
       -->
      
       </tx-connection-factory>
      
      </connection-factories>


      ra.xml (inside the firebirdsql.rar)

      <?xml version="1.0" encoding="UTF-8"?>
      
      <!DOCTYPE connector PUBLIC "-//Sun Microsystems, Inc.//DTD Connector 1.0//EN" "http://java.sun.com/dtd/connector_1_0.dtd">
      
      
      <connector>
       <display-name>Firebird Database Connector</display-name>
       <vendor-name>Firebird Database</vendor-name>
       <spec-version>1.0</spec-version>
       <eis-type>Relational Database</eis-type>
       <version>1.0</version>
       <resourceadapter>
       <managedconnectionfactory-class>org.firebirdsql.jca.FBManagedConnectionFactory</managedconnectionfactory-class>
       <connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
       <connectionfactory-impl-class>org.firebirdsql.jdbc.FBDataSource</connectionfactory-impl-class>
       <connection-interface>java.sql.Connection</connection-interface>
       <connection-impl-class>org.firebirdsql.jdbc.FBConnection</connection-impl-class>
       <transaction-support>XATransaction</transaction-support>
      <!-- TODO: add server and port properties. Right now, you must specify
      them in the Database property like this: <host>/<port>:<path to db file> -->
       <config-property>
       <config-property-name>Database</config-property-name>
       <config-property-type>java.lang.String</config-property-type>
       <config-property-value>localhost/3050:D:/Program Files/Firebird/Firebird_1_5/examples/TAX.FDB</config-property-value>
       </config-property>
       <config-property>
       <config-property-name>TransactionIsolation</config-property-name>
       <config-property-type>java.lang.Integer</config-property-type>
       <config-property-value></config-property-value>
       </config-property>
       <config-property>
       <config-property-name>TransactionIsolationName</config-property-name>
       <config-property-type>java.lang.String</config-property-type>
       <config-property-value>TRANSACTION_READ_COMMITTED</config-property-value>
       </config-property>
       <config-property>
       <config-property-name>UserName</config-property-name>
       <config-property-type>java.lang.String</config-property-type>
       <config-property-value>sysdba</config-property-value>
       </config-property>
       <config-property>
       <config-property-name>Password</config-property-name>
       <config-property-type>java.lang.String</config-property-type>
       <config-property-value>sa</config-property-value>
       </config-property>
       <config-property>
       <config-property-name>BlobBufferLength</config-property-name>
       <config-property-type>java.lang.Integer</config-property-type>
       <config-property-value></config-property-value>
       </config-property>
       <config-property>
       <config-property-name>Encoding</config-property-name>
       <config-property-type>java.lang.String</config-property-type>
       <config-property-value></config-property-value>
       </config-property>
       <authentication-mechanism>
       <authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
       <credential-interface>javax.resource.security.PasswordCredential</credential-interface>
       </authentication-mechanism>
       <reauthentication-support>false</reauthentication-support>
       </resourceadapter>
      </connector>
      


      ejb-jar.xml


      <?xml version="1.0"?>
      
      <!DOCTYPE ejb-jar PUBLIC
      '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN'
      'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
      
      <ejb-jar>
       <enterprise-beans>
       <session>
       <ejb-name>QueryDB</ejb-name>
       <home>day09.QueryDBHome</home>
       <remote>day09.QueryDB</remote>
       <ejb-class>day09.QueryDBBean</ejb-class>
       <session-type>Stateless</session-type>
       <transaction-type>Container</transaction-type>
       <resource-env-ref>
       <resource-env-ref-name>jdbc/styejbDB</resource-env-ref-name>
       <resource-env-ref-type>javax.sql.DataSource</resource-env-ref-type>
       </resource-env-ref>
       </session>
       </enterprise-beans>
      </ejb-jar>


      jboss.xml


      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd">
      <jboss>
       <enterprise-beans>
       <session>
       <ejb-name>QueryDB</ejb-name>
       <jndi-name>day09/QueryDBHome</jndi-name>
       <resource-env-ref>
       <resource-env-ref-name>jdbc/styejbDB</resource-env-ref-name>
       <jndi-name>java:/FirebirdDS</jndi-name>
       </resource-env-ref>
       </session>
       </enterprise-beans>
      </jboss>



      When i use DefaultDS(i.e. Hypersonic) it works fine and succesfully got connection with it, but not with FirebirdDS(Firebird database)

      looking forward to get positive reply

      regards
      IshQ


        • 1. Re: Having problem in connecting with firebird database
          Joachim Van der Auwera Expert

          Could you at least tell us the error message you are getting?

          Which version of JBoss (there are some differences)?

          You should not need to modify ra.xml (I never ever looked inside the firebirdsql.rar file and have everything working just fine).

          Joachim

          • 2. Re: Having problem in connecting with firebird database
            shiraz memon Newbie

            Hi

            When i have pasted firebirdsql.rar and firebird-ds.xml it gives the following error



            03:23:04,296 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
            MBeans waiting for other MBeans:
            ObjectName: jboss.jca:service=TxCM,name=FIrebirdDS
             state: CONFIGURED
             I Depend On: jboss.jca:service=ManagedConnectionPool,name=FIrebirdDS
             jboss.jca:service=CachedConnectionManager
             jboss:service=TransactionManager
            
             Depends On Me: jboss.jca:service=ConnectionFactoryBinding,name=FIrebirdDS
            
            ObjectName: jboss.jca:service=ManagedConnectionPool,name=FIrebirdDS
             state: CONFIGURED
             I Depend On: jboss.jca:service=ManagedConnectionFactory,name=FIrebirdDS
            
             Depends On Me: jboss.jca:service=TxCM,name=FIrebirdDS
            
            ObjectName: jboss.jca:service=ManagedConnectionFactory,name=FIrebirdDS
             state: CONFIGURED
             I Depend On: jboss.jca:service=RARDeployment,name=''
            
             Depends On Me: jboss.jca:service=ManagedConnectionPool,name=FIrebirdDS
            
            ObjectName: jboss.jca:service=ConnectionFactoryBinding,name=FIrebirdDS
             state: CONFIGURED
             I Depend On: jboss.jca:service=TxCM,name=FIrebirdDS
            
             Depends On Me:
            
            MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM:
            ObjectName: jboss.jca:service=RARDeployment,name=''
             state: NOTYETINSTALLED
             I Depend On:
             Depends On Me: jboss.jca:service=ManagedConnectionFactory,name=FIrebirdDS


            This time i have pasted firebirdsql.rar without making any changes to ra.xml i.e. leaves username, password and path of database fields. But instead i got the same error.

            If i try to run my code with DefaultDS i.e. Hypersonic DB it works fine but with firebird it cannot make the connection.

            Well! thanks for considering my problem
            bye
            IshQ

            • 3. Re: Having problem in connecting with firebird database
              shiraz memon Newbie

              Hi again

              Version which i m using is JBoss 4.0.0RC1. You can see Home, client, remote interface and bean implementation class code in my previous post.

              Can u please tell me step by step if it is possible that what should i do to make firebird database capable enough to work with my deployed application.

              Thanks!!!
              IshQ