Sponsored Content
Full Discussion: postgresql-jdbc on Suse
Operating Systems Linux SuSE postgresql-jdbc on Suse Post 83526 by marina on Thursday 15th of September 2005 02:32:04 PM
Old 09-15-2005
Error postgresql-jdbc on Suse

Hi,

I am writing a Java Swing application and want to add Embedded SQL to it. The application should interact with a PostgreSQL database running on my local machine. The compiler complains that it cannot find the org.postgresql package included in the code. I'm guessing the problem is that the classpath is not set properly. But when I try to add the postgresql-jdbc driver to the classpath using "export CLASSPATH=$CLASSPATH:/usr/share/pgsql/pg73b1jdbc1.jar", the program stops recognizing the other Java files it uses. How do I set the classpath up properly?

Code sample:

import java.awt.*;
import javax.swing*;
import java.sql.*;
import org.postgresql.*;

public class MyClass
{

public static void main (String [] args)
{
MyFrame frame = new MyFrame();
MyPanel panel = new MyPanel();

// more code here
}
}

MyClass.java:4: package org.postgresql does not exist
import org.postgresql.*;
^
1 error

Any help is much appreciated.
Marina.

Last edited by marina; 09-15-2005 at 04:40 PM..
 
jclassinfo(1)							       utils							     jclassinfo(1)

NAME
jclassinfo - Provides information for Java class files. SYNOPSIS
jclassinfo [option] {classname | filename} DESCRIPTION
jclassinfo reads a class file and provides all sorts of information about it. file can be - then jclassinfo reads a classfile from stan- dard input. OPTIONS
--help Output help information and exit. --version Output version information and exit. --bootclasspath=<path> The path used to search for VM bootstrap classes. --classpath=<path> The path used to search for the class if a class name is given. --xml Output xml (experimental). --all Prints all information for the class. --general-info Prints some general information about the class. --constant-pool Print constant pool. --visibility=<public | package | protected | private | synthetic> The visibility to use when printing class fields/methods. --fields Print fields. --methods Print methods. --disasm Enable code disassembly for methods (if compiled with disassembly support). --verbose Show exception table and max stack and max locals for methods. --method-debug-info Show line numbers and local variables for methods. --attributes Print class attributes. --packages Print packages referenced. --classes Print classes/interfaces referenced. --methods-ref Print methods referenced. --find-class {classname} Find the file(s) that contains the given class(es). --recursive Scan dependencies recursively. --quiet Supress status messages. FILES
No configuration files for the time being. ENVIRONMENT
CLASSPATH is used to find classes if a class name is given instead of the filename. The --classpath option can be used to override this. JAVA_HOME is used to find the default bootstrap classpath. The default bootstrap classes are assumed to be in JAVA_HOME/jre/lib/rt.jar. The --bootclasspath option can be used to override this. EXAMPLES
To see what packages a class uses: jclassinfo --packages /usr/share/java/MyClass.class To see what packages the classes in myproject folder use: jclassinfo --packages myproject/*.class AUTHORS
Nicos Panayides <anarxia@gmx.net> REPORTING BUGS
Report bugs in http://sourceforge.net/tracker/?group_id=74004&atid=539646 SEE ALSO
javap(1), jcf-dump(1) jclassinfo 0.19 jclassinfo(1)
All times are GMT -4. The time now is 04:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy