BoardiesITSolutions / Android-MySQL-Connector

Native MySQL Connector for Android
MIT License
51 stars 15 forks source link

E/SocketSender: java.net.NoRouteToHostException: Host unreachable #16

Closed ronnyvillamar99 closed 4 years ago

ronnyvillamar99 commented 4 years ago

hi, i am using version 0.37_MySQL8, and i have the E / SocketSender error: java.net.NoRouteToHostException: Host unreachable

I don't know if I'm doing something wrong this is my code

try {
        mysqlConnection = new Connection(server, user,
                password, Integer.parseInt( port), dbname,new IConnectionInterface()
        {
            @Override
            public void actionCompleted()
            {
                completed=true;

                statement = mysqlConnection.createStatement();
                //You are now connected to the database
                Log.i("DBConnection", "Completed");
            }

            @Override
            public void handleInvalidSQLPacketException(InvalidSQLPacketException e)
            {
                //Handle the error
                Log.e("DBConnection", e.toString());
            }

            @Override
            public void handleMySQLException(MySQLException e)
            {
                //Handle the error
                Log.e("DBConnection", e.toString());
            }

            @Override
            public void handleIOException(IOException e)
            {
                //Handle the error
                Log.e("DBConnection", e.toString());
            }

            @Override
            public void handleMySQLConnException(MySQLConnException e)
            {
                //Handle the error
                Log.e("DBConnection", e.toString());
            }

            @Override
            public void handleException(Exception e)
            {
                //Handle the error
                Log.e("DBConnection", e.toString());
            }
        });
        int count=0;
        while ( completed ==false  ) {
            if (count ==50) {
                Log.e("DBConnection","Error Timeout");
                return false ;
            }
            count++;
           Thread.currentThread().join(100);

        }

        return true ;
        } catch (Exception e) {
                e.printStackTrace();
            }
        return false;
boardy commented 4 years ago

Hey.

NoRouteToHostException is usually just a case of the server you are trying to connect to isn't available on the device you are connecting from.

Can you double check your mobile device is on the same network as your MySQL database.

If your using a hostname it might be that the hostname can't be resolved so might be worth accessing the server from the ip address instead.

Hope that helps if I can help further then please let me know.

Thanks

Chris

On Mon, 25 May 2020, 00:24 Ronny Villamar, notifications@github.com wrote:

hi, i am using version 0.37_MySQL8, and i have the E / SocketSender error: java.net.NoRouteToHostException: Host unreachable

I don't know if I'm doing something wrong this is my code

try { mysqlConnection = new Connection(server, user, password, Integer.parseInt( port), dbname,new IConnectionInterface() { @Override public void actionCompleted() { completed=true;

           statement = mysqlConnection.createStatement();
           //You are now connected to the database
           Log.i("DBConnection", "Completed");
       }

       @Override
       public void handleInvalidSQLPacketException(InvalidSQLPacketException e)
       {
           //Handle the error
           Log.e("DBConnection", e.toString());
       }

       @Override
       public void handleMySQLException(MySQLException e)
       {
           //Handle the error
           Log.e("DBConnection", e.toString());
       }

       @Override
       public void handleIOException(IOException e)
       {
           //Handle the error
           Log.e("DBConnection", e.toString());
       }

       @Override
       public void handleMySQLConnException(MySQLConnException e)
       {
           //Handle the error
           Log.e("DBConnection", e.toString());
       }

       @Override
       public void handleException(Exception e)
       {
           //Handle the error
           Log.e("DBConnection", e.toString());
       }
   });
   int count=0;
   while ( completed ==false  ) {
       if (count ==50) {
           Log.e("DBConnection","Error Timeout");
           return false ;
       }
       count++;
      Thread.currentThread().join(100);

   }

   return true ;
   } catch (Exception e) {
           e.printStackTrace();
       }
   return false;

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/BoardiesITSolutions/Android-MySQL-Connector/issues/16, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCS2M4TKEBGCGQ4U3Y2PULRTGUC3ANCNFSM4NJC3BPA .

