It's not a secret anymore!*
The moose likes Beginning Java and the fly likes  illegal charactor...(i got it) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark " illegal charactor...(i got it)" Watch " illegal charactor...(i got it)" New topic
Author

illegal charactor...(i got it)

divid ordo
Greenhorn

Joined: Jan 28, 2005
Posts: 1
yes,i got it. because i used a ideographic space,so ...
thank you all .

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>==
it's not spelling error,in the Productionservlet(servlet) ,i create an object for class Production
just like : Production p=new Production(); int count=p.doInsert(myCon,id);
and method doInsert() in the Production ;
there are some variable like "status","cement_Product"...in Producton.

***************************************************
...
public int doInsert(Connection myCon, int id){
...
sql=" insert into production(status,cement_Product...) values('"+this.status+"','"+this.cement_Production+"'...);
...
int count=mySta.executeUpdate(sql); ....
return count;
}
***************************************************
after javac ,it shows the error:: 'illegal charactor'
in front of the "sql"

ofcourse , constructed function :
public Production(){
this.value=myRes.getInt("status");
this.cement_Production=myRes.getString("cement_Production");
...
****************************************************
and variable's spelling is do right
hello, can anyone give me some advice
thx.

[ January 29, 2005: Message edited by: divid ordo ]
[ January 29, 2005: Message edited by: divid ordo ]
Damanjit Kaur
Ranch Hand

Joined: Oct 18, 2004
Posts: 346
sql=" insert into production(status,cement_Product...) values('"+this.status+"','"+this.cement_Production+"'...);


Check this statement again for proper placement of " and '.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

...or start using a PreparedStatement.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
David Harkness
Ranch Hand

Joined: Aug 07, 2003
Posts: 1646
Originally posted by divid ordo:
after javac ,it shows the error:: 'illegal charactor'
in front of the "sql"
Since this is a javac error and not a SQLException, I think it's something different. But since you pasted only portions of the method -- specifically you omitted the very spot where the error occurs -- there's no way to tell for sure.

The error is in the "..." right before "sql=..." Do you declare what type sql is? Is the line before it correctly terminated with a semi-colon or does it have some other syntax error?

Try again, and if you can't figure it out, post at least five lines of context around the javac error and the real output from javac, including the error, the line it displays, and the ^ showing where it thinks the error is.

Now, it's possible I misunderstood "after javac it shows the error:: 'illegal charactor' in front of the sql", but if I am and you're getting a SQLException, I don't know how it could possibly know that the variable name is "sql". Again, you're making us guess.

Take a look at the FAQ and How to Ask Questions the Smart Way.
 
jQuery in Action, 2nd edition
 
subject: illegal charactor...(i got it)
 
Similar Threads
to enter Date in Oracle from Servlets
reading data from jsp page to another jsp page using request.getParameter
No. of rows in a table
illegal start of expression
threads