I want to get the data from Sql,
i am created the ODBC Connection and created the Class for Batch Job and writing the One Method to insert in to table
and call this Method in Run Method of class.
Runbase batch is executed and data is comming perfectly.
After run the batch job if i insert the New value in SQL Data Base that value is not Coming.
i am writing this code.
public void insertSGCO_WB1_ProductIN()
{
LoginProperty loginProperty;
OdbcConnection odbcConnection;
Statement statement;
ResultSet resultSet;
SGCO_WB1_ProductIN _SGCO_WB1_ProductIN;
str sql, criteria;
SqlStatementExecutePermission perm;
;
// Set the information on the ODBC.
loginProperty = new LoginProperty();
loginProperty.setDSN("ODBC Data Source");
//Create a connection to external database.
odbcConnection = new OdbcConnection(loginProperty);
if (odbcConnection)
{
sql = "SELECT * FROM SGCO_WB1_TestTableIN";
perm = new SqlStatementExecutePermission(sql);
perm.assert();
statement = odbcConnection.createStatement();
resultSet = statement.executeQuery(sql);
while (resultSet.next())
{
_SGCO_WB1_ProductIN.clear();
_SGCO_WB1_ProductIN.TRANSACTIONNO = resultSet.getInt(1);
_SGCO_WB1_ProductIN.GrossWeight = resultSet.getReal(2);
_SGCO_WB1_ProductIN.TareWeight = resultSet.getReal(3);
_SGCO_WB1_ProductIN.DATEENTRY = resultSet.getDateTime(4);
_SGCO_WB1_ProductIN.insert();
}
}
}
I am Created a Index in the Table for TransactionNO with Allow Duplicates NO.
If i Run the Batch job suppose 10 records are there it is inserted in the Table.
After i am Inserting the New record in the SQL It is not Coming.
Please Give me the Solution For this