我想根据IN子句示例中的顺序来命令sql查询的结果集:
select * from Employee where EmpID='Eng' and DeptID IN ('Software','Mech','Aero','Civil'),
Run Code Online (Sandbox Code Playgroud)
对于上述查询,我想订购顺序中的结果集1.软件,2.Mech,3.Aero,4.Civil
在下面的代码中,我想调用一个存储过程并执行一个Query.我正面临错误statement.executeUpdate();请帮助修复它.我不知道哪里出错了.
public void Dbexe() {
Connection connection;
connection = DatabaseConnection.getCon();
CallableStatement stmt;
try {
stmt = connection.prepareCall("{CALL optg.Ld_SOpp}");
stmt.executeUpdate();
stmt.close();
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
System.out.println("Stored Procedure executed");
//PreparedStatement statement = null;
// ResultSet rs = null;
try{
PreparedStatement statement;
try {
statement = connection.prepareStatement("MERGE INTO OPTG.R_VAL AS TARGET USING" +
........... +
"");
statement.executeUpdate(); //Here the exception is thrown
statement.close();
connection.commit();
connection.close();
} catch (SQLException e) {
// TODO Auto-generated …Run Code Online (Sandbox Code Playgroud) 如果有人知道,如何使用RobotFrame工作连接到数据库(db2).我想查询数据库以验证结果.
任何想法将不胜感激!
BR
可以说像PGM1(cobol)调用-> PGM2(cobol-db2)调用-> PGM3(cobol)->调用PGM4(cobol-db2)。1Q。PGM3被修改,这纯粹是COBOL程序。我们是只编译PGM3并将其推广到生产中,还是应该再次进行BIND,因为它由和调用cobol-db2程序进行了调用。2Q。如果修改了PGM4,则必须执行的操作。(我正在使用PACKAGE-> PLAN概念)?此外,当我们进行cobol-cobol / db2调用时,任何人都可以请我解释一下如何使用软件包概念进行绑定。