From: <cl...@hy...> - 2007-03-29 18:56:37
|
Author: clee Date: 2007-03-29 10:56:27 -0800 (Thu, 29 Mar 2007) New Revision: 3959 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3959 Modified: trunk/src/org/hyperic/tools/db/DataSet.java Log: More correct to set parameter to boolean so that the driver handles the database type Modified: trunk/src/org/hyperic/tools/db/DataSet.java =================================================================== --- trunk/src/org/hyperic/tools/db/DataSet.java 2007-03-29 18:08:07 UTC (rev 3958) +++ trunk/src/org/hyperic/tools/db/DataSet.java 2007-03-29 18:56:27 UTC (rev 3959) @@ -232,19 +232,12 @@ } if (strValue != null) { - // We need to replace the value 'TRUE' with '1' and 'FALSE' with - // '0' if this is Oracle or MySQL. It's a hack to have this code - // in this class until I do some restructuring of the code - if (strValue.compareTo("TRUE") == 0 && - (m_parent.getDbType() == OracleTable.CLASS_TYPE || - m_parent.getDbType() == MySQLTable.CLASS_TYPE)) { - stmt.setInt(i + 1, 1); + if (strValue.equals("TRUE")) { + stmt.setBoolean(i + 1, true); continue; } - else if (strValue.compareTo("FALSE") == 0 && - (m_parent.getDbType() == OracleTable.CLASS_TYPE || - m_parent.getDbType() == MySQLTable.CLASS_TYPE)) { - stmt.setInt(i + 1, 0); + else if (strValue.equals("FALSE")) { + stmt.setBoolean(i + 1, false); continue; } |