• 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
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Need to see full details

 
Ranch Hand
Posts: 94
  • 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: 4700
49
  • 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.
 
Rancher
Posts: 144
9
  • 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: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to all.
Christina,
I cannot add "java.sql" package.
 
Saloon Keeper
Posts: 6633
161
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: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See below
6i.png
[Thumbnail for 6i.png]
 
Tim Moores
Saloon Keeper
Posts: 6633
161
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: 94
  • 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: 70654
288
  • 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: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can I have full details to achieve this?
 
Dave Tolls
Master Rancher
Posts: 4700
49
  • 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: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which is the class name?
 
Tim Moores
Saloon Keeper
Posts: 6633
161
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: 70654
288
  • 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: 6633
161
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: 70654
288
  • 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: 94
  • 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]
 
Sheriff
Posts: 15936
265
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: 94
  • 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: 6633
161
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: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic