Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java with jdbc

 
preethi Ayyappan
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I need to check a field loginflag in the table queue.According to the loginflag, i have to check 3 things.The first thing is if loginflag for all the users is 0,i should print "All our agents are logged off.try later".
second thing is if loginflag=1 for all the agents,message should be "All our agents are busy".The third thing is if the loginflag is 1 and the field callstatus is 0,the message should be "send the call to this logged user". How could i check this? please assist me.

Thanks.
 
Amit Ghorpade
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
first let us know how far have you done and where are you stuck.
Because here we dont Do your homework


Hope this helps
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
. . . and please edit your original post to Use A Meaningful Subject Line. Your post doesn't seem to be about "Java" nor about "JDBC." It is probably about "with," [ ] but that doesn't help people scanning the menu to work out which posts to read and reply to.
 
preethi Ayyappan
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.I have checked like this.but is there any query to check directly all the agents are busy?

[ June 02, 2008: Message edited by: preethi Ayyappan ]
 
Amit Ghorpade
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
first thing first, code tags wont work if your code is not indented.
and you can improve your code I think, but Campbell will not allow me to do that .
but your current code seems to do the work isn't it.
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Amit Ghorpade:

and you can improve your code I think, but Campbell will not allow me to do that
Cheeky so-and-so. You're nearly as bad as Rob Prime.



Agree with what you say; just having a quick look at the code, I think it will work. Please drop some hints about what would improve it, but I think the thread is now actually about JDBC, even though the subject is not at all informative.

So you will have to make further comments on the JDBC forum, where I shall move this thread!
 
Amit Ghorpade
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cheeky so-and-so. You're nearly as bad as Rob Prime.

Please don't take it personally. I only said so because you are one of the moderators and the Javaranch policy does not allow me to post homework code, that's why.


[ June 04, 2008: Message edited by: Amit Ghorpade ]
 
Amit Ghorpade
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And regarding the hint, I would like to suggest to improve the SQL query if she is good with database.
I am not aware of the database design she's using but I think the query she mentioned isn't optimal.


Hope this helps
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Amit Ghorpade:

Please don't take it personally.
Don't worry, I didn't. I presumed you were joking. ;)

I agree, now I have looked at it, that select * isn't optimal. Would you use a count()? Don't know; my SQL isn't that good.

Suggest the query is old enough that you can tell us the optimised version.
 
Amit Ghorpade
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Campbell for your presumption

and although count is on my mind, I think she should opt for a sub query so that the program overhead can be transferred to the database.
Now let her think a bit before me posting the code
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic