创建本地连接 - SQL Developer

时间:2018-05-16 02:45:34

标签: oracle oracle-sqldeveloper

根据SQL Developer用户Guide

  

为每个创建(自动生成)数据库连接   在本地Oracle数据库实例中解锁用户帐户   系统,右键单击Connections节点,然后选择Create Local   连接。连接位于名为的文件夹中   自动生成的本地连接。

在我的数据库中,我有以下未锁定的用户

enter image description here

但是当我右键单击连接节点时,将禁用创建本地连接。

enter image description here

我如何启用它?


编辑:

显示jdbc输出是:

-- Database Info --
Database Product Name: Oracle
Database Product Version: Oracle Database 12c Standard Edition Release 12.1.0.2.0 - 64bit Production
Database Major Version: 12
Database Minor Version: 1
-- Driver Info --
Driver Name: Oracle JDBC driver
Driver Version: 12.2.0.1.0
Driver Major Version: 12
Driver Minor Version: 2
Driver URL: jdbc:oracle:thin:@localhost:1521:orcl
Driver Location: Unable to parse URL: bundleresource://48.fwk251900797/oracle/jdbc/OracleDriver.class

1 个答案:

答案 0 :(得分:1)

这里有正在做的代码。

1)可以从ORACLE_HOME获取OCI驱动程序。这必须等于sqldev正在使用的驱动程序。要在工作表中测试该问题。这可以控制菜单的启用。

import { Entity, PrimaryGeneratedColumn, ManyToOne, OneToMany, TreeChildren, TreeParent, JoinColumn, Column, Tree, TreeLevelColumn } from "typeorm";
import { User } from "./User";
import { Debate } from "./Debate";


@Entity()
@Tree("closure-table")
export class Comment {

    @PrimaryGeneratedColumn("uuid")
    id: string;

    @Column()
    text: string;

    @ManyToOne(type => User)
    user: User;

    @ManyToOne(type => Debate, debate => debate.comments)
    debate: Debate;

    @TreeChildren()
    children: Comment[];

    @TreeParent()
    parent: Comment;
}

2)接下来,代码基本上连接为" / as sysdba"。这意味着必须在env。

中设置ORACLE_SID

3)当一切正常时,我们发出这个sql并为每个返回的链接创建一个连接。

SQL> show jdbc
-- Database Info --
Database Product Name: Oracle
Database Product Version: Oracle Database 12c Standard Edition Release 12.1.0.2.0 - 64bit Production
Database Major Version: 12
Database Minor Version: 1
-- Driver Info --
Driver Name: Oracle JDBC driver
Driver Version: 12.2.0.1.0    <<<<<<<<<<< THIS VERSION <<<<<<<<<<<<<<
Driver Major Version: 12
Driver Minor Version: 2