• Post Reply Bookmark Topic Watch Topic
  • New Topic

Cannot figure out what is the return type for this case  RSS feed

 
tangara goh
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear expert,

I just learnt that we can do batch update for multiple SQL statement.

However, I am caught in a fix - cos in order for my multiple SQL to work my insertTutor method needs to change to String type....

I do not know what is the return type for this case ;



Hope someone can help me out.

Tks.
 
Carey Brown
Saloon Keeper
Posts: 3328
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First off, your class 'tutor' should begin with an upper case letter.
As for the return type, you are returning 't' which is of type 'tutor'.
You've cut off the last half of the method when you posted it. We have no way of knowing what types your other return(s) are attempting to return. Please post the entire method.
 
tangara goh
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Carey Brown wrote:First off, your class 'tutor' should begin with an upper case letter.
As for the return type, you are returning 't' which is of type 'tutor'.
You've cut off the last half of the method when you posted it. We have no way of knowing what types your other return(s) are attempting to return. Please post the entire method.


Hi Carey,

I did not truncate my method because that is what my method is all about.  And I am stuck at the return type cos what should I return ?


Cos initially the method is using void but void method would not allow me to use statement.addBatch(mgr.insertTutor(m4))

Yes, the tutor is my model I haven't refactor to use 'T'

 
tangara goh
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Carey Brown wrote:First off, your class 'tutor' should begin with an upper case letter.
As for the return type, you are returning 't' which is of type 'tutor'.
You've cut off the last half of the method when you posted it. We have no way of knowing what types your other return(s) are attempting to return. Please post the entire method.




Hope that it is more clear now.

 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tangara goh wrote:
I did not truncate my method because that is what my method is all about.  And I am stuck at the return type cos what should I return ?


Well, your method is declared to return a String object, so, I guess you should return a String object.  Or are you asking for which string object? If so, we can't answer that, since we don't know what your program is supposed to do, what the purpose of the method is, etc. etc. etc.

Henry
 
tangara goh
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry Wong wrote:
tangara goh wrote:
I did not truncate my method because that is what my method is all about.  And I am stuck at the return type cos what should I return ?


Well, your method is declared to return a String object, so, I guess you should return a String object.  Or are you asking for which string object? If so, we can't answer that, since we don't know what your program is supposed to do, what the purpose of the method is, etc. etc. etc.

Henry




Actually, this is just a Manager class that call the tutordao.insertTutotr(t) which is an interface that's all.

So, I managed to work out the return type....

However, my problem now is that the controller where I have my getParameters and setString etc is not working




Can someone advise me how do I addBatch() in this case....



 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!