Problem with String

first, some sample code...


public void showDataToTable(DefaultTableModel m,int day,int month,int year)
{
String date=day+"/"+month+"/"+year;
String sql = "Select* where Date='"+date+"'";
setQuery(sql);
executeSql();

try
{
while(rs.next())
{
Stringsum=String.valueOf(rs.getLong(4));
String[] data={rs.getString(1),rs.getString(2),rs.getString(3),sum};
m.addRow(data);
}
}
catch(SQLException e)
{
}
}

when i run the code it doesn't produce some resultset but if i change the String sql like this:
String sql = "Select* where Date='1/1/2007'";
it produce some resultset.
Why???
[791 byte] By [kuku] at [2007-11-20 11:33:58]
# 1 Re: Problem with String
Have you tried printing out the string 'sql' just before you call setQuery() to see what is actually in the string? egSystem.out.println("sql string = '"+sql+"'");
I suggest you do this for both cases and see what the difference in the strings is.
keang at 2007-11-10 2:14:05 >