Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem w JDBC and Oracle 8.1.7

0 views
Skip to first unread message

Michal Rutkowski

unread,
Aug 18, 2003, 6:35:32 AM8/18/03
to
Im connecting to Oracle 8.1.7 (running on a MS Windows Server) from a JBoss 2.4.10,
running on a Linux box. The code that generates the problem looks like this :

String query = "SELECT some_fields FROM some_table WHERE id = ?";
Prepared Statement ps = conn.prepareStatement(query);
ps.setString(1, id.toString());
ps.executeQuery(); // this throws the folowing exception

java.sql.SQLException: Zamkni?ta instrukcja
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:211)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:274)
at oracle.jdbc.driver.OracleStatement.ensureOpen(OracleStatement.java:49
35)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePrepar
edStatement.java:382)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePrepare
dStatement.java:339)
at org.jboss.pool.jdbc.PreparedStatementInPool.executeQuery(PreparedStat
ementInPool.java:71)

The connection is ok. The statement is not closed or anything. The syntax of the
syntax of the query is ok, because i tested it on the Oracle console. What is
strange, is that this exception is thrown only some times. What I mean is that
regardles of the id parameter, the execution of this query some times throws
an excpetion, and some times not, without any special patern.

I will be gratefull for all help

MIchal

--
GG : #2814355
e-mail : mailto:snoo...@wp.pl
fotoWWW : http://foto.natolin.net
bikeWWW : http://rowery.natolin.net (under construction)

Nathan Zumwalt

unread,
Aug 18, 2003, 9:15:07 AM8/18/03
to
Is is possible that something in the ID is messing up your SQL
statement? Maybe a reserved word is being passed in sometimes (which
is why the error occurs randomly).

-Nathan

Michal Rutkowski <mr18...@zodiac.mimuw.eduXXX.pl> wrote in message news:<slrnbk1avi....@zodiac.mimuw.edu.pl>...

Michal Rutkowski

unread,
Aug 18, 2003, 9:40:39 AM8/18/03
to
In article <521673fd.03081...@posting.google.com>, Nathan Zumwalt wrote:
> Is is possible that something in the ID is messing up your SQL
> statement? Maybe a reserved word is being passed in sometimes (which
> is why the error occurs randomly).

Well I think this is not the case either. I log all of these queries, and
checked them (cut & paste) on the console, they where ok. Also we checked the
alternative version :

ps.setLong(1, id); // now there can't be anything messing my query

but this didn't eliminate my problem.

michal

Giuseppe Briotti

unread,
Aug 19, 2003, 4:31:54 AM8/19/03
to

> > Is is possible that something in the ID is messing up your SQL
> > statement? Maybe a reserved word is being passed in sometimes (which
> > is why the error occurs randomly).
>
> Well I think this is not the case either. I log all of these queries, and
> checked them (cut & paste) on the console, they where ok. Also we checked
the
> alternative version :
>
> ps.setLong(1, id); // now there can't be anything messing my query
>

So, the query are correct on Oracle console and the error is random, I
suggest to check this:

1. try a simple java program, that send the statements by jdbc driver:
sometimes the drivers don't translate exactly your statement: I think on SQL
Server with statements LIKE 'B*' and LIKE 'B%'...

2. verify if it is the problem of multiple access and table lock (I don't
think so but, anyway...)

I hope this help...

Giuseppe

PS: tell me what was the problem! ;-) I'm interested about it, because I'll
must develope a new application based on Oracle JDBC dirver...


0 new messages