0
I really wanted to get the TimeStamp
from the Sqlserver database, but I’m not getting it, follow my example:
Connection connUpdate = DriverManager.getConnection(ConnectionURL);
PreparedStatement atualizaDevice = connUpdate.prepareStatement("select current_timestamp");
atualizaDevice.execute();
ResultSet r = atualizaDevice.getResultSet();
Timestamp t = r.getTimestamp(1);
String time = String.valueOf(t);
txtTime.setText(time);
Log.e("TIME", time);
connUpdate.close();
Using this code returns the following error:
java.sql.Sqlexception: No Current Row in the Resultset.
Any idea what to do?
executing the query in sqlserver it returns the result normally, place tbm select current_timestamp as TIME and enter "TIME" as method parameter, but even so it returns the same error
– Marcio Vieira