Return Time value from database

In a datebase i have stored a time value, when i use a resultset to retrieve this value from the database by usingTime time = rs.getTime("time");in the database the value is 20:29:00 but the value returned by time is 00:00:00. why isnt this returning the correct value?
[290 byte] By [paulunda] at [2007-11-27 1:10:54]
# 1
Which field type is it stored in? And which database are you talking about?
BalusCa at 2007-7-11 23:46:13 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2
the field type is Time and its a MySQL database
paulunda at 2007-7-11 23:46:14 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3
hi :-)what is the type of the "time" field on your column?regards,
jie2eea at 2007-7-11 23:46:14 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 4
This should work. Which Time object type are you using? java.sql.Time? What does resultSet.getString("time") say?
BalusCa at 2007-7-11 23:46:14 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 5
yea its java.sql.Time the resultset will retrieve a value but the value is always 00:00:00, but this is not the same value which is in the database. so im abit confused.
paulunda at 2007-7-11 23:46:14 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 6
What does resultSet.getString("time") say? Are you sure that your SELECT query is correct?
BalusCa at 2007-7-11 23:46:14 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 7

try{

Statement command = conn.createStatement();

rs= command.executeQuery("SELECT * FROM table");

while(rs.next()){

Time time = rs.getTime("Time");

System.out.println(time);

}

}

on the System.out.println(time) the output is 00:00:00 wen it should be something like 20:29:59.

paulunda at 2007-7-11 23:46:14 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 8
For the 3rd time: What does resultSet.getString("time") say?If this also says 00:00:00, then I think that you're using a wrong or outdated JDBC driver. Which driver are you using? MySQL Connector/J 5.1 is the most recent one.
BalusCa at 2007-7-11 23:46:14 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...