FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Oracle with JAVA - Invalid Character





NewGuyinTown
executeQuery( "SELECT * FROM \"activity\";" )

returns "ORA-00911: invalid character (in oracle.jdbc.driver.DatabaseError)"

The code worked before with mySQL and I tried to make it portable with an Oracle database.

For some reason, quotations are treated as invalid characters when it is executed by JAVA.

However, I executed that query (without the "\") from the SQL Command Line, it works. Without the quotations, it return "tables or views does not exist" (different output from the output with quotations: no rows selected).

I don't know how to perform a query if quotations are forbidden...

Any advices/help appreciated.
shamil
Try executeQuery( "SELECT * FROM activity;" )
FunDa
Try
executeQuery( "SELECT * FROM \'activity\';" )
NewGuyinTown
shamil wrote:
Try executeQuery( "SELECT * FROM activity;" )


FunDa wrote:
Try
executeQuery( "SELECT * FROM \'activity\';" )


Both throws an Exception saying "tables or views does not exist" like the query in the SQL Command Line.
shamil
NewGuyinTown wrote:
shamil wrote:
Try executeQuery( "SELECT * FROM activity;" )


FunDa wrote:
Try
executeQuery( "SELECT * FROM \'activity\';" )


Both throws an Exception saying "tables or views does not exist" like the query in the SQL Command Line.
I forgot to remove semicolon. Remove semicolon and try again.
executeQuery( "SELECT * FROM activity" );
FunDa
FunDa wrote:
Try
executeQuery( "SELECT * FROM \'activity\';" )


I forgot that too ....

Try

Try
executeQuery( "SELECT * FROM \'activity\'\;" )
Related topics
Help with PhpBB
Java project coupling problems
[*RESOLVED*] Please close for me.
Database for Dentists
First version of Space.FRIH.net is live!!
Google Apps for Your Domain
How?:Check the occurance of a certain character in a string.
PHP email varification saying invalid email
Randomness is an illusion. [philosophy/science]
How to use Soap service with PL/SQL programming.?
PHP: fopen('./directory/$variable'); Problem
Email Validation
oracle sql Alter table from a triggered package procedure
Trying to learn Java
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.