没有指定用户名和密码的DB2连接 [英] DB2 connection without specifying username and password

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

问题描述

我已经安装了 DB2 Express C 9.7.4 版本。

我正在建立 JAVA语言> DB2连接。

I am establishing DB2 Connection using JAVA language.

但是我仍然必须提供 Windows的用户名和密码登录用于建立连接的帐户...

But I have to still provide user name and password of my windows Login account for establishing connection...

是否有必要提起它?

Is it necessary to mention it ?

有什么方法可以建立连接而无需指定用户名/密码,因为在安装过程中,我们已经跳过了该页面。

Is there any way out that can establish connection without specifying user name/password as during installation we have skipped the page.

预先感谢...

推荐答案

当应用程序与数据库服务器在同一台机器上运行时,DB2将使假设启动应用程序的userID已由操作系统进行身份验证-因此不需要其他身份验证。这称为隐式身份验证

When an application runs on the same machine as the database server, DB2 will make the assumption that the userID that started the application has already been authenticated by the operating system – so no additional authentication is necessary. This is referred to as impicit authentication.

因此,在不更改缺省DB2数据库配置的情况下,如果满足以下条件,则可以执行此操作满足:

So, without making changes to the default DB2 database configuration, you can do this if the following conditions are met:


  1. java应用程序必须与DB2数据库运行在同一台机器上

  1. The java application must be running on the same machine as the DB2 database

您的应用程序必须使用JDBC Type 2连接(JDBC URL的外观应为 jdbc:db2:database –而不是 jdbc:// localhost:50000 /数据库)。

Your application must use a JDBC Type 2 connection (JDBC URL should look like jdbc:db2:database – not jdbc://localhost:50000/database).

执行Java应用程序的userID有权连接到DB2数据库,查询适当的表等。

The userID executing the Java application has authority to connect to the DB2 database, query the appropriate tables, etc.

可能允许对在数据库服务器以外的计算机上运行的应用程序进行隐式身份验证,但这需要设置受信任的上下文或打开一个较大的安全漏洞(更改 AUTHENTICATION 数据库配置参数)。

It is possible to allow implicit authentication for applications running on machines other than the database server, but this requries setting up trusted contexts or opening a big security hole (changing the AUTHENTICATION database configuration parameter).

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

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