All,


I have an entity bean that uses a table in there called test which has four
columns - txnRefDate, txnSequence, intentId and accountNo.
But it looks like as soon as I try access this table it complains because it
is trying to access the wrong database. It looks like the result of the JNDI
lookup is giving me the wrong DataSource 

the MLET extracts of files below:

I have read the FAQ and the manuals and can't get anywhere - Appreaciate any
suggestions you may have

BTW: Solaris 6 / Sybase 11.9.2.1 

jboss.jcml
*********************************
<mbean name="DefaultDomain:service=XADataSource,name=InstructionTestDB">
       <attribute
name="URL">jdbc:sybase:Tds:lnitdss06.fi.gs.com:2010</attribute>
       <attribute name="JDBCUser">donkey</attribute>
       <attribute name="Password">*****</attribute>
       ......
</mbean>
*********************************

jboss.conf
*********************************
<MLET CODE="org.jboss.jdbc.XADataSourceLoader" ARCHIVE="jboss.jar"
CODEBASE="../../lib/ext/">
    <ARG TYPE="java.lang.String" VALUE="InstantDB">
    <ARG TYPE="java.lang.String"
VALUE="org.jboss.minerva.xa.XADataSourceImpl">
</MLET>

<MLET CODE="org.jboss.jdbc.XADataSourceLoader" ARCHIVE="jboss.jar"
CODEBASE="../../lib/ext/">
    <ARG TYPE="java.lang.String" VALUE="DefaultDS">
    <ARG TYPE="java.lang.String"
VALUE="org.jboss.minerva.xa.XADataSourceImpl">
</MLET>

<MLET CODE = "org.jboss.jdbc.XADataSourceLoader" ARCHIVE="jboss.jar,
jconn2.jar" CODEBASE="../../lib/ext">
   <ARG TYPE="java.lang.String" VALUE="InstructionTestDB">
   <ARG TYPE="java.lang.String"
VALUE="org.jboss.minerva.xa.XADataSourceImpl">
</MLET>
*********************************


access code:

getConnection(){
        Context initial = new InitialContext();
        DataSource dataSource = (DataSource)
initial.lookup("java:comp/env/InstructionTestDB");
        return dataSource.getConnection();
}

public InstructionPK ejbFindByPrimaryKey(InstructionPK primaryKey) throws
FinderException{
                Connection con = null;
                try{
                        con = getConnection();
                        System.out.println("connected as " +
con.getMetaData().getUserName());
                        System.out.println("url = " +
con.getMetaData().getURL());
                        PreparedStatement statement =
con.prepareStatement("select accountNo from test where txnRefDate = ? " +
                                        " and txnSequence = ? and intentId =
? ");
}

and the output is

[Instruction] connected as SA
[Instruction] url = jdbc:HypersonicSQL:hsql://localhost:1476
[Instruction] TRANSACTION ROLLBACK EXCEPTION:null; nested exception is: 
        javax.ejb.EJBException
[Instruction] java.sql.SQLException: Table not found: TEST in statement
[select accountNo from test where txnRefDate = 1  and txnSequence = 1 and
intentId = 1 ]
[Instruction]   at org.hsql.Trace.getError(Trace.java:124)
.
.


which is obviously not what I wanted.



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]

Reply via email to