• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

COUNT field incorrect or syntax error

 
Yohan Weerasinghe
Ranch Hand
Posts: 507
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

when I run my servlet, I am getting the error " java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error". My servlet, database table code and all the necessary things are below.


Form.html



SaveData.java



My database table is below



Following is my web.xml file




In my SaveData.java file, is I remove the comment symbol "//" it passes " Number Format Exception". When I put the comment line and run, it passes the previous error, which is bothering me (I guess NumberFormat Error also a part of it, at least I have seen that before but the NEW error is DANGEROUS!). Please help me. Thanks
 
Yohan Weerasinghe
Ranch Hand
Posts: 507
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apart from that I am using the same DATABASE under the SAME DSN in my NON SERVLET java applications. All are working fine without any error. I just checked this with my desktop and laptop with NetBeans and Manually, but no good
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the JDBC forum.
 
Miku Ranjan
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can you show here full stack trace error so it will easy to detect the error.
 
Yohan Weerasinghe
Ranch Hand
Posts: 507
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Moved to the JDBC forum.


Thanks for moving this thread Bear Bibeault . I really appreciate that.
 
Yohan Weerasinghe
Ranch Hand
Posts: 507
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Miku Ranjan wrote:Hi,
Can you show here full stack trace error so it will easy to detect the error.


Hi Miku,

Thanks a lot for trying to help me out, and I really appreciate it. Anyway my lecturer solved that out today. Here are the reasons for the error.

For the NumberFormat Exception error which comes out without any reasonable reason, the answer is, USE TRIM() METHOD WHEN YOU ARE CONVERTING THAT TO NUMERIC. Seems like it has lot of junk spaces, LOL.

For the SQL Exception error, the answer is, use SYSTEM DSN CONFIGURATION. DO NOT CREATE A NEW DSN, CONFIGURE THE SYSTEM DSN "SQL".


Thanks all of you for trying to help me out.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic