• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

incompatible types

 
preethi Ayyappan
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am getting the following error when i run my code.

Gascon.java:64: incompatible types
found : int
required: java.sql.ResultSet
rs=st.executeUpdate("INSERT INTO `new` (`customernum`)VALUES( '"+ extension +"' )");

my code is

is the syntax of my query wrong?please help me

Thanks.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its your Java code that is wrong. executeUpdate returns an int, not a ResultSet.
 
preethi Ayyappan
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for you reply.Then could you tell me what query should i use here.
 
preethi Ayyappan
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for you reply.Then could you tell me what query should i use here.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is nothing wrong with your query. Its your Java code that is wrong.
 
preethi Ayyappan
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.I fixed the error
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic