JT400.jar禁用登录屏幕 [英] JT400.jar Disable Login Screen

查看:194
本文介绍了JT400.jar禁用登录屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以帮我吗?我有一个小型实用程序应用程序,它使用Jt400-6.7.jar连接到AS400服务器.

Can anyone help me out? I have small utility application that uses the Jt400-6.7.jar to connect to an AS400 server.

请参见以下代码

private Connection buildConnection(String url, String userName, String password) throws ClassNotFoundException,
            SQLException {
        Connection connection = null;

        Class.forName("com.ibm.as400.access.AS400JDBCDriver");

        DriverManager.setLoginTimeout(10000);

        //OVER HERE!!! 
        connection = DriverManager.getConnection(url, userName, password);

        return connection;
    }

上面的代码有效,但是如果用户名或密码错误,则应用程序将创建以下登录屏幕.在执行DriverManager.getConnection()时会发生这种情况.

The code above works but if the the username or the password is wrong the application creates the following login screen. It happens when DriverManager.getConnection() is executed.

不能发布图片,但是看起来像这样

Cant post a picture but it looks something like this

Signon to the system           X

System:         AS400Server
User ID:        User ID
Password:       ********

       O Default User ID
       O Save Password

    OK            Cancel  

谁能告诉我如何禁用此功能?

Can anyone tell me how to disable this feature??

推荐答案

禁用此功能的一种方法是设置JVM属性com.ibm.as400.access.AS400.guiAvailable = false.

One way to disable this feature is to set the JVM property, com.ibm.as400.access.AS400.guiAvailable=false.

在Java命令行中,您可以使用java -Dcom.ibm.as400.access.AS400.guiAvailable = false ...

From a java command line, you would set this using java -Dcom.ibm.as400.access.AS400.guiAvailable=false ...

以下是使用jt400.jar中包含的jdbc客户端的示例

Here is an example using the jdbc client included in jt400.jar

C:\>java -cp jt400.jar -Dcom.ibm.as400.access.AS400.guiAvailable=false com.ibm.as400.access.jdbcClient.Main jdbc:as400:/SYSTEM
Warning:  Unable to connect to jdbc:as400:/SYSTEM using null
CON is not defined

禁用此功能的第二种方法是使用hint = false连接属性.例如.

The second way to disable this feature is to use the prompt=false connection property. For example.

C:\jtopen_build\dist6>java -cp jt400.jar com.ibm.as400.access.jdbcClient.Main jdbc:as400:/SYSTEM;prompt=false
Warning:  Unable to connect to jdbc:as400:/SYSTEM;prompt=false using null
CON is not defined

这篇关于JT400.jar禁用登录屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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