You are looking up comp/env/jdbc/odotref_link
but you have <res-ref-name>jdbc/odotref_link</res-ref-name>
try <res-ref-name>comp/env/jdbc/odotref_link</res-ref-name>
James Cook wrote:
> I am converting a CMP bean to a BMP. I am using Sybase as the database,
and the
> CMP version works fine.
>
> I must have a configuration error however, since my BMP code gives me the
> following exception when I try to execute a query:
>
> TRANSACTION ROLLBACK EXCEPTION:null; nested exception is:
> javax.ejb.EJBException
> java.sql.SQLException: Table not found: COUNTY in statement [insert into
county
> (COUNTY_NBR, COUNTY_NME, COUNTY_ABREV3_CD, COUNTY_ABREV4_CD) values
(1,'North
> Pole','NPL','NOPL')]
> at org.hsql.Trace.getError(Trace.java:124)
> at org.hsql.Result.<init>(Result.java:70)
> at org.hsql.jdbcConnection.executeHSQL(jdbcConnection.java:644)
> at org.hsql.jdbcConnection.execute(jdbcConnection.java:540)
> at org.hsql.jdbcStatement.fetchResult(jdbcStatement.java:499)
> at org.hsql.jdbcStatement.executeUpdate(jdbcStatement.java:52)
> at
>
org.hsql.jdbcPreparedStatement.executeUpdate(jdbcPreparedStatement.java:114)
> at
>
org.jboss.minerva.jdbc.PreparedStatementInPool.executeUpdate(PreparedStateme
ntIn
> Pool.java:81)
> at
>
us.oh.state.dot.common.ejb.reference.ejb.bean.CountyBeanBMP.ejbCreate(County
Bean
> BMP.java:51)
>
> Borland AppServer does a very nice job of declaring datasources. jBoss
appears
> to me to require a couple additional files to achieve what BAS
accomplishes with
> the single ejb-inprise.xml descriptor. Here are the settings in the
relevant
> jBoss files:
>
> jboss.conf
> ========
> <MLET CODE="org.jboss.jdbc.XADataSourceLoader" ARCHIVE="jboss.jar"
> CODEBASE="../lib/ext/">
> <ARG TYPE="java.lang.String" VALUE="SybaseDB">
> <ARG TYPE="java.lang.String"
VALUE="org.jboss.minerva.xa.XADataSourceImpl">
> </MLET>
>
> jboss.jcml
> =======
> <mbean name="DefaultDomain:service=XADataSource,name=SybasePool">
> <attribute
name="URL">jdbc:sybase:Tds:SOCDB004:25000/testdb</attribute>
> <attribute name="JDBCUser">user</attribute>
> <attribute name="Password">pass</attribute>
> </mbean>
>
> jboss.xml
> =======
> ....
> <entity>
> <ejb-name>CountyBeanBMP</ejb-name>
> <jndi-name>odotref/county_bmp</jndi-name>
> <resource-ref>
> <res-ref-name>jdbc/odotref_link</res-ref-name>
> <resource-name>jdbc/odotref_datasource</resource-name>
> </resource-ref>
> </entity>
> ....
> <resource-managers>
> <resource-manager>
> <res-name>jdbc/odotref_datasource</res-name>
> <res-jndi-name>SybasePool</res-jndi-name>
> </resource-manager>
> </resource-managers>
> ....
>
> MyBean
> =======
> I look up the database connection using:
> Context ctx = (Context) new InitialContext();
> DataSource ds =
(DataSource)ctx.lookup(java:comp/env/jdbc/odotref_link");
> Connection conn = ds.getConnection();
>
> The exception occurs when I execute a query using this connection. Also,
the
> DatabaseMetaData for the connection does not seem to be knowledgable of
any of
> the database information.
>
> thanks,
> jim
>
> --
> --------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
---------------------------------------------------------------------
This message (including any attachments) contains confidential, proprietary
or privileged information intended for a specific purpose and individual(s),
and is protected by law. If you receive this message in error, please
immediately delete it and all copies of it from your system, destroy any
hard copies of it and notify the sender. Any unauthorized disclosure,
copying or distribution of any part of this message, or the taking of any
unauthorized action based on it, is strictly prohibited.
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]