Siyavuya Marete

Greenhorn
+ Follow
since May 10, 2018
Merit badge: grant badges
For More
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 Siyavuya Marete

The output i'm getting is null when running the application.
The output is supposed to be of the stocks from the database


so this is my code it compiles and runs but it does not produce the correct output. any idea why??
5 years ago
ok so i went back to the database and corrected the error for User but now i'm getting the same error but for UserStocks:Exception in thread "main" java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot find the input table or query 'UserStocks'.  Make sure it exists and that its name is spelled correctly.
I've gone back to the database where the table is created and there is no spelling error or anything i can see that is wrong , this is the code from the DB:



i'm completely lost any help will be appreciated
5 years ago


Hi guys so this is my code it compiles correctly but i receive an error when i run the application. The error is:
Exception in thread "main" java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot find the input table or query 'User'.  Make sure it exists and that its name is spelled correctly.
       at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6958)
       at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115)
       at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(JdbcOdbc.java:3111)
       at sun.jdbc.odbc.JdbcOdbcStatement.execute(JdbcOdbcStatement.java:338)
       at sun.jdbc.odbc.JdbcOdbcStatement.executeQuery(JdbcOdbcStatement.java:253)
       at UserQuery.main(UserQuery.java:27)
Press any key to continue . . .
5 years ago

Stephan van Hulst wrote:The problem is that when you open the file, an exception is thrown (probably because the file wasn't found), but then you catch the exception and continue with closeFile(), even though input is still set to null.

Why would you want to close the file if you didn't manage to open it in the first place?

Anyway, you need to start improving your code style, as we have mentioned in other topics. Your code will be easier to debug if you follow the tips we have given you.



Ah thank you after reading your explanation it took me 5 minutes to identify and fix the issue. My app is now running perfectly. Sorry about the coding style , i'm taking an intro course into Java and using a textbook that is ten years old
5 years ago
i'm so confused as to how to go about fixing this , i dont even know where to start.
I relocated the file to the correct directory and got it to run correctly but i cannot submit the application with my directory. What is the simplest way to get my App to work?
5 years ago
Thank you Campbell Ritchie you are my hero. I managed to get it to work perfectly muchos gracias
5 years ago


This is my code the application compiles and works but the count words button does not work. Any advice how to fix this problem? Any help will be greatly appreciated.
5 years ago


Hey guys so this is my code , it compiles correctly but when i try to run the application , i get this error message : Exception in thread "main" java.lang.NullPointerException
       at Stock.closeFile(Stock.java:105)
       at Stock.<init>(Stock.java:71)
       at Stock.main(Stock.java:35)

I spent a few hours trying to fix it but i'm completely stumped. Any help will be greatly appreciated
5 years ago
Thank you for pointing me in the right direction guys. It was a stupid thing to overlook , beginner problems . I managed to correct my mistake and got the application to work perfectly.
5 years ago

Campbell Ritchie wrote:Hahahahahahahahaha!
Unfortunately that doesn't teach you what the real problem was. Go back to the old image and work out the differences from the new image and see if you can find an explanation for your earlier problems.


I will do so sir thank you for your help and guidance.
5 years ago

Campbell Ritchie wrote:Where are you declaring the text box (line number, please)?
How are you adding it to the top‑level container (again, line number, please)? What layout does the container you are adding it to have? If border layout, are you adding anything else to that container? If flow layout, what are the sizes of the container and its child components? I don't like flow layout because of its propensity to change alignments when resized and because components can vanish if the container shrinks.



I added my JLabels and textboxes from Line 25 to 32. The rows are set out in flow layout(4,20). I've added the Jtextfields so i'm terribly confused as to why the textbook does not appear when i run the application.
5 years ago

Campbell Ritchie wrote:Well done Please show us what correction worked.



hahaha I simply got so frustrated I ended up just replacing the image with a new one and the program immediately started working
5 years ago


Hi guys so i have an issue with this program as the textbox to add information is missing. When i run the application , the whitebox to add information is missing.  I know there is a simple fix but i just cant see it at the moment . Any help will be greatly appreciated
5 years ago