• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
sarah gri
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic