import org.postgresql.jdbc3.Jdbc3PoolingDataSource - PullRequest
1 голос
/ 02 марта 2011

Используя код внизу этой страницы документации postgres, как мне импортировать org.postgresql.jdbc3.Jdbc3PoolingDataSource ?Какой драйвер имеет этот класс?

1 Ответ

2 голосов
/ 03 марта 2011

Как правило, предоставьте больше информации, например, трассировки стека:)

Во всяком случае, вот примитивный способ узнать, есть ли у конкретного JAR класс, который вы ищете:

thufir@tleilax:~/postgres$ 
thufir@tleilax:~/postgres$ ll
total 8
drwxr-xr-x  2 thufir thufir 4096 2011-03-02 16:10 ./
drwxr-xr-x 75 thufir thufir 4096 2011-03-02 16:10 ../
thufir@tleilax:~/postgres$ 
thufir@tleilax:~/postgres$ wget http://jdbc.postgresql.org/download/postgresql-9.0-801.jdbc3.jar
--2011-03-02 16:11:39--  http://jdbc.postgresql.org/download/postgresql-9.0-801.jdbc3.jar
Resolving jdbc.postgresql.org... 200.46.204.71
Connecting to jdbc.postgresql.org|200.46.204.71|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 502694 (491K) [application/octet-stream]
Saving to: `postgresql-9.0-801.jdbc3.jar'

100%[===========================================================================>] 502,694      115K/s   in 4.4s    

2011-03-02 16:11:44 (110 KB/s) - `postgresql-9.0-801.jdbc3.jar' saved [502694/502694]

thufir@tleilax:~/postgres$ 
thufir@tleilax:~/postgres$ jar -tf postgresql-9.0-801.jdbc3.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/copy/
org/postgresql/copy/CopyIn.class
org/postgresql/copy/CopyManager.class
org/postgresql/copy/CopyOperation.class
org/postgresql/copy/CopyOut.class
org/postgresql/copy/PGCopyInputStream.class
org/postgresql/copy/PGCopyOutputStream.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/Logger.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/Parser.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/TypeInfo.class
org/postgresql/core/UTF8Encoding.class
org/postgresql/core/Utils.class
org/postgresql/core/VisibleBufferedInputStream.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/CopyInImpl.class
org/postgresql/core/v3/CopyOperationImpl.class
org/postgresql/core/v3/CopyOutImpl.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/PGPooledConnection.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/jdbc23/
org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection$ConnectionHandler.class
org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection$StatementHandler.class
org/postgresql/ds/jdbc23/AbstractJdbc23PooledConnection.class
org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource$1.class
org/postgresql/ds/jdbc23/AbstractJdbc23PoolingDataSource.class
org/postgresql/ds/jdbc23/AbstractJdbc23SimpleDataSource.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/gss/
org/postgresql/gss/GSSCallbackHandler.class
org/postgresql/gss/GssAction.class
org/postgresql/gss/MakeGSS.class
org/postgresql/jdbc2/
org/postgresql/jdbc2/AbstractJdbc2Array$1.class
org/postgresql/jdbc2/AbstractJdbc2Array$PgArrayList.class
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$CallableBatchResultHandler.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/AbstractJdbc3ParameterMetaData.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/Jdbc3ParameterMetaData.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/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$ConnectionHandler.class
org/postgresql/xa/PGXAConnection.class
org/postgresql/xa/PGXADataSource.class
org/postgresql/xa/PGXADataSourceFactory.class
org/postgresql/xa/PGXAException.class
org/postgresql/xa/RecoveredXid.class
org/postgresql/translation/
org/postgresql/translation/messages_bg.class
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_ja.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_sr.class
org/postgresql/translation/messages_tr.class
org/postgresql/translation/messages_zh_CN.class
org/postgresql/translation/messages_zh_TW.class
META-INF/services/
META-INF/services/java.sql.Driver
thufir@tleilax:~/postgres$ 
thufir@tleilax:~/postgres$ 

и вот ваш класс: org.postgresql.jdbc3.Jdbc3PoolingDataSource

Итак, при условии, что этот JAR находится на вашем пути к классам, вы теперь сможете импортировать этот класс в ваш код.

когда вы задаете вопросы о стековом потоке, укажите фактические примеры кода и трассировки стека.

Надеюсь, это поможет:)

Кстати, проблема заключалась в том, что вы использовали драйвер JDBC4, когда требовался драйвер JDBC3. Ничего страшного.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...