i dont know what to do?
ishq Nov 12, 2004 9:18 AMHi
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