I'm getting date from mysql table...... I had a problem while getting from sfsobject....
I had used getutfstring, getInt , getDouble and getLong,, but i ended with cast error...
note : date format :: 2012-11-18 04:09:08
IDBManager dbManager=getParentExtension().getParentZone().getDBManager();
String query="SELECT created, total_score FROM wkm_challenge_players where player_id="+userId+"";
try {
ISFSArray result=dbManager.executeQuery(query);
for(int i=0;i<result.size();i++)
{
ISFSObject response=result.getSFSObject(i);
trace("created---------"+response.getLong("created")); (where i get casting error........ : )
trace("total_score-----"+response.getInt("total_score"));
}
Many Thanks,
Muni
get date from sfsobject of java api
Re: get date from sfsobject of java api
Maybe there's a type mismatch between the DB type and the Java type.
Try to dump the whole result object to see what type the "created" field was mapped to.
Simply add to your code:
Try to dump the whole result object to see what type the "created" field was mapped to.
Simply add to your code:
Code: Select all
trace(result.getDump());
Return to “SFS2X Java / Android API”
Who is online
Users browsing this forum: No registered users and 49 guests