B4J Question from SQLite to MySQL

Discussion in 'B4J Questions' started by Pilar-JLSineriz, Jul 21, 2015.

  1. Pilar-JLSineriz

    Pilar-JLSineriz Active Member Licensed User

    Hello,

    I am making an APK that works with a database SQLITE. I want to design a button in the APK that transform the SQLITE file in a SQL file that can be to read by SQL Server.

    For example, I am taking data about the properties of the different mineral waters and the data are stored in a SQLITe database, but I want that the database can be read in SQL Server. I want to put a button in the APK so that when the user finishs to take data, push the bottom and the APK generates a SQL file with the mineral waters data, that the user can be to send it by email or copy in a pen-drive so after it can be copied in the Server and it can be read with SQL Server.

    Many thanks
     
  2. giga

    giga Well-Known Member Licensed User

    Just to be clear. Are you talking about MYSQL Server on Microsoft SQL Server?
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    It is not possible to convert the SQLite database to a SQL Server database on the device.

    You can create a desktop tool with B4J that connects to the SQL Server, reads the data from the SQLite database and writes it to the SQL Server.
     
  4. Pilar-JLSineriz

    Pilar-JLSineriz Active Member Licensed User

    Thanks Erel, I understand you.. my problem is that I don´t know as I can create a desktop tool, where could I learn??

     
  5. Pilar-JLSineriz

    Pilar-JLSineriz Active Member Licensed User

    Microsoft SQL.. thanks!
     
  6. giga

    giga Well-Known Member Licensed User

    I have researched this somewhat. As Erel has said I don't believe there is a ability to convert it on the device. Use B4J to read the SQLite database and send it to SQL Server.

    (Never used it but)
    I have found a third party program already made that does this.
    https://convertdb.com/sqlite/mssql
     
  7. Erel

    Erel Administrator Staff Member Licensed User

  8. Pilar-JLSineriz

    Pilar-JLSineriz Active Member Licensed User

    Thanks Erel!!! I am going to try it!
     
  9. Pilar-JLSineriz

    Pilar-JLSineriz Active Member Licensed User

    SQlite Browsers offers the possibilty to export the sqlite file in csv or sql format, is there any function in B4J or B4A that transform the sqlite file in sql format or I need B4J to read the database and to send it to the server? thanks
     
  10. Erel

    Erel Administrator Staff Member Licensed User

    You can export the data to a CSV file quite easily. See StringUtils.SaveCSV.
     
  11. Pilar-JLSineriz

    Pilar-JLSineriz Active Member Licensed User

    Thanks Erel, as I am seeing that there is not the posibility to create a SQL file, I have to look other solution. I have the idea to write the same SQL instruction that I am writting in the code in a text file at the same time. In this way I'll have a file text with SQL instructions that could be execute by the Server. Now I have to learn as I can do it.
     
Loading...