You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Propes, Barry L [GCG-NAOT]" <ba...@citigroup.com> on 2007/03/20 19:08:30 UTC

4.x series difference

Hello users,
 
A while back I had posted about running different versions on a desktop to see if it caused conflicts, created problems and so on.
 
The versions in question are 4.0.1 and 4.1.3. For a lengthy time, I had used 4.0.1 in my dev. environment and 4.1.3 on our production server, both of these servers in question being Win2K.
 
Several of you replied back and said there should be no problem, and while on version wouldn't do DBCP and the other would allow for it, there seems like little difference.
 
One thing that previously worked in both environments and now seems to not work ok is the structure of a Prepared Statement.
 
I'll create one like I always have, and now Oracle seems to see the semicolon ending the SQL statement as an illegal character, whereas before it did not.
 
I'm not saying or implying this is a Tomcat deal, but I wonder why it would work before and now suddenly would not.
 
Basic prepared statement might look like this:
 
   String prepquer = "UPDATE users_dev SET user_name = ?, USER_PASS = ?, USER_TIMSTMP = SYSDATE, USER_DBFLGAG = 0" +
   " WHERE user_name = ?;";
   PreparedStatement preps = connection.prepareStatement(prepquer);
 
The console now gives me this error, 
java.sql.SQLException: ORA-00911: invalid character.
 
I say now, this behavior actually started coincidentally after I started using 4.1.3 in my dev. environment.
 
If anyone can shed light on this here, feel free. Maybe I should address it in the Oracle forum, which I'll probably go ahead and do.
 
But if it's concretely not Tomcat, let me know that, too.
 
Thanks!

Re: 4.x series difference

Posted by Edmund Urbani <em...@liland.org>.
Propes, Barry L [GCG-NAOT] wrote:
> Hello users,
>  
> A while back I had posted about running different versions on a desktop to see if it caused conflicts, created problems and so on.
>  
> The versions in question are 4.0.1 and 4.1.3. For a lengthy time, I had used 4.0.1 in my dev. environment and 4.1.3 on our production server, both of these servers in question being Win2K.
>  
> Several of you replied back and said there should be no problem, and while on version wouldn't do DBCP and the other would allow for it, there seems like little difference.
>  
> One thing that previously worked in both environments and now seems to not work ok is the structure of a Prepared Statement.
>  
> I'll create one like I always have, and now Oracle seems to see the semicolon ending the SQL statement as an illegal character, whereas before it did not.
>  
> I'm not saying or implying this is a Tomcat deal, but I wonder why it would work before and now suddenly would not.
>  
> Basic prepared statement might look like this:
>  
>    String prepquer = "UPDATE users_dev SET user_name = ?, USER_PASS = ?, USER_TIMSTMP = SYSDATE, USER_DBFLGAG = 0" +
>    " WHERE user_name = ?;";
>    PreparedStatement preps = connection.prepareStatement(prepquer);
>  
> The console now gives me this error, 
> java.sql.SQLException: ORA-00911: invalid character.
>  
> I say now, this behavior actually started coincidentally after I started using 4.1.3 in my dev. environment.
>  
> If anyone can shed light on this here, feel free. Maybe I should address it in the Oracle forum, which I'll probably go ahead and do.
>  
> But if it's concretely not Tomcat, let me know that, too.
>  
> Thanks!
> 

Not sure whether this has anything to do with your problem, but I think it's odd 
that your SQL statement has a trailing semicolon. I never use semicolons with 
JDBC. So I thought maybe that's the "invalid character". ... not that this would 
explain why you get this error now and not earlier...

Cheers,
  Edmund

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: 4.x series difference

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Barry,

Propes, Barry L [GCG-NAOT] wrote:
> One thing that previously worked in both environments and now seems 
> to not work ok is the structure of a Prepared Statement.
> 
> I'll create one like I always have, and now Oracle seems to see the 
> semicolon ending the SQL statement as an illegal character, whereas 
> before it did not.

Have you upgraded your Oracle driver in the process?

I have never put semi-colons in any of my prepared statements, since
it's not actually part of the statement. Usually, the semi-colon is the
statement delimiter for a command-line interface. Since only a single
statement can be executed (right?) through a prepared statement, I would
just remove the semi-colon altogether, since it's not necessary (or even
correct?).

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGAEAj9CaO5/Lv0PARAsjsAJ0YEvRWS5yP2ZeXu4WQFAq1edXhBQCeMtJc
6kXOQpEcyg1XTHiymsgkS6s=
=qSr+
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org