在5250会话中的AS400交互式SQL中,
select * from myfile
Run Code Online (Sandbox Code Playgroud)
仅当myfile具有多个成员时才从一个成员返回行.
如何从特定成员获取行?
重要的是:最后我想用jt400对JDBC做这个,所以我真的想要一个能在那里工作的解决方案.
谢谢.
谁能帮我吗?我有一个小实用程序,它使用Jt400-6.7.jar连接到AS400服务器.
请参阅以下代码
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;
}
Run Code Online (Sandbox Code Playgroud)
上面的代码有效,但如果用户名或密码错误,应用程序将创建以下登录屏幕.它发生在执行DriverManager.getConnection()时.
无法发布图片,但它看起来像这样
Signon to the system X
System: AS400Server
User ID: User ID
Password: ********
O Default User ID
O Save Password
OK Cancel
Run Code Online (Sandbox Code Playgroud)
谁能告诉我如何禁用此功能?
我们最近迁移到AS400上较新的V6R1版本的DB2,我们使用Spring框架(v.2.5.6.)与数据库进行通信.我们正在调用Spring的NamedParameterJdbcTemplate.update()
方法来插入新行,这个方法应该返回插入行的数量,没有发生的事情(我们得到的结果为零)虽然定期插入行.
我们得出结论,如果insert语句中没有主键列一切正常,那么当PK列是自动增量时没有问题,但在某些情况下我们必须插入PK值然后我们必须以某种方式处理经常插入行的情况没有注册JDBC或Spring.
有人可以帮忙吗?
当我使用com.ibm.as400.access.AS400.validateSignon()来验证用户的凭据并且他们通过验证并且已成功连接时,它不会将"失败的登录尝试"重置为0.
输入错误密码时,"登录尝试失败"字段会递增; 成功签署"失败的登录尝试"仍然保持有无效的登录.奇怪的是,"之前的登录"会使用正确的日期和时间进行更新.
这是as400上的DSPUSRPRF转储:
User profile . . . . . . . . . . . . . . . : BOB
Previous sign-on . . . . . . . . . . . . . : 12/12/05 21:34:08
Password verifications not valid . . . . . : 4
Status . . . . . . . . . . . . . . . . . . : *ENABLED
Run Code Online (Sandbox Code Playgroud)
我唯一能够通过使用工具箱禁用和重新启用用户来重置"失败登录尝试".这不是一个可行的解决方案,因为它会更新用户配置文件的更改日期和时间.
这种行为与处理我们的绿屏telnet会话的方式相矛盾,当用户登录as400时,"失败的登录尝试"被归零.
感谢任何建议和/或决议.
01)我试图使用命令调用方法获取IBM/AS400 Serial no.代码正在工作因为它没有任何错误或异常.我有事情缺失了.帮我纠正它.
02)是否有任何方法可以使用jt400(java)获得AS/400序列号.我找到了getSerialNum()
方法.但是com.ibm.cics.server.CertificateInfo
导入是例外.也帮我纠正它(如果有人能告诉我如何获得序列号没有使用getSerialNum()
方法它对我真的很有帮助)
预先感谢!
AS400 system = new AS400();
CommandCall command = new CommandCall(system);
try
{
// Run the command "DSPSYSVAL" and parameter value for "SYSVAL" is "QSRLNBR"
if (command.run("DSPSYSVAL QSRLNBR") != true)
{
// Note that there was an error.
System.out.println("Command failed!");
}else{
// Show the messages (returned whether or not there was an error.)
AS400Message[] messagelist = command.getMessageList();
for (int i = 0; i < messagelist.length; ++i)
{
// …
Run Code Online (Sandbox Code Playgroud) 我尝试使用db2jcc.jar并成功建立与db2的连接,但现在我正在尝试使用jt400.jar
我试图使用驱动程序com.ibm.db2.jdbc.app.DB2Driver但我一直得到类找不到异常.
我尝试使用com.ibm.as400.access.AS400JDBCDriver但我无法建立连接.
任何人都可以帮助我或提供一个示例代码,其中连接字符串使用jt400.jar连接到db2.
Class.forName("com.ibm.as400.access.AS400JDBCDriver");
Properties prop = new Properties();
prop.setProperty("user", "current");
prop.setProperty("password", "current");
con = DriverManager.getConnection("jdbc:as400://server/database", prop);
Run Code Online (Sandbox Code Playgroud) 有没有什么方法可以使用AS400样式库/文件样式命名而不是JDBC与jt400?我希望能够运行如下查询:
SELECT * FROM MYLIBRARY/MYFILE
Run Code Online (Sandbox Code Playgroud)
谢谢
我正在尝试在JAVA中读取AS400假脱机文件.我用这段代码读了它.但问题是它只检索该假脱机文件的一个页面详细信息.但我想阅读并获取所有页面详细信息.谁知道怎么做?
提前致谢!
代码:
try {
jTextArea1.setText(null);
DefaultTableModel DTM =(DefaultTableModel) jTable1.getModel();
int SR = jTable1.getSelectedRow();
String SPLFNAME = (String) DTM.getValueAt(SR, 0);
String SPLFNUMBERT = (String) DTM.getValueAt(SR, 1);
String JOBNAME = (String) DTM.getValueAt(SR, 3);
String JOBUSER = (String) DTM.getValueAt(SR, 4);
String JOBFNUMBER = (String) DTM.getValueAt(SR, 5);
int SPLNO = Integer.parseInt(SPLFNUMBERT);
AS400 sys = new AS400();
SpooledFile sf = new SpooledFile( sys, // AS400
SPLFNAME, // splf name
SPLNO, // splf number
JOBNAME, // job name
JOBUSER, // job user
JOBFNUMBER ); // …
Run Code Online (Sandbox Code Playgroud) 我试图从我的Java程序连接到IBM中型(AS400)计算机,然后重设用户密码。使用Jt400.jar,我设法做到了。但是问题是,我需要将端口设置为专门使用端口23。我希望它按照tn5250的方式连接到AS400。从IBM网站在这里,我知道我可以利用这样做as400.connectToPort(23)
。
令我感到困惑的是,当我添加该方法时,我得到了一个java.lang.RuntimeException: java.lang.NegativeArraySizeException
。我曾尝试寻找什么导致此异常导致我在这里和更多的解释在这里。这是我的代码:
public void executeSetPassword(final String userName, final GuardedString password) {
if ((userName != null) && (password != null)) {
final String host = configuration.getHost();
final String remoteUser = configuration.getRemoteUser();
GuardedString passwd = configuration.getPassword();
boolean isSuccessful;
final AS400 as400 = new AS400();
try {
as400.setSystemName(host);
as400.setUserId(remoteUser);
passwd.access(new Accessor(){
@Override
public void access(char[] clearChars) {
try {
as400.setPassword(new String(clearChars));
}catch (Exception e) {
e.printStackTrace();
}
}});
as400.setGuiAvailable(false);
as400.connectToPort(23);
final CommandCall …
Run Code Online (Sandbox Code Playgroud) 我只是试验jt400.jar
从一个接收系统信息AS400
.
我想通过使用类SystemStatus
和如何阅读如何连接以及如何接收值SystemValues
.(只需找到这些值的解释,给我任何提示?)
任何人都可以告诉我,哪些功能SystemStatus
可以让我使用RAM或者接收这些信息?
private static void getSystemStatus() throws AS400SecurityException, ErrorCompletingRequestException,
InterruptedException, IOException, ObjectDoesNotExistException, RequestNotSupportedException {
//Connect to AS400
AS400 as400 = new AS400("myAs400", "myUser", "myPassword");
//Reading SystemStatus like CPU usage and hdd usage
SystemStatus systemStatus = new SystemStatus(as400);
System.out.println(systemStatus.getPercentProcessingUnitUsed());
System.out.println(systemStatus.getActiveJobsInSystem());
//Reading SystemValues
SystemValueList sysValList = new SystemValueList(as400);
Vector<SystemValue> sysValVec = new Vector<SystemValue>();
sysValVec = sysValList.getGroup(SystemValueList.GROUP_ALL);
System.out.println("<<<< SystemValues >>>>");
for (SystemValue systemValue : sysValVec) {
String sysValName = systemValue.getName();
systemValue.getValue();
System.out.println("Value: …
Run Code Online (Sandbox Code Playgroud) 我正在尝试编写一个单元测试来读取消息文件(对于node-jt400,它将open-jt400包装到javascript中.)
我想知道是否有可能在任何IBM i计算机上使用的消息文件(MSGF)(假设在连接时为每个用户创建的临时MSGF,或者在我使用的机器上的QCBLMSGE
哪个MSGF)COBOL RUN TIME MESSAGE FILE
).
我没有实现创建或删除消息文件,否则我会创建一个单元测试所有这些情况,而不是要求它.
提前致谢.