package com.oimacademy.provision;
import java.sql.Connection;
import java.sql.Statement;
import com.oimacademy.connection.DataSource;
public class EntitlementsCreationUsingScript {
public static void main(String[] args) throws Exception {
String codeValue="CODE_C";
String decodeValue="DECODE_D";
String lKU_Key="1621";
String insertLKVQuery="INSERT INTO LKV (LKV_KEY,LKU_KEY,LKV_ENCODED,LKV_DECODED,LKV_LANGUAGE,LKV_COUNTRY, LKV_VARIANT,LKV_DISABLED,LKV_DATA_LEVEL,LKV_CREATE,LKV_CREATEBY,LKV_UPDATE,"+
" LKV_UPDATEBY,LKV_NOTE,LKV_ROWVER) select LKV_SEQ.NEXTVAL as LKV_KEY, LKU_KEY as LKU_KEY, '" + codeValue + "'||LKV_SEQ.NEXTVAL as LKV_ENCODED, '"+decodeValue+"'||LKV_SEQ.NEXTVAL as LKV_DECODED,"+
"LKV_LANGUAGE,LKV_COUNTRY,LKV_VARIANT,LKV_DISABLED,LKV_DATA_LEVEL, LKV_CREATE,LKV_CREATEBY,LKV_UPDATE,LKV_UPDATEBY,NULL AS LKV_NOTE,LKV_ROWVER from LKV"+
" where LKU_KEY= "+lKU_Key;
System.out.println("Query -> " +insertLKVQuery);
Connection con= DataSource.getConnection();
Statement statement =con.createStatement();
for(int i=0;i<10;i++){
statement.execute(insertLKVQuery);
}
DataSource.closeConnection();
}
}
import java.sql.Connection;
import java.sql.Statement;
import com.oimacademy.connection.DataSource;
public class EntitlementsCreationUsingScript {
public static void main(String[] args) throws Exception {
String codeValue="CODE_C";
String decodeValue="DECODE_D";
String lKU_Key="1621";
String insertLKVQuery="INSERT INTO LKV (LKV_KEY,LKU_KEY,LKV_ENCODED,LKV_DECODED,LKV_LANGUAGE,LKV_COUNTRY, LKV_VARIANT,LKV_DISABLED,LKV_DATA_LEVEL,LKV_CREATE,LKV_CREATEBY,LKV_UPDATE,"+
" LKV_UPDATEBY,LKV_NOTE,LKV_ROWVER) select LKV_SEQ.NEXTVAL as LKV_KEY, LKU_KEY as LKU_KEY, '" + codeValue + "'||LKV_SEQ.NEXTVAL as LKV_ENCODED, '"+decodeValue+"'||LKV_SEQ.NEXTVAL as LKV_DECODED,"+
"LKV_LANGUAGE,LKV_COUNTRY,LKV_VARIANT,LKV_DISABLED,LKV_DATA_LEVEL, LKV_CREATE,LKV_CREATEBY,LKV_UPDATE,LKV_UPDATEBY,NULL AS LKV_NOTE,LKV_ROWVER from LKV"+
" where LKU_KEY= "+lKU_Key;
System.out.println("Query -> " +insertLKVQuery);
Connection con= DataSource.getConnection();
Statement statement =con.createStatement();
for(int i=0;i<10;i++){
statement.execute(insertLKVQuery);
}
DataSource.closeConnection();
}
}
No comments:
Post a Comment