Oracle SQL Developer和PostgreSQL [英] Oracle SQL Developer and PostgreSQL
问题描述
我正在尝试使用Oracle SQL Developer 3.0.04连接到PostgreSQL 9.1数据库,但是到目前为止我没有任何成功.
I'm trying to connect to a PostgreSQL 9.1 database using Oracle SQL Developer 3.0.04, but I'm not having any success so far.
首先,如果我在首选项上添加了第三方驱动程序,则在添加新连接时,PostgreSQL没有选项卡(尽管它对MySQL很好用).我使用的是JDBC4版本9.1驱动程序,但是我尝试了相同版本的JDBC3,但仍然得到相同的结果.
First, if I add a third party driver on preferences, when adding a new connection there's no tab for PostgreSQL (it works fine for MySQL though). I'm using a JDBC4 version 9.1 driver, but I tried a JDBC3 of the same version and still get the same thing.
第二,添加新连接时没有像手动配置选项卡那样的东西.最接近的是Oracle选项卡上的Advanced选项,我可以在其中提供一个自定义URL,但由于抱怨所选驱动程序(当然)而失败了.
Second, there's nothing like manual configuration tab when adding a new connection. The closest is the Advanced option on Oracle tab, where I can provide a custom URL, but it fails because complains about the selected Driver (of course).
最后,我已连接到一个从XML文件导入连接的内容(下面的内容),但是它仅显示我的模式,而不显示其中的表.
Finally, I got connected importing a connection from an XML file (contents below), but it displays only my schemas and doesn't show my tables inside them.
所以,我的问题是:Orable SQL Developer是否支持PostgreSQL连接?还有其他方法可以在ObjectViewer中显示我的表吗?
So, my question is: does Orable SQL Developer support PostgreSQL connections? Is there any other way to have my tables being displayed in the ObjectViewer?
<?xml version = '1.0' encoding = 'UTF-8'?>
<References xmlns="http://xmlns.oracle.com/adf/jndi">
<Reference name="Lumea" className="oracle.jdeveloper.db.adapter.DatabaseProvider" credentialStoreKey="Lumea" xmlns="">
<Factory className="oracle.jdeveloper.db.adapter.DatabaseProviderFactory"/>
<RefAddresses>
<StringRefAddr addrType="user">
<Contents>lumea</Contents>
</StringRefAddr>
<StringRefAddr addrType="subtype">
<Contents>thirdParty</Contents>
</StringRefAddr>
<StringRefAddr addrType="customUrl">
<Contents>jdbc:postgresql://localhost:5432/versates</Contents>
</StringRefAddr>
<StringRefAddr addrType="SavePassword">
<Contents>true</Contents>
</StringRefAddr>
<StringRefAddr addrType="password">
<Contents>myencryptedpass</Contents>
</StringRefAddr>
<StringRefAddr addrType="driver">
<Contents>org.postgresql.Driver</Contents>
</StringRefAddr>
<StringRefAddr addrType="DeployPassword">
<Contents>true</Contents>
</StringRefAddr>
</RefAddresses>
</Reference>
</References>
推荐答案
Oracle SQL Developer 4.0.1.14确实支持与PostgreSQL的连接.
Oracle SQL Developer 4.0.1.14 surely does support connections to PostgreSQL.
- 下载Postgres的JDBC驱动程序( http://jdbc.postgresql.org/download.html) 在SQL Developer中的
- 转到
Tools → Preferences
,Database → Third Party JDBC Drivers
并添加jar文件(请参阅 http://www.oracle.com/technetwork/products/migration/jdbc-migration-1923524.html (逐步示例) - 现在只创建一个新的
Database Connection
,而不是选择PostgreSQL
标签,而不是Oracle
- download JDBC driver for Postgres (http://jdbc.postgresql.org/download.html)
- in SQL Developer go to
Tools → Preferences
,Database → Third Party JDBC Drivers
and add the jar file (see http://www.oracle.com/technetwork/products/migration/jdbc-migration-1923524.html for step by step example) - now just make a new
Database Connection
and instead ofOracle
, selectPostgreSQL
tab
修改:
如果用户名和数据库名不同,则应在主机名中指定:hostname/database?
(不要忘记?
)或hostname:port/database?
.
If you have different user name and database name, one should specify in hostname: hostname/database?
(do not forget ?
) or hostname:port/database?
.
(感谢@kinkajou和@ Kloe2378231;有关详细信息,请参见 https://stackoverflow.com/a/28671213/565525).
(thanks to @kinkajou and @Kloe2378231; more details on https://stackoverflow.com/a/28671213/565525).
这篇关于Oracle SQL Developer和PostgreSQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!