• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

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

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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");
}
 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic