public static PreparedStatement createStatement(Connection con, String query, Object... params) throws SQLException
	{
		PreparedStatement ps = con.prepareStatement(query);
		int index = 0;
		for(Object o : params)
		{
			index++;
			if(o instanceof Integer)
				ps.setInt(index, (Integer)o);
			else if(o instanceof Double)
				ps.setDouble(index, (Double)o);
			else if(o instanceof String)
				ps.setString(index, (String)o);
			else if(o instanceof Date)
				ps.setDate(index, (Date)o);
			else throw new SQLException(String.format("Unsupported argument class %s", o.getClass()));
		}

		return ps;
	}