public QueryTableModel() {
cache = new Vector();
new gsl.sql.driv.Driver();
}
its showing error on 3rd line as package gsl.sql.driv does not exist
Rob Prime wrote:True. Moving to Java in General.
As for the class, I haven't been able to find it. Where did you get that piece of code from?
Bill Hoke wrote: a. Go to: http://jdbc.postgresql.org/download/
download: jdbc7.0-1.1.jar
b. Actual file downloaded will be jdbc7.0-1.1.zip
unzip to a directory of your choice.
c. Copy these two files:
Driver.class
DriverClass.class
to the same directory where your
JAVA program is located.
b. JAVA Packaging:
First, I looked into JAVA packaging, having no prior experience with it, to
see if I could build some sort of package for these files to use in
my program with an 'Import' statement. Since there were so many
options I decided against it.
Next I looked for jar extraction programs to get 'inside' of the 'pgjdbc2.jar'
file. That appeared too complicated for me as well.
I also looked for JAVA class decompiling programs to see if I could
get 'inside' of the 'Driver.class' file. I decided against that as there was
a cost associated with the program and you might not get the key info
you are looking for.
But, I did learn and read about the meta information in the 'META-INF'
directory of 'jdbc7.0-1.1.jar(extracted)'. That is where I found the
information regarding:
org.postgresql.Driver();
The file \META-INF\MANIFEST.MF can be opened as a text file and shows:
Name: org/postgresql/Driver.class
Digest-Algorithms: SHA MD5
SHA-Digest: GsTAODvchjM/lcGlu/lTtYcHFlo=
MD5-Digest: bJDjpfFR3EoftUi7V+JV4Q==
and
Name: org/postgresql/DriverClass.class
Digest-Algorithms: SHA MD5
SHA-Digest: gF34WNw7QLEGCXn9rtEgf4IsaJo=
MD5-Digest: Qe+B6gzfDLRTcU6+SNOT+w==
I noticed the reference was similar to the problem line:
new gsl.sql.driv.Driver();
So I replaced the line with: org.postgresql.Driver();