this my log
Code: Select all
04 apr 2017 | 19:43:11,116 | DEBUG | SocketReader | protocol.binary.BinaryIoHandler | | STATE: WAIT_NEW_PACKET
04 apr 2017 | 19:43:11,119 | DEBUG | SocketReader | protocol.binary.BinaryIoHandler | | NORMAL SIZED PACKET: 69
04 apr 2017 | 19:43:11,121 | DEBUG | SocketReader | protocol.binary.BinaryIoHandler | | <<< PACKET COMPLETE >>>
04 apr 2017 | 19:43:11,122 | DEBUG | SFSWorker:Sys:4 | v2.protocol.SFSProtocolCodec | |
(sfs_object) p:
(sfs_object) p:
(utf_string) username: pluto1
(int) r: 2
(utf_string) c: userdetail
(short) a: 13
(byte) c: 1
04 apr 2017 | 19:43:11,141 | DEBUG | SFSWorker:Ext:2 | controllers.v290.ExtensionReqController | | [Req Type: (Tcp), Sender: { Id: 1, Type: DEFAULT, Logged: Yes, IP: 127.0.0.1:55301 }]
04 apr 2017 | 19:43:11,146 | DEBUG | SFSWorker:Ext:2 | controllers.v290.ExtensionReqController | |
(sfs_object) p:
(utf_string) username: pluto1
(int) r: 2
(utf_string) c: userdetail
04 apr 2017 | 19:43:11,155 | INFO | SFSWorker:Ext:2 | Extensions | | {Server}: Sto richiedendo al server i dettagli di uno user
04 apr 2017 | 19:43:11,158 | INFO | SFSWorker:Ext:2 | Extensions | | {Server}: Ho fatto l'accesso per richiedere al server la mia query
04 apr 2017 | 19:43:11,163 | DEBUG | SFSWorker:Ext:2 | v2.db.SFSDBManager | | Execute Query SQL: com.mysql.jdbc.JDBC42PreparedStatement@575ee75d: select * from users where username = 'pluto1'
04 apr 2017 | 19:43:11,184 | INFO | SFSWorker:Ext:2 | Extensions | | {Server}: vediamo cosa contiene l'array[SFSObject, size: 0]
04 apr 2017 | 19:43:11,186 | DEBUG | SFSWorker:Ext:2 | v2.protocol.SFSProtocolCodec | | {OUT}: CallExtension
04 apr 2017 | 19:43:11,189 | DEBUG | SFSWorker:Ext:2 | protocol.binary.BinaryIoHandler | | Binary size: 71
12 00 03 00 01 70 12 00 03 00 01 70 12 00 01 00 .....p.....p....
05 65 72 72 6F 72 08 00 0B 4D 79 53 51 4C 20 65 .error...MySQL.e
72 72 6F 72 00 01 72 04 00 00 00 02 00 01 63 08 rror..r.......c.
00 0A 75 73 65 72 64 65 74 61 69 6C 00 01 61 03 ..userdetail..a.
00 0D 00 01 63 02 01 ....c..
04 apr 2017 | 19:43:11,189 | DEBUG | SFSWorker:Ext:2 | controllers.v290.ExtensionReqController | | Extension call executed in: 43.996491
04 apr 2017 | 19:44:53,323 | INFO | SocketReader | bitswarm.sessions.DefaultSessionManager | | Session removed: { Id: 1, Type: DEFAULT, Logged: Yes, IP: 127.0.0.1:55301 }
04 apr 2017 | 19:44:53,324 | DEBUG | SFSWorker:Sys:3 | entities.managers.SFSRoomManager | | User: chry removed from Room: The Lobby
04 apr 2017 | 19:44:53,326 | DEBUG | SFSWorker:Ext:4 | v2.buddylist.SFSBuddyListManager | | Skipping BuddyList save request. No BuddyList available for: chry
04 apr 2017 | 19:44:53,326 | INFO | SFSWorker:Sys:3 | v2.api.SFSApi | | User disconnected: { Zone: Login }, ( User Name: chry, Id: 0, Priv: 0, Sess: 127.0.0.1:55301 ) , SessionLen: 107261, Type: Unity
then here my code server-side
Code: Select all
public class UserDetailHandler extends BaseClientRequestHandler{
Object obj = null;
public void handleClientRequest(User user, ISFSObject params) {
//int id_user = params.getInt("user_id");
String username = params.getUtfString("username");
trace("Sto richiedendo al server i dettagli di uno user");
IDBManager dbmanager = getParentExtension().getParentZone().getDBManager();
try{
trace("Ho fatto l'accesso per richiedere al server la mia query");
ISFSArray arr = dbmanager.executeQuery("select * from users "
+ "where username = ? "
, new Object[] {username});
if (arr.size() > 0)
{
SFSObject result = new SFSObject();
result.putSFSArray("success", arr);
send("userdetail", result, user);
}
}catch (SQLException ex) {
ISFSObject error = new SFSObject();
trace("vediamo cosa contiene l'array" + error.toString());
error.putUtfString("error", "MySQL error");
send("userdetail" , error, user);
}
}
}
the consolle print mysql error but is not correct in my database i have one record and if i copy the query on mysql workbench i have this
Code: Select all
SELECT * FROM Users WHERE username = 'pluto1'
i have this
Code: Select all
3 pluto disney 0000-00-00 00:00:00 pluto1 123456 pippo3@mail.it 3000 100 3000 germany sdafda
why my code doesn't work??
i have done this method to all my queries and the other one works