Hi,

I'm still having problems with the Test example.
I've tried using Oracle drivers that WebLogic provide to see if that would help.
My problem has simply moved - I'm not sure if it's moved forwards or backwards
though!
Its occuring at the execute() call to the OQLQuery as below :
---------------------------------------
        computerOql = db.getOQLQuery( "SELECT c FROM myapp.Computer c WHERE id =
$1" );
        computerOql.bind( 6 );
        results = computerOql.execute();
---------------------------------------


Not getting problems with the Select statement (perhaps thats just because i've
moved the problem forwards!). Instead 'explict attach' errors.

Error recieved:

[MIk] SELECT
"COMPUTER"."ID","PROD"."NAME","PROD"."PRICE","PROD"."GROUP_ID","PROD_DETAIL"."ID","COMPUTER"."CPU"

FROM "PROD","COMPUTER","PROD_DETAIL" WHERE "COMPUTER"."ID"="PROD"."ID" AND
"COMPUTER"."ID"="PROD_DETAIL"."PROD_ID"(+) AND ("COMPUTER"."ID" = ?)

----------  LOGIN ERROR CODE: 24327
[MIk] org.exolab.castor.jdo.PersistenceException: Nested error:
java.sql.SQLException: ORA-24327: need explicit attach before authenticating a
user - (mbernie/********) [MIk] org.exolab.castor.jdo.PersistenceException:
Nested error: java.sql.SQLException: ORA-24327: need explicit attach before
authenticating a user - (mbernie/********) [MIk]   at
org.exolab.castor.jdo.engine.TransactionContextImpl.getConnection(TransactionContextImpl.java:207)

[MIk]     at
org.exolab.castor.persist.TransactionContext.query(TransactionContext.java:616)
[MIk]     at
org.exolab.castor.jdo.engine.OQLQueryImpl.execute(OQLQueryImpl.java:457) [MIk]
at org.exolab.castor.jdo.engine.OQLQueryImpl.execute(OQLQueryImpl.java:404)
[MIk]     at jdo.Test.run(Test.java:108) [MIk]     at
jdo.Test.main(Test.java:54)



My database.xml file is as follows:


  <database name="cad" engine="oracle">
    <driver class-name="weblogic.jdbc.oci.Driver"  url="jdbc:weblogic:oracle">
         <param name="password" value="cad" />
     <param name="user" value="mbernie" />
    </driver>
   <mapping href="mapping.xml" />
  </database>


Although I have also tried other configurations!

If anyone could help I'd really appreciate it.

Many thanks in advance.

MIles










To:   [EMAIL PROTECTED]
cc:     (bcc: Miles Bernie)
Date: 09/14/2001 11:27 AM
From: [EMAIL PROTECTED]
Subject:  Re: [castor-dev] Object to DB Example required






Many thanks for your help Robert.
I'm running Oracle and havn't created a db instance called 'test'.
Instead I just tweaked the database.xml file as below:

  <database name="CAD" engine="oracle">
    <driver class-name="oracle.jdbc.driver.OracleDriver"
            url="jdbc:oracle:thin:@localhost:1521:CAD?user=mbernie">
      <param name="password" value="pwd" />
    </driver>
   <mapping href="mapping.xml" />
  </database>

Then I altered the Test.java file's jdo configuration to reflect this change as
below:

        _jdo.setDatabaseName( "CAD" );

However  I'm still getting SQLExceptions when execute() is called on the
following OQLQuery

        productOql = db.getOQLQuery( "SELECT p FROM myapp.Product p WHERE id
=$1" );

I get SQLExceptions thrown and since I have no control over thie SQL generated
from the OQLQuery I'm stuck!
The following is produced - could anyone see immediate problems with this SQL?


SELECT
"PROD"."ID","PROD"."NAME","PROD"."PRICE","PROD"."GROUP_ID","PROD_DETAIL"."ID"
FROM "PROD","PROD_DETAIL" WHERE "PROD"."ID"="PROD_DETAIL"."PROD_ID"(+) AND
("PROD"."ID" = ?)
org.exolab.castor.jdo.PersistenceException: Nested error: java.sql.SQLException:
invalid arguments in call  org.exolab.castor.jdo.PersistenceException: Nested
error: java.sql.SQLException: invalid arguments in call      at
org.exolab.castor.jdo.engine.TransactionContextImpl.getConnection(TransactionContextImpl.java:207)




     at
org.exolab.castor.persist.TransactionContext.query(TransactionContext.java:616)
     at org.exolab.castor.jdo.engine.OQLQueryImpl.execute(OQLQueryImpl.java:457)
     at org.exolab.castor.jdo.engine.OQLQueryImpl.execute(OQLQueryImpl.java:404)
     at jdo.Test.run(Test.java:121) [mbernie]      at
jdo.Test.main(Test.java:56)



Many thanks once again,

Miles




To:   [EMAIL PROTECTED]
cc:     (bcc: Miles Bernie)
Date: 09/14/2001 07:41 AM
From: [EMAIL PROTECTED]
Subject:  Re: [castor-dev] Object to DB Example required




After a great deal of foul language I managed to get the example to run using a
MySQL database.  Here's what I had to do;

( I already had a MySQL server running but there was no 'test' database )

1. unzipped examples.zip into $CASTOR_HOME (wherever you've installed it -
c:\opt\castor-0.9.3 in my case)
2. copied mysql_jdbc.jar to the newly created examples/jdo directory
3. lots of problems with classpath settings but this finally worked;

c:\opt\castor-0.9.3\examples;c:\pub\apache\xalan\xalan.jar;c:\pub\exolab\castor\castor.jar;c:\pub\apache\xerces\xerces.jar;c:\pub\sun\j2ee


\j2ee.jar;c:\opt\sybase\jConnect\jconn2.jar;c:\opt\castor-0.9.3\examples\jdo\mysql_jdbc.jar



4. edited example.sh and deleted the line 'CLASSPATH=`echo *.jar | tr ' '
':'`:$CLASSPATH:.'
5. 'javac jdo/*.java' to compile
6. edited the jdo/create.sql file and deleted all the 'drop table ....'
statements
7. logged into MySQL and created a database called 'test' then logged out again
8. created all the required tables in test with 'cat create.sql |
/c/mysql/bin/mysql -u root -pmypassword test'
(Note; my os is NT but I use the Cygwin bash as I prefer Unix - hence the
forward slashes ;)
9. edited 'database.xml' to the following;

<database name="test" engine="mysql" >

  <driver class-name="org.gjt.mm.mysql.Driver"
          url="jdbc:mysql://localhost:3306/test">
    <param name="user" value="root" />
    <param name="password" value="mypassword" />
  </driver>

  <mapping href="mapping.xml" />

</database>


Finally ran the example from $CASTOR_HOME with ./example.sh jdo
That worked for me, hope it helps

Rob Pieper

-----Original Message-----
From: Will Sargent [mailto:[EMAIL PROTECTED]]
Sent: Friday, 14 September 2001 12:17 PM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] Object to DB Example required


I have to agree with you that the JDO example doesn't work right.

I refactored the code and kinda sorta got it working.  The code may not work
right, but it's at least easier to read.

Will.

> Hello,
>
> I can't get the jdo.Test example supplied to work at all.
>
> Can anyone recomend an alternative or a suitable tutorial.
>
> Many thanks,

-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
     unsubscribe castor-dev








*******************Internet Email Confidentiality Footer*******************


Privileged/Confidential Information may be contained in this message.  If you
are not the addressee indicated in this message (or responsible for delivery of
the message to such person), you may not copy or deliver this message to anyone.
In such case, you should destroy this message and kindly notify the sender by
reply email. Please advise immediately if you or your employer does not consent
to Internet email for messages of this kind.  Opinions, conclusions and other
information in this message that do not relate to the official business of my
firm shall be understood as neither given nor endorsed by it.

-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
     unsubscribe castor-dev








*******************Internet Email Confidentiality Footer*******************


Privileged/Confidential Information may be contained in this message.  If you
are not the addressee indicated in this message (or responsible for delivery of
the message to such person), you may not copy or deliver this message to anyone.
In such case, you should destroy this message and kindly notify the sender by
reply email. Please advise immediately if you or your employer does not consent
to Internet email for messages of this kind.  Opinions, conclusions and other
information in this message that do not relate to the official business of my
firm shall be understood as neither given nor endorsed by it.

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to