Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 0FD4A9FA5FE for ; Mon, 27 Nov 2006 04:43:34 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 54695-03 for ; Mon, 27 Nov 2006 04:43:23 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from qb-out-0506.google.com (qb-out-0506.google.com [72.14.204.233]) by postgresql.org (Postfix) with ESMTP id DB3D69FA23F for ; Mon, 27 Nov 2006 04:43:25 -0400 (AST) Received: by qb-out-0506.google.com with SMTP id e21so1046481qba for ; Mon, 27 Nov 2006 00:43:24 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=i4CansHZG4ZquPn4xAqNKH1Kznlqv09riVsVKskkttEvHV8T1yW7yCarz/MPqmgadCwDm31H/sger3gGHVw+G7DaQMbdtICMRX3I5qZBYVxj91NbTGO67ktOM6r7IlunoY8fviqhhWfOwZNiH69mghFKtCVajfS7qEtOEPKppUk= Received: by 10.90.94.2 with SMTP id r2mr9498353agb.1164617004129; Mon, 27 Nov 2006 00:43:24 -0800 (PST) Received: by 10.90.86.1 with HTTP; Mon, 27 Nov 2006 00:43:23 -0800 (PST) Message-ID: <9bc001470611270043p36c00a1eu89754a46e26c58f3@mail.gmail.com> Date: Mon, 27 Nov 2006 18:43:24 +1000 From: "Greg Peters" To: pgsql-jdbc@postgresql.org Subject: Re: Exception Error - Please help I've tried everything! In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_134814_30824988.1164617004053" References: <9bc001470611252348l5fd9f93fx2c1a0d45b2c082bb@mail.gmail.com> <883e44790611260746h5b75162eue52207ee6505e2a7@mail.gmail.com> <9bc001470611261521m6c8d2f6nec6cb8b6726385d8@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=BAYES_50, HTML_MESSAGE, SPF_PASS X-Spam-Level: X-Archive-Number: 200611/129 X-Sequence-Number: 16171 ------=_Part_134814_30824988.1164617004053 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline OK. This is driving me crazy. I have the postgresql.jar file in the same directory. This is my directory listing: C:\Documents and Settings\java\GregScratch\src>dir Volume in drive C has no label. Volume Serial Number is B468-3FBB Directory of C:\Documents and Settings\java\GregScratch\src 27/11/2006 06:25 PM . 27/11/2006 06:25 PM .. 26/11/2006 10:36 PM 726 CheckString.java 24/11/2006 11:51 PM 140 helloworldapp.java 26/11/2006 05:11 PM 402,906 postgresql.jar 27/11/2006 06:25 PM 1,179 PostgresqlClient.class 27/11/2006 06:25 PM 545 PostgresqlClient.java 26/11/2006 02:49 PM 617 SetPoints.java 26/11/2006 01:44 AM 641 VolcanoApplication.java 26/11/2006 01:44 AM 432 VolcanoRobot.java 8 File(s) 407,186 bytes 2 Dir(s) 165,819,129,856 bytes free C:\Documents and Settings\java\GregScratch\src> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ I tried running: jar tf postgresql.jar and got: C:\Documents and Settings\java\GregScratch\src>jar tf postgresql.jar META-INF/ META-INF/MANIFEST.MF org/ org/postgresql/ org/postgresql/Driver$1.class org/postgresql/Driver$ConnectThread.class org/postgresql/Driver.class org/postgresql/PGConnection.class org/postgresql/PGNotification.class org/postgresql/PGRefCursorResultSet.class org/postgresql/PGResultSetMetaData.class org/postgresql/PGStatement.class org/postgresql/core/ org/postgresql/core/BaseConnection.class org/postgresql/core/BaseResultSet.class org/postgresql/core/BaseStatement.class org/postgresql/core/ConnectionFactory.class org/postgresql/core/Encoding.class org/postgresql/core/Field.class org/postgresql/core/Notification.class org/postgresql/core/Oid.class org/postgresql/core/PGBindException.class org/postgresql/core/PGStream$1.class org/postgresql/core/PGStream.class org/postgresql/core/ParameterList.class org/postgresql/core/ProtocolConnection.class org/postgresql/core/Query.class org/postgresql/core/QueryExecutor.class org/postgresql/core/ResultCursor.class org/postgresql/core/ResultHandler.class org/postgresql/core/UTF8Encoding.class org/postgresql/core/Utils.class org/postgresql/core/types/ org/postgresql/core/types/PGBigDecimal.class org/postgresql/core/types/PGBoolean.class org/postgresql/core/types/PGByte.class org/postgresql/core/types/PGDouble.class org/postgresql/core/types/PGFloat.class org/postgresql/core/types/PGInteger.class org/postgresql/core/types/PGLong.class org/postgresql/core/types/PGNumber.class org/postgresql/core/types/PGShort.class org/postgresql/core/types/PGString.class org/postgresql/core/types/PGType.class org/postgresql/core/types/PGUnknown.class org/postgresql/core/v2/ org/postgresql/core/v2/ConnectionFactoryImpl$SimpleResultHandler.class org/postgresql/core/v2/ConnectionFactoryImpl.class org/postgresql/core/v2/FastpathParameterList.class org/postgresql/core/v2/ProtocolConnectionImpl.class org/postgresql/core/v2/QueryExecutorImpl$1.class org/postgresql/core/v2/QueryExecutorImpl$2.class org/postgresql/core/v2/QueryExecutorImpl$3.class org/postgresql/core/v2/QueryExecutorImpl.class org/postgresql/core/v2/SimpleParameterList.class org/postgresql/core/v2/V2Query.class org/postgresql/core/v3/ org/postgresql/core/v3/CompositeParameterList.class org/postgresql/core/v3/CompositeQuery.class org/postgresql/core/v3/ConnectionFactoryImpl$1.class org/postgresql/core/v3/ConnectionFactoryImpl$UnsupportedProtocolException.class org/postgresql/core/v3/ConnectionFactoryImpl.class org/postgresql/core/v3/Portal.class org/postgresql/core/v3/ProtocolConnectionImpl.class org/postgresql/core/v3/QueryExecutorImpl$1.class org/postgresql/core/v3/QueryExecutorImpl$2.class org/postgresql/core/v3/QueryExecutorImpl$3.class org/postgresql/core/v3/QueryExecutorImpl$ErrorTrackingResultHandler.class org/postgresql/core/v3/QueryExecutorImpl.class org/postgresql/core/v3/SimpleParameterList.class org/postgresql/core/v3/SimpleQuery.class org/postgresql/core/v3/V3ParameterList.class org/postgresql/core/v3/V3Query.class org/postgresql/ds/ org/postgresql/ds/PGConnectionPoolDataSource.class org/postgresql/ds/PGPoolingDataSource$1.class org/postgresql/ds/PGPoolingDataSource.class org/postgresql/ds/PGSimpleDataSource.class org/postgresql/ds/common/ org/postgresql/ds/common/BaseDataSource.class org/postgresql/ds/common/PGObjectFactory.class org/postgresql/ds/common/PooledConnectionImpl$ConnectionHandler.class org/postgresql/ds/common/PooledConnectionImpl$StatementHandler.class org/postgresql/ds/common/PooledConnectionImpl.class org/postgresql/fastpath/ org/postgresql/fastpath/Fastpath.class org/postgresql/fastpath/FastpathArg.class org/postgresql/geometric/ org/postgresql/geometric/PGbox.class org/postgresql/geometric/PGcircle.class org/postgresql/geometric/PGline.class org/postgresql/geometric/PGlseg.class org/postgresql/geometric/PGpath.class org/postgresql/geometric/PGpoint.class org/postgresql/geometric/PGpolygon.class org/postgresql/jdbc2/ org/postgresql/jdbc2/AbstractJdbc2Array.class org/postgresql/jdbc2/AbstractJdbc2Blob.class org/postgresql/jdbc2/AbstractJdbc2BlobClob$LOIterator.class org/postgresql/jdbc2/AbstractJdbc2BlobClob.class org/postgresql/jdbc2/AbstractJdbc2Clob.class org/postgresql/jdbc2/AbstractJdbc2Connection$1.class org/postgresql/jdbc2/AbstractJdbc2Connection$TransactionCommandHandler.class org/postgresql/jdbc2/AbstractJdbc2Connection.class org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.class org/postgresql/jdbc2/AbstractJdbc2ResultSet$CursorResultHandler.class org/postgresql/jdbc2/AbstractJdbc2ResultSet$NullObject.class org/postgresql/jdbc2/AbstractJdbc2ResultSet$PrimaryKey.class org/postgresql/jdbc2/AbstractJdbc2ResultSet.class org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.class org/postgresql/jdbc2/AbstractJdbc2Statement$BatchResultHandler.class org/postgresql/jdbc2/AbstractJdbc2Statement$StatementResultHandler.class org/postgresql/jdbc2/AbstractJdbc2Statement.class org/postgresql/jdbc2/EscapedFunctions.class org/postgresql/jdbc2/ResultWrapper.class org/postgresql/jdbc2/TimestampUtils$1.class org/postgresql/jdbc2/TimestampUtils$ParsedTimestamp.class org/postgresql/jdbc2/TimestampUtils.class org/postgresql/jdbc2/TypeInfoCache.class org/postgresql/jdbc2/optional/ org/postgresql/jdbc2/optional/ConnectionPool.class org/postgresql/jdbc2/optional/PoolingDataSource.class org/postgresql/jdbc2/optional/SimpleDataSource.class org/postgresql/jdbc3/ org/postgresql/jdbc3/AbstractJdbc3Blob.class org/postgresql/jdbc3/AbstractJdbc3Clob.class org/postgresql/jdbc3/AbstractJdbc3Connection.class org/postgresql/jdbc3/AbstractJdbc3DatabaseMetaData.class org/postgresql/jdbc3/AbstractJdbc3ResultSet.class org/postgresql/jdbc3/AbstractJdbc3Statement.class org/postgresql/jdbc3/Jdbc3Array.class org/postgresql/jdbc3/Jdbc3Blob.class org/postgresql/jdbc3/Jdbc3CallableStatement.class org/postgresql/jdbc3/Jdbc3Clob.class org/postgresql/jdbc3/Jdbc3Connection.class org/postgresql/jdbc3/Jdbc3ConnectionPool.class org/postgresql/jdbc3/Jdbc3DatabaseMetaData.class org/postgresql/jdbc3/Jdbc3PoolingDataSource.class org/postgresql/jdbc3/Jdbc3PreparedStatement.class org/postgresql/jdbc3/Jdbc3ResultSet.class org/postgresql/jdbc3/Jdbc3ResultSetMetaData.class org/postgresql/jdbc3/Jdbc3SimpleDataSource.class org/postgresql/jdbc3/Jdbc3Statement.class org/postgresql/jdbc3/PSQLParameterMetaData.class org/postgresql/jdbc3/PSQLSavepoint.class org/postgresql/largeobject/ org/postgresql/largeobject/BlobInputStream.class org/postgresql/largeobject/BlobOutputStream.class org/postgresql/largeobject/LargeObject.class org/postgresql/largeobject/LargeObjectManager.class org/postgresql/ssl/ org/postgresql/ssl/MakeSSL.class org/postgresql/ssl/NonValidatingFactory$NonValidatingTM.class org/postgresql/ssl/NonValidatingFactory.class org/postgresql/ssl/WrappedFactory.class org/postgresql/util/ org/postgresql/util/Base64.class org/postgresql/util/GT.class org/postgresql/util/MD5Digest.class org/postgresql/util/PGInterval.class org/postgresql/util/PGbytea.class org/postgresql/util/PGmoney.class org/postgresql/util/PGobject.class org/postgresql/util/PGtokenizer.class org/postgresql/util/PSQLDriverVersion.class org/postgresql/util/PSQLException.class org/postgresql/util/PSQLState.class org/postgresql/util/PSQLWarning.class org/postgresql/util/ServerErrorMessage.class org/postgresql/util/StreamWrapper.class org/postgresql/util/UnixCrypt.class org/postgresql/xa/ org/postgresql/xa/PGXAConnection.class org/postgresql/xa/PGXADataSource.class org/postgresql/xa/PGXAException.class org/postgresql/xa/RecoveredXid.class org/postgresql/translation/ org/postgresql/translation/messages_cs.class org/postgresql/translation/messages_de.class org/postgresql/translation/messages_es.class org/postgresql/translation/messages_fr.class org/postgresql/translation/messages_it.class org/postgresql/translation/messages_nl.class org/postgresql/translation/messages_pl.class org/postgresql/translation/messages_pt_BR.class org/postgresql/translation/messages_ru.class org/postgresql/translation/messages_tr.class org/postgresql/translation/messages_zh_CN.class org/postgresql/translation/messages_zh_TW.class +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ This is PostgressqlClient.java as it currently stands: import java.sql.*; public class PostgresqlClient{ public static void main(String[] Arguments) throws ClassNotFoundException, SQLException{ String driver = "org.postgresql.Driver"; String url ="jdbc:postgresql:CSG"; String user = "root"; String pwd = "password"; Class.forName(driver); Connection con = DriverManager.getConnection(url, user, pwd); System.err.println("Connection complete"); con.close(); } } ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ This is some of the commands I have tried and their results: C:\Documents and Settings\java\GregScratch\src>java -cp postgresql.jar:. PostgresqlClient.class Exception in thread "main" java.lang.NoClassDefFoundError: PostgresqlClient/class C:\Documents and Settings\java\GregScratch\src>java -cp postgresql.jar:. PostgresqlClient.class Exception in thread "main" java.lang.NoClassDefFoundError: PostgresqlClient/class C:\Documents and Settings\java\GregScratch\src>java -cp postgresql.jar. PostgresqlClient.class Exception in thread "main" java.lang.NoClassDefFoundError: PostgresqlClient/class C:\Documents and Settings\java\GregScratch\src>java -cp postgresql.jar PostgresqlClient.class Exception in thread "main" java.lang.NoClassDefFoundError: PostgresqlClient/class C:\Documents and Settings\java\GregScratch\src>java -cp postgresql.jarPostgresqlClient Exception in thread "main" java.lang.NoClassDefFoundError: PostgresqlClient C:\Documents and Settings\java\GregScratch\src>java -cp postgresql.jar:. PostgresqlClient Exception in thread "main" java.lang.NoClassDefFoundError: PostgresqlClient C:\Documents and Settings\java\GregScratch\src> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ This is what NB says (and I think I have added the module correctly): Exception in thread "main" java.lang.ClassNotFoundException: org.postgresql.Driver at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:164) at PostgresqlClient.main(PostgresqlClient.java:12) Java Result: 1 BUILD SUCCESSFUL (total time: 0 seconds) Any ideas???? I have tried several versions of the postgresql module from the website too. Cheers, Greg. ------=_Part_134814_30824988.1164617004053 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
OK. This is driving me crazy. I have the postgresql.jar file in the same directory. This is my directory listing:


