Sue Hunt

Ranch Hand
+ Follow
since Jan 26, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sue Hunt

Thanks Paul
so I could do this then...
!mainQuery.equals("q");
Cheers
Sue
15 years ago
Hi there.
Quick one I hope.
I'm trying to do a while loop, testing that a string is NOT equal to the user's input. I know how to do equals, but how would I do it for a not equal too.
As usually, I'm probably missing something right under my nose.
Cheers
Sue
15 years ago
Thanks for all your help.
This site is a lifesave, keep up the great work
Cheers
Sue
Keep forgetting to do that...re: posting the code again

Thanks
Sue
Sadanand
Thanks for your help. Found most of the little niggles, and the sql did work in access. Now, when I try running the program, it does output the various correct results.
It seems that the quit does stop the processing, however, when you select q, it will give you the close message, however, it then gives you the final catch message,
Problem accessing the database java.sql.SQLException: Invalid handle
Not sure how to get it so it doesn't print that line, when quit is selected.
Probably something glaringly obvious, but it's been over a week and almost 8 hours a day, trying to sort it out, and I'm brain dead...
Thanks again for the assistance.
Sue
[ May 05, 2004: Message edited by: Sue Hunt ]
Deep Bowing.
Thanks for pointing out the c in CreateStatement...should be createStatement. That now compiled.
I've added another try towards the end, before the catch statement.

It compiles nicely, and then it gives me the prompts, however, when I select C, it then gives me the choices of cars to pick from, when I pick BMW, it gives me this
Problem accessing the database java.sql.SQLException: [Microsfot][ODBC Microsoft Access Driver] The Microsoft Jet database enging cannot find the input table or query �Employee�. Make sure it exists and that its name is spelled correctly.
If I pick A, I get this error.
Problem accessing the database java.sql.SQLException: Column not found
If I pick B, it prompts me for the salary amount, and then I get this error.
Problem accessing the database java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.
If I pick Q, I get this error.
Problem accessing the database java.sql.SQLException: Invalid handle
(I'm not overly good at Access, either....)
You guys have patience of saints. I know I keep saying it, but you all help to keep me sane, and I really do appreciate it.
I'm wondering, although I mapped the ODBC to go to the folder that is holding the company database, I'm wondering if it should be in the same folder as the class.
Sue
Jeanne thanks for that.
I've managed to get it to compile and it's loading the connection to the database and I have set up the odbc connection in the control panel.
It's running through the program, prompting the user to input, however, I am unable to get it to return any value from the database.
Also, it doesn't like the line query=cn.createStatement(), however, if I comment it out, the program, does compile.

Really happy it's compiling...
Cheers
Sue
Hi all.
I have been staring at this for too long....
I've managed to get the errors down to 20...but the first couple I can't see what it doesn't like. It's telling me that it doesn't like my System.out.println statements. (Blake, i've started merging your bits and bobs in with mine, was finding it very useful.
Below is the large code. I've also thought, I should also try and do a mini program for console input, which is the second set of codes.

The next set of code, is working, well as much as it prompts the user and then prints the users choice, however, it doesn't seem to want to work through the if statements...

I feel I should try and take this week off work to get it sorted...
Thanks for your patience and understanding....
Sue
Blake
Thanks for that. Shall spend today, going through and setting it up in the manner you suggested. Was just trying to get as much down on paper yesterday as I could.
Hopefully, will be able to come back with more specific questions
Seems the tutor managed to get this all done in 40 lines....
This may seem like an off the wall question, but is it possible to create a display screen, where the user just gets to hit a button, i.e. no. of employee, ford, chrysler, salary over 15000, etc. Or would this just be a long winded way of doing it? Could it all be done within one class?
Cheers
Sue
OK, here we go...4 hours of coding...not compiling...basically just some ideas, thrown together....
We have 2 tables, within one database. Employee, Car, Company.mdb.
Have to prompt the user for 3 queries.
1. Give number of employees
2. List of employees earning over X amount.
3. List of employees who drive a make of car, choosen by the user.
4. Quit.
The query answer should be a single letter.
here it goes...don't be too rough now *grin*...I know you're not.

Thanks for any help...if anyone is willing to tread through this
Cheers
Sue
Thanks Jeanne
Once I put some codes down on paper, I'll be back.
Been told by the tutor, that there is to be only one class and one main method.....
Cheers
Sue
Hi All.
I'm in a muddle and not sure how to put all the pieces together. ( I have been through the sun java JDBC tutorial)
I need to produce ONE class, which will access an Access database, containing two tables. I know I need to create a JDBC/ODBC connection, then open the data base. I then need to open a screen, enabling the users to make multi queries (3), and the option to quit. Then their input will be used to do a sql query with the two tables to produce the result. The results will be displayed and the option for the user to conduct another query or to quit.
Now, I'm ok with sql queries, cuz I have done a few of them using ASP, so that's ok. Most of the programs I am using for inspiration, have all the different steps in different classes. I am unsure how to merge it all together. I think I know the various coding, so I'm not asking for that. Just not sure how to lay it all out.
Try not to laugh too much ok
Hope this makes sense.
Cheers
Sue
Thanks guys, shall take your hints, clues and comments on board.
Once I'm ready to start firing questions about my coding, I shall go to the JDBC forum.
Cheers
Sue
ps (see I'm trying not to leave it till the last minute again *grin*)
15 years ago
Hi All. Just wanted to say a big thanks for all the help you gave me during my last assignment. I happy to say, that with your help, I made an 86% on it.
Was wondering if you could point me in the right direction for the following, before I start attempting the coding.
1. Able to query 3 different questions to a MS Access relational database, containing 2 tables. Using a single class and the main method continually looping. (have a feeling that I will be loopy by the end of this *grin*).
2.Implementing business objects in a three-tier architecture (three-layer architecture) to access a database.
Thanks in advance for your help.
Cheers
Sue
15 years ago
Thanks Stan.
That seemed to have solved the Out of Bound error.
When I run the client, after starting the NumberServer, the following happens.
When I click on the Average Button, it may or may not come up with the average on the first click, it may select the largest, the smallest or the average. So by clicking on it 3 times, it rotates through the different possible answers.
The same happens if I click the Smallest Button or the Largest Button.
Any ideas?
Cheers
Sue
15 years ago