I am writing a code in which I am creating a JDBC connection and executing a select statement. I want to run the as a jar and give input to the where condition from the command line for e.g. java -jar abc.jar "abc"
. How can this be done?
try {
strExecuteQuery = "select b.FIUSB_REQUEST_MESSAGE,b.FIUSB_RESPONSE_MESSAGE,a.fiusb_tran_id,a.FIUSB_SRV_REQ_TYPE"
+ " from fimaster.fiusb_transaction_tablehist a ,fimaster.FIUSB_TRANDETAILS_TABLE_HIST b"
+ " where a.fiusb_tran_id = b.fiusb_tran_id and a.FIUSB_SRV_REQ_TYPE in('XferTrnRev','XferTrnAdd','PmtAdd') and a.fe_req_ref_num='args1'";
//PreparedStatement stmt=con.prepareStatement(strExecuteQuery);
//strExecuteQuery.getClass();
ddlStatement.execute(strExecuteQuery);
ddlStatement.closeConnection();
I want to take args1 in the above code as the input in the command line