[ojb-users] [Fwd: Help with OBJ]
Brought to you by:
thma
|
From: Thomas M. <tho...@ho...> - 2002-06-16 07:06:10
|
-------- Original Message --------
Subject: Help with OBJ
Date: Fri, 14 Jun 2002 10:21:31 -0400
From: "Warmuz, Peter" <Pet...@ci...>
To: "'th...@us...'" <th...@us...>
Hi Thomas,
How are you? Through word of mouth and through great reviews I have heard
about the object/relational bridge. So I decided to that I just might use
it for my one of projects here at work. As not too many of us like to
playing with SQL statements. So.. off I went to explore the
object/relational bridge.
However, I'm having a problem and I'm hoping you could assist me.
I created a use case that is very similar to UCListAllProducts in the first
tutorial. Now I can connect to an Oracle database and receive all my
records(ie. products; in my scenario team group names). Now my Collection
variable gets populated with the information using the following syntax.
Collection allTeamCodes = broker.getCollectionByQuery(query);
All good up to this point;
So now I go into the while loop and try to extract the information
java.util.Iterator iter = allTeamCodes.iterator();
while (iter.hasNext())
{
System.out.println(iter.next());
}
And this is what happens:
The list of available team groups
java.sql.SQLException: ORA-00911: invalid character
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
at
oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)[ojb.broker.acc
esslayer.JdbcAccess] ERROR: SQLException during the execution of
materializeObject: ORA-00911: invalid character
ORA-00911: invalid character
at
oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:830)
at
oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2391)
at
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java
:2672)
at
oracle.jdbc.driver.OraclePreparedStatement.doScrollPstmtExecuteUpdate(Oracle
PreparedStatement.java:3989)
at
oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedState
ment.java:623)
at
oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatem
ent.java:527)
at
ojb.broker.accesslayer.JdbcAccess.materializeObject(JdbcAccess.java:349)
at
ojb.broker.singlevm.PersistenceBrokerImpl.getDBObject(PersistenceBrokerImpl.
java:1086)
at
ojb.broker.singlevm.PersistenceBrokerImpl.getObjectByIdentity(PersistenceBro
kerImpl.java:1204)
at
ojb.broker.accesslayer.IndirectionHandler.materializeSubject(IndirectionHand
ler.java:202)
at
ojb.broker.accesslayer.IndirectionHandler.getRealSubject(IndirectionHandler.
java:187)
at
ojb.broker.accesslayer.IndirectionHandler.invoke(IndirectionHandler.java:159
)
at $Proxy0.toString(Unknown Source)
at java.lang.String.valueOf(String.java:1947)
at java.io.PrintStream.print(PrintStream.java:426)
at java.io.PrintStream.println(PrintStream.java:563)
at survey.UCListAllTeamGroups.apply(UCListAllTeamGroups.java:23)
at survey.Application.run(Application.java:34)
at survey.Application.main(Application.java:27)
ojb.broker.PersistenceBrokerSQLException
at
ojb.broker.accesslayer.JdbcAccess.materializeObject(JdbcAccess.java:372)
at
ojb.broker.singlevm.PersistenceBrokerImpl.getDBObject(PersistenceBrokerImpl.
java:1086)[DEFAULT] ERROR: null
at
ojb.broker.singlevm.PersistenceBrokerImpl.getObjectByIdentity(PersistenceBro
kerImpl.java:1204)
at
ojb.broker.accesslayer.IndirectionHandler.materializeSubject(IndirectionHand
ler.java:202)
at
ojb.broker.accesslayer.IndirectionHandler.getRealSubject(IndirectionHandler.
java:187)
at
ojb.broker.accesslayer.IndirectionHandler.invoke(IndirectionHandler.java:159
)
at $Proxy0.toString(Unknown Source)
at java.lang.String.valueOf(String.java:1947)
at java.io.PrintStream.print(PrintStream.java:426)
at java.io.PrintStream.println(PrintStream.java:563)
at survey.UCListAllTeamGroups.apply(UCListAllTeamGroups.java:23)
at survey.Application.run(Application.java:34)
at survey.Application.main(Application.java:27)
ojb.broker.PersistenceBrokerSQLException
at
ojb.broker.accesslayer.JdbcAccess.materializeObject(JdbcAccess.java:372)
at
ojb.broker.singlevm.PersistenceBrokerImpl.getDBObject(PersistenceBrokerImpl.
java:1086)
at
ojb.broker.singlevm.PersistenceBrokerImpl.getObjectByIdentity(PersistenceBro
kerImpl.java:1204)
at
ojb.broker.accesslayer.IndirectionHandler.materializeSubject(IndirectionHand
ler.java:202)
at
ojb.broker.accesslayer.IndirectionHandler.getRealSubject(IndirectionHandler.
java:187)
at
ojb.broker.accesslayer.IndirectionHandler.invoke(IndirectionHandler.java:159
)
at $Proxy0.toString(Unknown Source)
at java.lang.String.valueOf(String.java:1947)
at java.io.PrintStream.print(PrintStream.java:426)
at java.io.PrintStream.println(PrintStream.java:563)
at survey.UCListAllTeamGroups.apply(UCListAllTeamGroups.java:23)
at survey.Application.run(Application.java:34)
at survey.Application.main(Application.java:27)
Now since I couldn't get out the information this why I try casting to my
TeamGroup class the iterator but this is what happens;
The list of available team groups
java.lang.ClassCastException: $Proxy0
at survey.UCListAllTeamGroups.apply(UCListAllTeamGroups.java:24)
at survey.Application.run(Application.java:34)
at survey.Application.main(Application.java:27)
So what's is the proxy that I need to use to cast my data?
Attached with this email is the source code that I am using. If you could
shed an light on this problem; this would be greatly appreciated! Thank you
<<OJB.properties>> <<repository.xml>> <<repository_internal.xml>>
<<repository_user.xml>> <<AbstractUseCase.java>> <<Application.java>>
<<TeamGroup.java>> <<UCListAllTeamGroups.java>> <<UseCase.java>>
____________________________________________________
Peter Warmuz
CPSE - PC Developer
Java/EJB/JSP/Unix/C++
pet...@ci... 750 Lawrence Avenue West
P: (416) 784-2355 East Building 3rd floor
F: (416) 784-7712 Toronto, ON M68 1B8
|