File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes JDBC THIN gives Oracle invalid character error, though SQL works fine  in TOAD Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC THIN gives Oracle invalid character error, though SQL works fine  in TOAD" Watch "JDBC THIN gives Oracle invalid character error, though SQL works fine  in TOAD" New topic
Author

JDBC THIN gives Oracle invalid character error, though SQL works fine in TOAD

sarah gri
Greenhorn

Joined: Jan 17, 2003
Posts: 2
Hi,
When I submit this code in Tomcat, get invalid character error, but when print statement to log and execute it in TOAD no problem; record inserts fine.
Thanks in advance for any help
Code
sarah gri
Greenhorn

Joined: Jan 17, 2003
Posts: 2
OOps - solved it myself - sorry!
I had to remove the final semicolon from the statement...
Code
[CODE]
try {
Statement stmt = conns.createStatement ();
String insert = "insert into SEQREQ_AUDIT (SEQREQ_AUDIT_ID, LABHEAD, PROGRAMME, LABJOURNAL, ORGANISM, TISSUE,";
insert=insert.concat("CELL_LINE, RDS1, RDS2, NTUSER, COUNTRY, DATE_CREATED, SSP, SEQ_SUBMISSION,FL_ID) ");
insert=insert.concat(" values ('"+SEQREQ_AUDIT_ID+"','"+LABHEAD+"','"+PROGRAMME+"','"+LABJOURNAL+"',");
insert=insert.concat("'"+ORGANISM+"','"+TISSUE+"','"+CELL_LINE+"','"+RDS1+"','"+RDS2+"','"+NTUSER+"',");
insert=insert.concat("'"+COUNTRY+"',SYSDATE,'"+SSP+"','"+SEQ_SUBMISSION+"','"+FL_ID+"')>;< this one!!!");
System.err.println("SQL insert: "+insert);
stmt.executeUpdate(insert);
}
catch (SQLException e){
e.getMessage();
System.err.println("Error-Insert record:" +e + e.getMessage());
message = ("ERROR - INSERT RECORD");
}
Mike Jeya
Ranch Hand

Joined: Apr 15, 2004
Posts: 54
I encountered the same problem..
I searched in so many forums..I couldnot find any soltion for this

I solved the problem thru JavaRanch..

Thank u guys and JAVA RANCH..

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC THIN gives Oracle invalid character error, though SQL works fine in TOAD
 
Similar Threads
Problem in inserting record to Oracle Database.
Error on Batch Update using Oracle
Weird SQL error.
Oracle JDBC Thin Client behaviour concerning date data types and it's format.
Question on JSTL SQL tag