C:\Documents and Settings\java\GregScratch\src>dir
 Volume in drive C has no label.
 Volume Serial Number is B468-3FBB

 Directory of C:\Documents and Settings\java\GregScratch\src

27/11/2006  06:25 PM    <DIR>          .
27/11/2006  06:25 PM    <DIR>          ..
26/11/2006  10:36 PM               726 CheckString.java
24/11/2006  11:51 PM               140 helloworldapp.java
26/11/2006  05:11 PM           402,906 postgresql.jar
27/11/2006  06:25 PM             1,179 PostgresqlClient.class
27/11/2006  06:25 PM               545 PostgresqlClient.java
26/11/2006  02:49 PM               617 SetPoints.java
26/11/2006  01:44 AM               641 VolcanoApplication.java
26/11/2006  01:44 AM               432 VolcanoRobot.java
               8 File(s)        407,186 bytes
               2 Dir(s)  165,819,129,856 bytes free

C:\Documents and Settings\java\GregScratch\src>

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

 I tried running:
 
jar tf postgresql.jar
 
and got:

C:\Documents and Settings\java\GregScratch\src>jar tf postgresql.jar
META-INF/
META-INF/MANIFEST.MF
org/
org/postgresql/
org/postgresql/Driver$1.class
org/postgresql/Driver$ConnectThread.class
org/postgresql/Driver.class
org/postgresql/PGConnection.class
org/postgresql/PGNotification.class
org/postgresql/PGRefCursorResultSet.class
org/postgresql/PGResultSetMetaData.class
org/postgresql/PGStatement.class
org/postgresql/core/
org/postgresql/core/BaseConnection.class
org/postgresql/core/BaseResultSet.class
org/postgresql/core/BaseStatement.class
org/postgresql/core/ConnectionFactory.class
org/postgresql/core/Encoding.class
org/postgresql/core/Field.class
org/postgresql/core/Notification.class
org/postgresql/core/Oid.class
org/postgresql/core/PGBindException.class
org/postgresql/core/PGStream$1.class
org/postgresql/core/PGStream.class
org/postgresql/core/ParameterList.class
org/postgresql/core/ProtocolConnection.class
org/postgresql/core/Query.class
org/postgresql/core/QueryExecutor.class
org/postgresql/core/ResultCursor.class
org/postgresql/core/ResultHandler.class
org/postgresql/core/UTF8Encoding.class
org/postgresql/core/Utils.class
org/postgresql/core/types/
org/postgresql/core/types/PGBigDecimal.class
org/postgresql/core/types/PGBoolean.class
org/postgresql/core/types/PGByte.class
org/postgresql/core/types/PGDouble.class
org/postgresql/core/types/PGFloat.class
org/postgresql/core/types/PGInteger.class
org/postgresql/core/types/PGLong.class
org/postgresql/core/types/PGNumber.class
org/postgresql/core/types/PGShort.class
org/postgresql/core/types/PGString.class
org/postgresql/core/types/PGType.class
org/postgresql/core/types/PGUnknown.class
org/postgresql/core/v2/
org/postgresql/core/v2/ConnectionFactoryImpl$SimpleResultHandler.class
org/postgresql/core/v2/ConnectionFactoryImpl.class
org/postgresql/core/v2/FastpathParameterList.class
org/postgresql/core/v2/ProtocolConnectionImpl.class
org/postgresql/core/v2/QueryExecutorImpl$1.class
org/postgresql/core/v2/QueryExecutorImpl$2.class
org/postgresql/core/v2/QueryExecutorImpl$3.class
org/postgresql/core/v2/QueryExecutorImpl.class
org/postgresql/core/v2/SimpleParameterList.class
org/postgresql/core/v2/V2Query.class
org/postgresql/core/v3/
org/postgresql/core/v3/CompositeParameterList.class
org/postgresql/core/v3/CompositeQuery.class
org/postgresql/core/v3/ConnectionFactoryImpl$1.class
org/postgresql/core/v3/ConnectionFactoryImpl$UnsupportedProtocolException.class
org/postgresql/core/v3/ConnectionFactoryImpl.class
org/postgresql/core/v3/Portal.class
org/postgresql/core/v3/ProtocolConnectionImpl.class
org/postgresql/core/v3/QueryExecutorImpl$1.class
org/postgresql/core/v3/QueryExecutorImpl$2.class
org/postgresql/core/v3/QueryExecutorImpl$3.class
org/postgresql/core/v3/QueryExecutorImpl$ErrorTrackingResultHandler.class
org/postgresql/core/v3/QueryExecutorImpl.class
org/postgresql/core/v3/SimpleParameterList.class
org/postgresql/core/v3/SimpleQuery.class
org/postgresql/core/v3/V3ParameterList.class
org/postgresql/core/v3/V3Query.class
org/postgresql/ds/
org/postgresql/ds/PGConnectionPoolDataSource.class
org/postgresql/ds/PGPoolingDataSource$1.class
org/postgresql/ds/PGPoolingDataSource.class
org/postgresql/ds/PGSimpleDataSource.class
org/postgresql/ds/common/
org/postgresql/ds/common/BaseDataSource.class
org/postgresql/ds/common/PGObjectFactory.class
org/postgresql/ds/common/PooledConnectionImpl$ConnectionHandler.class
org/postgresql/ds/common/PooledConnectionImpl$StatementHandler.class
org/postgresql/ds/common/PooledConnectionImpl.class
org/postgresql/fastpath/
org/postgresql/fastpath/Fastpath.class
org/postgresql/fastpath/FastpathArg.class
org/postgresql/geometric/
org/postgresql/geometric/PGbox.class
org/postgresql/geometric/PGcircle.class
org/postgresql/geometric/PGline.class
org/postgresql/geometric/PGlseg.class
org/postgresql/geometric/PGpath.class
org/postgresql/geometric/PGpoint.class
org/postgresql/geometric/PGpolygon.class
org/postgresql/jdbc2/
org/postgresql/jdbc2/AbstractJdbc2Array.class
org/postgresql/jdbc2/AbstractJdbc2Blob.class
org/postgresql/jdbc2/AbstractJdbc2BlobClob$LOIterator.class
org/postgresql/jdbc2/AbstractJdbc2BlobClob.class
org/postgresql/jdbc2/AbstractJdbc2Clob.class
org/postgresql/jdbc2/AbstractJdbc2Connection$1.class
org/postgresql/jdbc2/AbstractJdbc2Connection$TransactionCommandHandler.class
org/postgresql/jdbc2/AbstractJdbc2Connection.class
org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.class
org/postgresql/jdbc2/AbstractJdbc2ResultSet$CursorResultHandler.class
org/postgresql/jdbc2/AbstractJdbc2ResultSet$NullObject.class
org/postgresql/jdbc2/AbstractJdbc2ResultSet$PrimaryKey.class
org/postgresql/jdbc2/AbstractJdbc2ResultSet.class
org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.class
org/postgresql/jdbc2/AbstractJdbc2Statement$BatchResultHandler.class
org/postgresql/jdbc2/AbstractJdbc2Statement$StatementResultHandler.class
org/postgresql/jdbc2/AbstractJdbc2Statement.class
org/postgresql/jdbc2/EscapedFunctions.class
org/postgresql/jdbc2/ResultWrapper.class
org/postgresql/jdbc2/TimestampUtils$1.class
org/postgresql/jdbc2/TimestampUtils$ParsedTimestamp.class
org/postgresql/jdbc2/TimestampUtils.class
org/postgresql/jdbc2/TypeInfoCache.class
org/postgresql/jdbc2/optional/
org/postgresql/jdbc2/optional/ConnectionPool.class
org/postgresql/jdbc2/optional/PoolingDataSource.class
org/postgresql/jdbc2/optional/SimpleDataSource.class
org/postgresql/jdbc3/
org/postgresql/jdbc3/AbstractJdbc3Blob.class
org/postgresql/jdbc3/AbstractJdbc3Clob.class
org/postgresql/jdbc3/AbstractJdbc3Connection.class
org/postgresql/jdbc3/AbstractJdbc3DatabaseMetaData.class
org/postgresql/jdbc3/AbstractJdbc3ResultSet.class
org/postgresql/jdbc3/AbstractJdbc3Statement.class
org/postgresql/jdbc3/Jdbc3Array.class
org/postgresql/jdbc3/Jdbc3Blob.class
org/postgresql/jdbc3/Jdbc3CallableStatement.class
org/postgresql/jdbc3/Jdbc3Clob.class
org/postgresql/jdbc3/Jdbc3Connection.class
org/postgresql/jdbc3/Jdbc3ConnectionPool.class
org/postgresql/jdbc3/Jdbc3DatabaseMetaData.class
org/postgresql/jdbc3/Jdbc3PoolingDataSource.class
org/postgresql/jdbc3/Jdbc3PreparedStatement.class
org/postgresql/jdbc3/Jdbc3ResultSet.class
org/postgresql/jdbc3/Jdbc3ResultSetMetaData.class
org/postgresql/jdbc3/Jdbc3SimpleDataSource.class
org/postgresql/jdbc3/Jdbc3Statement.class
org/postgresql/jdbc3/PSQLParameterMetaData.class
org/postgresql/jdbc3/PSQLSavepoint.class
org/postgresql/largeobject/
org/postgresql/largeobject/BlobInputStream.class
org/postgresql/largeobject/BlobOutputStream.class
org/postgresql/largeobject/LargeObject.class
org/postgresql/largeobject/LargeObjectManager.class
org/postgresql/ssl/
org/postgresql/ssl/MakeSSL.class
org/postgresql/ssl/NonValidatingFactory$NonValidatingTM.class
org/postgresql/ssl/NonValidatingFactory.class
org/postgresql/ssl/WrappedFactory.class
org/postgresql/util/
org/postgresql/util/Base64.class
org/postgresql/util/GT.class
org/postgresql/util/MD5Digest.class
org/postgresql/util/PGInterval.class
org/postgresql/util/PGbytea.class
org/postgresql/util/PGmoney.class
org/postgresql/util/PGobject.class
org/postgresql/util/PGtokenizer.class
org/postgresql/util/PSQLDriverVersion.class
org/postgresql/util/PSQLException.class
org/postgresql/util/PSQLState.class
org/postgresql/util/PSQLWarning.class
org/postgresql/util/ServerErrorMessage.class
org/postgresql/util/StreamWrapper.class
org/postgresql/util/UnixCrypt.class
org/postgresql/xa/
org/postgresql/xa/PGXAConnection.class
org/postgresql/xa/PGXADataSource.class
org/postgresql/xa/PGXAException.class
org/postgresql/xa/RecoveredXid.class
org/postgresql/translation/
org/postgresql/translation/messages_cs.class
org/postgresql/translation/messages_de.class
org/postgresql/translation/messages_es.class
org/postgresql/translation/messages_fr.class
org/postgresql/translation/messages_it.class
org/postgresql/translation/messages_nl.class
org/postgresql/translation/messages_pl.class
org/postgresql/translation/messages_pt_BR.class
org/postgresql/translation/messages_ru.class
org/postgresql/translation/messages_tr.class
org/postgresql/translation/messages_zh_CN.class
org/postgresql/translation/messages_zh_TW.class
 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