ronnyvillamar99 commented 4 years ago

ah if i fix it my error but now i have another problem when executing an INSERT query it throws me an error

E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #2
    Process: com.syterox.wholesales, PID: 26174
    java.lang.RuntimeException: An error occurred while executing doInBackground()

comes from this file in this section specifically, at

com.BoardiesITSolutions.AndroidMySQLConnector.MySQLIO.shiftCurrentBytePosition(MySQLIO.java:242)
        at com.BoardiesITSolutions.AndroidMySQLConnector.PacketManager.COM_QueryResponse.processPacketData(COM_QueryResponse.java:102)
        at com.BoardiesITSolutions.AndroidMySQLConnector.PacketManager.COM_QueryResponse.<init>(COM_QueryResponse.java:25)
        at com.BoardiesITSolutions.AndroidMySQLConnector.Statement$2.socketDataSent(Statement.java:243)
        at com.BoardiesITSolutions.AndroidMySQLConnector.SocketSender.doInBackground(SocketSender.java:53)
        at com.BoardiesITSolutions.AndroidMySQLConnector.SocketSender.doInBackground(SocketSender.java:11)

but the execution if it works, it inserts the data in the table, but al finalize gives me that error

boardy commented 4 years ago

Hey,

OK that could be an incompatibility between your DB version.

Can you let me know what version of MySQL/MariaDB you are using please and I'll see if I can replicate it.

Thanks Chris

ronnyvillamar99 commented 4 years ago

thanks my version is 5.7.11

Although haha, I know why it originated, in my function where I execute the query, I also read the result it gives me, and since it is a function with no return, I suppose, INSERT, does not return any value and gives me an error,

I do not know if in that case it should throw some value when executing INSERT or UPDATE, in any case, if you can solve it so that this does not happen, that it returns something or some way of verifying if it has returned any value

ronnyvillamar99 commented 4 years ago

change the function and follow the same error, the error is in this code

public void shiftCurrentBytePosition(int length)
    {
        if ((currentBytesRead + length) > fullData.length)
        {
            throw new IndexOutOfBoundsException();
        }
        currentBytesRead += length;
    }
ronnyvillamar99 commented 4 years ago

other


  Caused by: java.lang.ArrayIndexOutOfBoundsException: length=65; index=65
        at com.BoardiesITSolutions.AndroidMySQLConnector.MySQLIO.readCurrentByteWithoutShift(MySQLIO.java:139)
        at com.BoardiesITSolutions.AndroidMySQLConnector.PacketManager.COM_QueryResponse.processPacketData(COM_QueryResponse.java:104)
        at com.BoardiesITSolutions.AndroidMySQLConnector.PacketManager.COM_QueryResponse.<init>(COM_QueryResponse.java:25)
        at com.BoardiesITSolutions.AndroidMySQLConnector.Statement$2.socketDataSent(Statement.java:243)
        at com.BoardiesITSolutions.AndroidMySQLConnector.SocketSender.doInBackground(SocketSender.java:53)
        at com.BoardiesITSolutions.AndroidMySQLConnector.SocketSender.doInBackground(SocketSender.java:11)
boardy commented 4 years ago

Thanks for the extra info, that index out of bounds error is usually caused by the library not being able to parse the MySQL packet correctly. Every version of MySQL and equivalent MariaDB version seems to send a slightly different response which doesn't always agree with the docs so its a little confusing.

I'll see if I can replicate it and hopefully provide a fix.

Thanks Chris

ronnyvillamar99 commented 4 years ago

thanks . help me with that problem please, I'm developing an app to query data, If you want I can also help you a little, I have also worked with TCP sockets, I know a little about it

boardy commented 4 years ago

Hi,

