How to create SQL from Java Get the name of the day from the timestamp object?

How to start Java SQL from Monday and Tuesday Get the name of the day in the timestamp object?

Solution

You will use Java sql. Timestamp to Java sql. Date and send it through calendar

java.sql.Timestamp ts = rs.getTimestamp(1);
java.util.GregorianCalendar cal = Calendar.getInstance();
cal.setTime(ts);
System.out.println(cal.get(java.util.Calendar.DAY_OF_WEEK));
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>