This is PostgressqlClient.java as it currently stands:
 

import java.sql.*;

public class PostgresqlClient{
    public static void main(String[] Arguments)
        throws ClassNotFoundException, SQLException{
       
        String driver = "org.postgresql.Driver";
        String url ="jdbc:postgresql:CSG";
        String user = "root";
        String pwd = "password";
       
        Class.forName(driver);
       
        Connection con = DriverManager.getConnection(url, user, pwd);
        System.err.println("Connection complete");
       
        con.close();
    }
}

 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
This is some of the commands I have tried and their results:
 


C:\Documents and Settings\java\GregScratch\src>java -cp postgresql.jar:. PostgresqlClient.class
Exception in thread "main" java.lang.NoClassDefFoundError: PostgresqlClient/class

C:\Documents and Settings\java\GregScratch\src>java -cp postgresql.jar:. PostgresqlClient.class
Exception in thread "main" java.lang.NoClassDefFoundError: PostgresqlClient/class

C:\Documents and Settings\java\GregScratch\src>java -cp postgresql.jar. PostgresqlClient.class
Exception in thread "main" java.lang.NoClassDefFoundError: PostgresqlClient/class

C:\Documents and Settings\java\GregScratch\src>java -cp postgresql.jar PostgresqlClient.class
Exception in thread "main" java.lang.NoClassDefFoundError: PostgresqlClient/class

C:\Documents and Settings\java\GregScratch\src>java -cp postgresql.jar PostgresqlClient
Exception in thread "main" java.lang.NoClassDefFoundError: PostgresqlClient

C:\Documents and Settings\java\GregScratch\src>java -cp postgresql.jar:. PostgresqlClient
Exception in thread "main" java.lang.NoClassDefFoundError: PostgresqlClient

C:\Documents and Settings\java\GregScratch\src>

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

This is what NB says (and I think I have added the module correctly):

Exception in thread "main" java.lang.ClassNotFoundException: org.postgresql.Driver
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged (Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java :268)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName (Class.java:164)
        at PostgresqlClient.main(PostgresqlClient.java:12)
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)

Any ideas????

I have tried several versions of the postgresql module from the website too.

Cheers,

Greg.

 

 

 

 
------=_Part_134814_30824988.1164617004053--