I'd like to get the TimeStamp
from the SQLServer database, but I'm not getting it, here's 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?