Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

Need to see full details

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How to see more details of error in Eclipse below?
6h.png
[Thumbnail for 6h.png]
 
Master Rancher
Posts: 4370
47
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hover the mouse pointer over the individual errors, or the little red 'x' in the margin.
Or open the Problems tab.
 
Ranch Hand
Posts: 66
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just from experience: you missing import java.sql package.
 
Peter Liang
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to all.
Christina,
I cannot add "java.sql" package.
 
Saloon Keeper
Posts: 5911
152
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you can. Why do you think otherwise?
 
Peter Liang
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See below
6i.png
[Thumbnail for 6i.png]
 
Tim Moores
Saloon Keeper
Posts: 5911
152
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.sql is a package, not a class. Do you know the difference between importing a class and importing a package?
 
Peter Liang
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, where to choose java.sql below?
6j.png
[Thumbnail for 6j.png]
 
Marshal
Posts: 66525
251
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

HuaMin chen wrote:Yes . . .

You mean no, you don't know how to import classes correctly. If you followed the suggestions Dave Tolls gave you, Eclipse would have given you the option of importing those classes from the explanation of the errors. Remind yourself of the different kinds of import from the JLS (=Java® Language Specification).
 
Peter Liang
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can I have full details to achieve this?
 
Dave Tolls
Master Rancher
Posts: 4370
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you compare it to the other import statements you will see that it is missing the class name to import.
You have just provided the package.
 
Peter Liang
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which is the class name?
 
Tim Moores
Saloon Keeper
Posts: 5911
152
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The reason you posted was because some class names were underlined red with an error, wasn't it?
 
Campbell Ritchie
Marshal
Posts: 66525
251
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

HuaMin chen wrote:Which is the class name?

Look at the class names underlined in red on Eclipse. There are four of them in the code you posted.
 
Tim Moores
Saloon Keeper
Posts: 5911
152
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:Remind yourself of the different kinds of import from the JLS (=Java® Language Specification).


Oracle's java Tutorial does a better at explaining it: https://docs.oracle.com/javase/tutorial/java/package/usepkgs.html
 
Campbell Ritchie
Marshal
Posts: 66525
251
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Moores wrote:. . . Oracle's java Tutorial does a better [job] . . .

Yes, it does, doesn't it.
 
Peter Liang
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone share the way to resolve issue below (of the codes)?
7b.png
[Thumbnail for 7b.png]
 
Marshal
Posts: 14476
240
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They already have. See the first reply by Dave Tolls.

We know that it can be a struggle to figure out some things when you are a beginner but honestly, it's also frustrating when you seem to be ignoring advice or not even trying. Here's another way: move the cursor to where the error is and press Ctrl+1 to activate Quick Fix. Then choose the import option.
 
Peter Liang
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry to that, I located cursor on error and press Ctr1+1 but it did not help.
 
Tim Moores
Saloon Keeper
Posts: 5911
152
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you read the page on the Java tutorial I linked to? If not, start with that. If yes, did you have questions about that? I'm guessing you must have, because otherwise you'd know everything that you need to know to solve the issue.
 
Peter Liang
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks
 
And will you succeed? Yes you will indeed! (98 and 3/4 % guaranteed) - Seuss. tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!