连接到Oracle,没有用户名或密码 [英] Connection to Oracle without a username or password

查看:390
本文介绍了连接到Oracle,没有用户名或密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Oracle具有允许数据库用户由运行连接到Oracle的程序的操作系统用户识别的概念。请参见此处

Oracle has this concept of allowing database users to be identified by the operating system user who is running the program that is connecting to Oracle. See here.

这允许你在unix机器上做一个命令,例如:

This allows you to do, as that user on a unix machine for example, a command such as:

sqlplus /

我试图为没有用户名或密码的Oracle 10.2写一个Java程序。显而易见的网址选择:

I am attempting to write a Java program for Oracle 10.2 which connects without a username or password. The obvious choice of url:

jdbc:oracle:thin:/@localhost:1521:MYDBSID

不工作,给出错误(对不起,我现在没有错误)。

doesn't work, giving an error (Sorry I don't have the error available right now).

我尝试过很多其他形式的做法,但没有运气。

I have attempted many other forms of doing this as well, but with no luck.

有没有人有任何建议,使用操作系统标识方法将Java程序连接到Oracle?

Does anyone have any suggestions on how I can connect a Java program to Oracle using the OS identification method?

推荐答案

JDBC Thin驱动程序是一个100%纯Java实现,从操作系统收集所需的信息。

The JDBC Thin driver is a 100% pure Java implementation that cannot collect the needed information from the operating system.

JDBC OCI驱动程序可以执行此操作!使用 jdbc:oracle:oci8:/ @ MYDBSID ,它将要求在该机器上安装Oracle驱动程序,而不是一个问题,如果这是一个服务器boot并支持比thin驱动程序更多的功能)

The JDBC OCI driver can do this! Use jdbc:oracle:oci8:/@MYDBSID, it will require that the Oracle driver be installed on that machine, not a problem if this is a server (and is faster to boot and supports many more features than the thin driver)

这篇关于连接到Oracle,没有用户名或密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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