aspose file tools*
The moose likes JDBC and the fly likes java with jdbc Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "java with jdbc" Watch "java with jdbc" New topic
Author

java with jdbc

preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518
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

Joined: Jun 06, 2007
Posts: 2718
    
    6

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


SCJP, SCWCD.
|Asking Good Questions|
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40029
    
  28
. . . 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

Joined: Oct 04, 2007
Posts: 518
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

Joined: Jun 06, 2007
Posts: 2718
    
    6

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

Joined: Oct 13, 2005
Posts: 40029
    
  28
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

Joined: Jun 06, 2007
Posts: 2718
    
    6

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

Joined: Jun 06, 2007
Posts: 2718
    
    6

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

Joined: Oct 13, 2005
Posts: 40029
    
  28
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

Joined: Jun 06, 2007
Posts: 2718
    
    6

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java with jdbc