I've not been able to replicate it unfortunately seems to work OK for me. Can you let me know how you installed it, assuming you did, or is it a hosted MySQL server as I've seen hosted servers or different installers sometimes behave differently for some reason.

ronnyvillamar99 commented 4 years ago

with this code I am starting, this works fine, but when I execute an INSERT or UPDATE query it throws me that error


 public boolean initialize()   {

        try {
        mysqlConnection = new Connection(server, user,
                password, Integer.parseInt( port), dbname,new IConnectionInterface()
        {
            @Override
            public void actionCompleted()
            {
                completed=true;

                statement = mysqlConnection.createStatement();
                //You are now connected to the database
                Log.i("DBConnection", "Completed");
            }

            @Override
            public void handleInvalidSQLPacketException(InvalidSQLPacketException e)
            {
                //Handle the error
                Log.e("DBConnection", e.toString());
            }

            @Override
            public void handleMySQLException(MySQLException e)
            {
                //Handle the error
                Log.e("DBConnection", e.toString());
            }

            @Override
            public void handleIOException(IOException e)
            {
                //Handle the error
                Log.e("DBConnection", e.toString());
            }

            @Override
            public void handleMySQLConnException(MySQLConnException e)
            {
                //Handle the error
                Log.e("DBConnection", e.toString());
            }

            @Override
            public void handleException(Exception e)
            {
                //Handle the error
                Log.e("DBConnection", e.toString());
            }
        });
        int count=0;
        while ( completed ==false  ) {
            if (count ==80) {
                Log.e("DBConnection","Error Timeout");
                return false ;
            }
            count++;
           Thread.currentThread().join(100);

        }

        return true ;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
    }

, if SELECT works, the user I use in the database has limited permissions, only basic queries, I don't know if that has anything to do

ronnyvillamar99 commented 4 years ago

this is all my driver code


import android.util.Log;
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StringDef;

import com.BoardiesITSolutions.AndroidMySQLConnector.ColumnDefinition;
import com.BoardiesITSolutions.AndroidMySQLConnector.Connection;
import com.BoardiesITSolutions.AndroidMySQLConnector.Exceptions.InvalidSQLPacketException;
import com.BoardiesITSolutions.AndroidMySQLConnector.Exceptions.MySQLConnException;
import com.BoardiesITSolutions.AndroidMySQLConnector.Exceptions.MySQLException;
import com.BoardiesITSolutions.AndroidMySQLConnector.Exceptions.SQLColumnNotFoundException;
import com.BoardiesITSolutions.AndroidMySQLConnector.IConnectionInterface;
import com.BoardiesITSolutions.AndroidMySQLConnector.IResultInterface;
import com.BoardiesITSolutions.AndroidMySQLConnector.MySQLRow;
import com.BoardiesITSolutions.AndroidMySQLConnector.ResultSet;
import com.BoardiesITSolutions.AndroidMySQLConnector.Statement;

import java.io.IOException;
import java.util.AbstractList;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Dictionary;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.Optional;

import static com.syterox.wholesales.Functions.TABLE_ITEMS;
import static com.syterox.wholesales.MainActivity.db;

public class MySqlDriver implements IResultInterface  {
    Connection mysqlConnection;

    public String server;
    public String port;
    public String dbname;
    public String user;
    public String password;
    ResultSet result;
    public Statement statement;
    boolean completed = false;
    boolean getResult = false;
    public boolean initialize()   {

        try {
        mysqlConnection = new Connection(server, user,
                password, Integer.parseInt( port), dbname,new IConnectionInterface()
        {
            @Override
            public void actionCompleted()
            {
                completed=true;

                statement = mysqlConnection.createStatement();
                //You are now connected to the database
                Log.i("DBConnection", "Completed");
            }

            @Override
            public void handleInvalidSQLPacketException(InvalidSQLPacketException e)
            {
                //Handle the error
                Log.e("DBConnection", e.toString());
            }

            @Override
            public void handleMySQLException(MySQLException e)
            {
                //Handle the error
                Log.e("DBConnection", e.toString());
            }

            @Override
            public void handleIOException(IOException e)
            {
                //Handle the error
                Log.e("DBConnection", e.toString());
            }

            @Override
            public void handleMySQLConnException(MySQLConnException e)
            {
                //Handle the error
                Log.e("DBConnection", e.toString());
            }

            @Override
            public void handleException(Exception e)
            {
                //Handle the error
                Log.e("DBConnection", e.toString());
            }
        });
        int count=0;
        while ( completed ==false  ) {
            if (count ==80) {
                Log.e("DBConnection","Error Timeout");
                return false ;
            }
            count++;
           Thread.currentThread().join(100);

        }

        return true ;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
    }
    @Override
    public void executionComplete(ResultSet resultSet)
    {
        result=resultSet;
        getResult = true;
        Log.d("DBViewFragment", "result");
    }

    @Override
    public void handleInvalidSQLPacketException(InvalidSQLPacketException e)
    {
        Log.e("DBViewFragment", e.toString());

    }

    @Override
    public void handleMySQLException(MySQLException e)
    {
        Log.e("DBViewFragement", e.toString());

    }

    @Override
    public void handleIOException(IOException e)
    {
        Log.e("DBViewFragement",e.toString());

    }

    @Override
    public void handleMySQLConnException(MySQLConnException e)
    {
        Log.e("DBViewFragement", e.toString());

    }

    @Override
    public void handleException(Exception e)
    {
        Log.e("DBViewFragement", e.toString());

    }

    public Hashtable<String,List<String>> executeQueryTable(String query){
        MySQLRow row;
        Dictionary<String, List<String>> table = new Hashtable<>();
        List<String> lr=new ArrayList<>();
        int count = 0;
        try {

        statement.executeQuery(query, this);

        while (getResult==false){
            if(count == 50) return null;
            count++;
           Thread.currentThread().join(100);
        }
        //read content

        for (ColumnDefinition c : result.getFields()) {
            while ((row = result.getNextRow()) != null)
            {
                try{
                    lr.add( row.getString(c.getColumnName()));

                }catch (Exception e){
                    lr.add(new String( row.getBlob(c.getColumnName())));
                }
            }
            table.put(c.getColumnName(), (List<String>) ((ArrayList<String>) lr).clone());
            lr.clear();
        }

        }catch (Exception e){
            e.printStackTrace();

        }
        getResult=false;
        return (Hashtable<String, List<String>>) table;
    }

    public List<List<String>> executeQueryTableRows(String query){
        MySQLRow row;
        List<List<String>> table = new ArrayList<>();
        List<String> lr=new ArrayList<>();
        int count = 0;
        try {

            statement.executeQuery(query, this);

            while (getResult==false){
                if(count == 50) return null;
                count++;
                Thread.currentThread().join(100);
            }
            //read content

            while ((row = result.getNextRow()) != null) {
                for (ColumnDefinition c : result.getFields()) {
                    try{
                        lr.add( row.getString(c.getColumnName()));

                    }catch (Exception e){
                        lr.add(new String( row.getBlob(c.getColumnName())));
                    }
                }
                table.add((List<String>) ((ArrayList<String>) lr).clone());
                lr.clear();
            }

        }catch (Exception e){
            e.printStackTrace();

        }
        getResult=false;
        return (List< List<String>>) table;
    }

    public String executeQueryString(String query) {
        try {

            Hashtable<String,List<String>> table = executeQueryTable(query);
            List<String> l;
            l= table.get(result.getFields().get(0).getColumnName());
            return l.get(0) ;
        }catch (Exception e){
            e.printStackTrace();

        }
        return "";
    }

    public void executeQuery(String query) {
        try {

            statement.execute(query, new IConnectionInterface() {
                @Override
                public void actionCompleted() {

                }

                @Override
                public void handleInvalidSQLPacketException(InvalidSQLPacketException ex) {

                }

                @Override
                public void handleMySQLException(MySQLException ex) {

                }

                @Override
                public void handleIOException(IOException ex) {

                }

                @Override
                public void handleMySQLConnException(MySQLConnException ex) {

                }

                @Override
                public void handleException(Exception exception) {

                }
            });
        }catch (Exception e){
            e.printStackTrace();

        }
    }

    public String select(String table,String s, String cname, String value ){
        String data="";
        data = this.executeQueryString("SELECT "+s+" FROM "+ table +" WHERE "+cname +" = '"+value+"'"  );
        return data;
    }

    public boolean exist(String table, String id){
        String data = "";
        data = select(table,"id","id",id);

        return (data == "") ? false:true;
    }

    public int getMaxId(String table, String cname){
        String res =db.executeQueryString("SELECT MAX("+cname+") FROM "+table );

        return (res == null)? 0: Integer.valueOf(res );
    }
    public void close(){
        mysqlConnection.close();
    }
}

I am doing something wrong?

boardy commented 4 years ago

I'm trying to replicate your code, but having a bit of confusion.

Are you definitely using the tag 0.37_MSQL8 as I've just noticed the getBlob method isn't in the MySQL8 branch but its in the master branch. If you are accidently using the master branch that might be why you are having this issue as the recent fixes I've done in the branch only.

This might be why I can't see the issue you are having as I think you might be using the master branch where as I'm using the MySQL 8 release branch.

I have found an issue which I can release as it wasn't parsing the packet correctly if a MySQL error occurred but was different behaviour to what you were seeing. I'll ideally release this with a fix for you if you need one.

Thanks Chris

boardy commented 4 years ago

Further to my comment above. I've used your class code that you gave me and what you've done appears to work OK.

I've added the getBlob method into the MySQL8 branch so when I release this you'll have access to this as well, but the connection, select and insert seems to work OK using your code.

The only comment I'd have is I wouldn't rely on doing thread joins with timeouts as I'd imagine your going to hit some weird timing issues potentially with larger data sets/slower devices/slower network connections and should just rely on the call backs from the library to know what step has been completed.

I'm in the process of doing a new release 0.39_MySQL8. Its on GitHub just waiting for JitPack to do the build which is for some reason taking a long time so haven't had a chance to test yet so might not be able to confirm the release is OK until the morning.

Thanks Chris

ronnyvillamar99 commented 4 years ago

I'm trying to replicate your code, but having a bit of confusion.

Are you definitely using the tag 0.37_MSQL8 as I've just noticed the getBlob method isn't in the MySQL8 branch but its in the master branch. If you are accidently using the master branch that might be why you are having this issue as the recent fixes I've done in the branch only.

This might be why I can't see the issue you are having as I think you might be using the master branch where as I'm using the MySQL 8 release branch.

I have found an issue which I can release as it wasn't parsing the packet correctly if a MySQL error occurred but was different behaviour to what you were seeing. I'll ideally release this with a fix for you if you need one.

Ah, if I'm using version 0.28 of your library, I used that because I was testing with another version of mysql and it gave me many errors and I decided to use that one because it seemed to work well, but later when I started using the INSERT query it started giving me problems,

oh and about the getBlob function I use it because it gave me an error with the type of data it had, when it was an integer or decimal an error would jump, but using that function it no longer gave me problems and I decided to keep it that way

ronnyvillamar99 commented 4 years ago

I was using version 10 of mysql, I thought that it would work with the MYSQL8 version of its library, but it gave me errors, so I thought that this library was specific to mysql8 and not the rest

I will try to prove that he recommends it to me,

oh and if that code does not give an error because what I did was not to use statement.executeQuery (query, this);

instead

statement.execute (query, {...});

in the function

public void executeQuery (String query)

there it worked although a little slow, or will it be my pc haha,

good thank you very much I will try the version that you recommend and I will notify you if you throw any error

oh yes, if you can include the getBlob () function it would be great since I also save bytes of image data in my database

boardy commented 4 years ago

Ah OK. Yea you're better off using the MySQL8 branch releases although they're marked as pre-release these are much more likely to work as this branch has received many bug fixes for different MySQL versions and hosts.

I think you should be able to use 0.37_MySQL8 but you won't have access to the getBlob method.

Eventually 0.39_MySQL8 should be available once JitPack is finished, I'm not sure what's taking it so long, I think they're experiencing an issue as I can't sign in to it either via GitHub so hopefully that should be available in the not too distant future. This will have the getBlob method as well as a fix for it not parsing MySQL error packets correctly.

The MySQL 8 branch initially started as a branch for me to implement the changes for MySQL8 authentication but had to shelve it as the time there wasn't any libraries that I could find that implemented it, then as other issues got raised they got implemented into this branch instead of the master.

With hindsight I should have branched again from the master to a pre-mysql8 branch for these fixes to avoid confusion. I'll add a note on the readme for the time being.

FYI you can use MySQL 8 just as long as its using the mysql_native_password for authentication not the new SHA_Caching2 method.

Thanks Chris

ronnyvillamar99 commented 4 years ago

ah i have another problem i am using version 0.37 When I make a SELECT query, only one row appears, am I doing something wrong? are there different functions for a multi-row query?

boardy commented 4 years ago

I think that might be a logic problem within your own code as it looked to work OK for me.

I'm not 100% sure what you're code is doing with the hashtables, I'd prob try and simplify it to the bare bones to prove where the issue is.

e.g. just do a select query and loop over each row and just log out the values and then build up the code to what you need.

FYI looks like 0.39_MySQL8 tag is available now.

Thanks Chris

boardy commented 4 years ago

Hi. Did you manage to get this working on ok in the end of you do you need some help.

If you weren't aware there is a demo app within the library that shows how it works.

Thanks

Chris

ronnyvillamar99 commented 4 years ago

Hi, I have left the project on pause, tomorrow it continued, the last thing I did was try with version 0.37, but I had the problem that the rows did not arrive complete, only the first one, but not the last one tested, tomorrow I will do it and I will review the test app, it will help me a lot, thanks, tomorrow I will notify you of any error or if it was solved

ronnyvillamar99 commented 4 years ago

Hello, the initial problem has been solved, I have had some more but it was due to my code but I have solved it,

Now that another error has arisen, it sends me the result of the query well, up to half, from there is the rest all mixed up, as the rows have not been well separated, I have a code to see how many rows arrive, and it appears to me that There are only 5 rows when there are actually 10,

I would like to share the complete code with you, so you can help me, I don't know if it is an error of mine or of the library

ronnyvillamar99 commented 4 years ago

this is the debugger section

D/Connection: Packet Sequence Number Returned: 0
D/MySQLIO: Resetting Socket: Don't Expect Response: false
    Reading Socket Data
    Created baos
D/MySQLIO: Read from socket. Bytes Read: 1024
    BAOS written: Bytes Written: 1024
    Read from socket. Bytes Read: 874
    BAOS written: Bytes Written: 874
D/MySQIO: Less than 1024 Bytes Returned. Packet Type at end of array (end of array would have to be an OK: 0
D/MySQLIO: Loop completed
    Get Socket Data Finished. Full Data Length: 1898
D/MySQLIO: Full data written to: now size: 1898
D/Statement: ABOUT TO CREATE COM_QUERY_RESPONSE
D/Query Response: Packet Length: 1 Packet Sequence: 1
D/COM_QueryResponse: Number of Fields: 15
D/MySQLIO: About to pop extracting data
D/DBViewFragment: result
I/MYSQL Driver: Table size 5

//this is from my code
I/SEARCH: count:5

can you add a section for get the tables in json?

I do not know if that is possible or if it will make the app slower, but if you could do it it would be great, since this would get the entire table, and I would take care of processing it

boardy commented 4 years ago

Good news that its working now. Not sure why there's less rows as it seems to be OK for me.

Below is the out I get when I run the query.

ABOUT TO CREATE COM_QUERY_RESPONSE
Packet Length: 1 Packet Sequence: 1
Number of Fields: 4
GOT EXECUTION COMPLETE AND PROCESSING RETURNED RESULTSET
Rows Found: 20
Row Number: 2
Row Number: 3
Row Number: 4
Row Number: 5
Row Number: 6
Row Number: 7
Row Number: 8
Row Number: 9
Row Number: 10
Row Number: 11
Row Number: 12
Row Number: 13
Row Number: 14
Row Number: 15
Row Number: 16
Row Number: 17
Row Number: 18
Row Number: 19
Row Number: 20
Row Number: 21

This is using the below code.

statement.executeQuery("SELECT * FROM test", new IResultInterface() {
            @Override
            public void executionComplete(ResultSet resultSet)
            {
                Log.d("MainActivity", "GOT EXECUTION COMPLETE AND PROCESSING RETURNED RESULTSET");
                MySQLRow row;
                Log.d("MainActivity", "Rows Found: " + resultSet.getNumRows());
                while ((row = resultSet.getNextRow()) != null)
                {
                    try
                    {
                        //Log.d("MainActivity", "Field Name: " + row.getString("FieldName") + " Field ID: " + row.getInt("id"));
                        //String field1 = row.getString("Field1");
                        int id = row.getInt("id");

                        Log.d("MainActivity", "Row Number: " + id);

                        //Log.d("MainActivity", "Field1: " + field1 + " id: " + id);
                    }
                    catch (SQLColumnNotFoundException ex)
                    {
                        Log.e("MainActivity", ex.toString());
                    }
                    catch (Exception ex)
                    {
                        Log.e("MainActivity", ex.toString());
                    }
                }
            }

I'm not sure I want to add a get JSON for the table data that is returned as the idea of this library is to keep it as close in terms of functionality to the official connectors for normal devices such as PC for example so I think to get JSON representation is more of app logic side then library side. If I find other connects do offer this then sure I'll add it in.

If you want to send me your code to see if I can figure out what the issue is then feel free, you can send it to chris @ boardiesitsolutions.com.

If you can also send the database table definition and some fake data to populate it with that exhibits the problem that would be great, just in case there's some quirky bug where the data in the table is causing some unexpected behaviour - obviously don't give me any personal data :)

Thanks Chris

ronnyvillamar99 commented 4 years ago

Hello, I have sent my code to your email, thanks in advance for the help, I also include the database that I use,

So far it works a bit well, but I have that problem, with my strange code I hope you can correct it, haha

boardy commented 4 years ago

Hi, what email did you send it to as it doesn't seem to have to come through to me.

Thanks

Chris

On Mon, 8 Jun 2020, 23:36 Ronny Villamar, notifications@github.com wrote:

Hello, I have sent my code to your email, thanks in advance for the help, I also include the database that I use,

So far it works a bit well, but I have that problem, with my strange code I hope you can correct it, haha

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/BoardiesITSolutions/Android-MySQL-Connector/issues/16#issuecomment-640923177, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCS2M6T33H3B6K5XGY67XTRVVRVHANCNFSM4NJC3BPA .

boardy commented 4 years ago

Version 0.40_MySQ8 has been released to resolve this issue.

The issue was related to a BLOB column with an empty string affecting how the library processed the MySQL packet as when it looked at the length of the data which is 0, this was treated as a MySQL EOF packet and therefore thought it was the end of the row which caused corrupted row data and/or missing rows.

boardy commented 4 years ago

Issue confirmed resolved in version 0.40_MySQL8