When the data in SQL is retrieved from MyEclipse in Java, it is returned by the result set object, then the data of the result object is received by the Map collection, and then the data is manipulated, because the data inside the map is of type object, So you can force the type to be converted to any type of data.
Result result=commondao.select (SQL, params);
for (int i = 0; i < Result.getrowcount (); i++) {
Map map=result.getrows () [i];
int Fwid=integer.parseint (Map.get ("Fwid"). toString ());
String T=map.get ("title"). ToString ();
Date date= (date) map.get ("date");
int Zj=integer.parseint (Map.get ("ZJ"). toString ());
int Uid=integer.parseint (Map.get ("UID"). toString ());
USERFWXX fwxx=new userfwxx (fwid,t,zj,uid,date);
List.add (FWXX);
}
------------------------------------------------------------------------------------------------------
This is what I forgot today that the data in the map is a objec type, but also worth it, should be to get through a knowledge point:
public static void Main (string[] args) throws exception{
String brithday = "1991-08-01";
SimpleDateFormat SDF = new SimpleDateFormat ("Yyyy-mm-dd");
Date d = sdf.parse (brithday); The parse () method is used to convert a string to a date type
System.out.println ("The time to convert to date type is:" +d);
}
When using the parse () method, note that the string format that is about to be transferred should be the same as the format defined in our SimpleDateFormat (), otherwise it cannot be converted;
Time Conversion and map collection