Oracle SQL Developer和PostgreSQL [英] Oracle SQL Developer and PostgreSQL

查看:175
本文介绍了Oracle SQL Developer和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.

  • 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 of Oracle, select PostgreSQL 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