private void buildSQL() {
JDBQuery.closeStatement(listStatement);
JDBQuery query = new JDBQuery(Common.selectedHostID, Common.sessionID);
query.clear();
String temp = JUtility.substSchemaName(schemaName, "select * from {schema}SYS_INTERFACE_LOG");
query.addText(temp);
if (textFieldMessageRef.getText().equals("") == false)
{
query.addParamtoSQL("message_ref like ", "%" + textFieldMessageRef.getText() + "%");
}
if (textFieldMessageInfo.getText().equals("") == false)
{
query.addParamtoSQL("message_information like ", "%" + textFieldMessageInfo.getText() + "%");
}
if (textFielderrorMessage.getText().equals("") == false)
{
query.addParamtoSQL("message_error like ", "%" + textFielderrorMessage.getText() + "%");
}
if (checkBoxEventDate.isSelected())
{
query.addParamtoSQL("event_time>=", JUtility.getTimestampFromDate(dateControlfrom.getDate()));
}
if (checkBoxEventDate.isSelected())
{
query.addParamtoSQL("event_time<=", JUtility.getTimestampFromDate(dateControlTo.getDate()));
}
if (comboBoxInterfaceType.getSelectedItem().toString().equals("") == false)
{
query.addParamtoSQL("interface_type=", comboBoxInterfaceType.getSelectedItem().toString());
}
if (comboBoxDirection.getSelectedItem().toString().equals("") == false)
{
query.addParamtoSQL("interface_direction=", comboBoxDirection.getSelectedItem().toString());
}
if (comboBoxStatus.getSelectedItem().toString().equals("") == false)
{
query.addParamtoSQL("message_status=", comboBoxStatus.getSelectedItem().toString());
}
if (comboBoxAction.getSelectedItem().toString().equals("") == false)
{
query.addParamtoSQL("action=", comboBoxAction.getSelectedItem().toString());
}
query.appendSort("interface_log_id", "desc");
query.applyRestriction(checkBoxLimit.isSelected(), Common.hostList.getHost(Common.selectedHostID).getDatabaseParameters().getjdbcDatabaseSelectLimit(), spinner.getValue());
query.bindParams();
listStatement = query.getPreparedStatement();
}