• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Packages and Import statements

 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm a little confused about where the class library files are kept and how to access them and their documentation. I�m looking at a .java file that has the following import statement (?and package declaration?):

package deqstpr;

import java.sql.*;

code is here�

I don�t have any problems finding the java.sql documentation in the API specification on Sun�s website. My problem with looking at documentation is with the deqstpr package.

I would also like to understand where these files are kept on my computer, or in this case on a database server (I think).

As with all of my posts, please point out ALL of my misconceptions (even if it�s not my direct question), thank you.
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There's no guarantee that there's documentation anywhere for any given Java class. Sun is careful to document everything and publish the documentation in well-known locations, but Joe Developer may not be.

All the package names that start with java or javax are from Sun and are documented in the JDK and on Sun's web site. Anything else (with the exceptions of some org.xml packages, and a few others) come from someplace else, and you have to consult the individual vendor for documentation.
 
Chris Staten
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply.

It's a little more comforting to know that there may not be any documentation with this code versus me just not knowing how to find it - although the latter may still be the case :\.

However, I'm still confused about two things from my post:

1) Where are these packages or libraries located?

2) What is the difference between the statements �package deqstpr;�, and �import java.sql.*;�? <==I don't think I actually asked this question in the original post.
 
Ernest Friedman-Hill
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sun's libraries -- the ones that come with the JDK itself -- are in *.jar files in the JDK distribution. Most them are in j2dskXXX/jre/lib/rt.jar . Other libraries are wherever they've been installed. There's an environment variable named CLASSPATH that's used to tell Java about places where libraries may be installed on your local system.

If you're looking at a "package" statement, then you're looking at source code. A library will be compiled from that source code, but the source isn't the library itself.

A "package" statement tells the Java compiler that the contents of a file should be put into the given package. An "import" statement tells the compiler about other packages that this file references.
 
Chris Staten
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you, thank you, thank you.
 
ice is for people that are not already cool. Chill with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic