Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void PacketSendLogin(String inData) throws SQLException
- {
- int result = 0;
- String[] temp;
- temp = inData.split("~");
- ResultSet SqlQuery = null;
- String sql = "Select * from `Account` where `username` like '" + temp[1] + "' and `pass` like '" + temp[2] + "';";
- try
- {
- SqlQuery = Sqlstatement.SelectFromDB(sql);
- }
- catch (IOException ex)
- {
- Console.Write("Error in function RecognizePacket:LOGIN:IOException",console.CONSOLE_MYSQL.ordinal(), true, false);
- }
- if(SqlQuery == null)
- return;
- int accountId = 0;
- String userName = null;
- String pass = null;
- while (SqlQuery.next())
- {
- accountId = SqlQuery.getInt("id");
- userName = SqlQuery.getString("username");
- pass = SqlQuery.getString("pass");
- Console.Write("Result =" + accountId + "," + userName + "," + pass, console.CONSOLE_MYSQL.ordinal(), true, false);
- }
- if (temp[1] == userName && temp[2] == pass)
- {
- Console.Write("Naslo zaznam",console.CONSOLE_MYSQL.ordinal(), true, false);
- return;
- }
- else
- {
- Console.Write("Nenaslo zaznam",console.CONSOLE_MYSQL.ordinal(), true, false);
- return;
- }
- }
Add Comment
Please, Sign In to add comment