ORMLite with Android DB Connection











up vote
1
down vote

favorite












I have a server and I am using ORMLite for the connection with the server, however I had seen the examples but in the task of creating the connection don't know how to do it without using JDBC.



// create a connection source to our database
ConnectionSource connectionSource =
new JdbcConnectionSource('jdbc:mysql://internetserver/');



I had seen a lot of posts that says how JDBC is not right in Android but I see no examples and no updated posts that explains the best/most correct way to do a DB connection for an ORM with Android. Just to make you know, my idea are shops with data alocated on the cloud, and then to take that information and create the objects that are active in the DB.










share|improve this question


























    up vote
    1
    down vote

    favorite












    I have a server and I am using ORMLite for the connection with the server, however I had seen the examples but in the task of creating the connection don't know how to do it without using JDBC.



    // create a connection source to our database
    ConnectionSource connectionSource =
    new JdbcConnectionSource('jdbc:mysql://internetserver/');



    I had seen a lot of posts that says how JDBC is not right in Android but I see no examples and no updated posts that explains the best/most correct way to do a DB connection for an ORM with Android. Just to make you know, my idea are shops with data alocated on the cloud, and then to take that information and create the objects that are active in the DB.










    share|improve this question
























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I have a server and I am using ORMLite for the connection with the server, however I had seen the examples but in the task of creating the connection don't know how to do it without using JDBC.



      // create a connection source to our database
      ConnectionSource connectionSource =
      new JdbcConnectionSource('jdbc:mysql://internetserver/');



      I had seen a lot of posts that says how JDBC is not right in Android but I see no examples and no updated posts that explains the best/most correct way to do a DB connection for an ORM with Android. Just to make you know, my idea are shops with data alocated on the cloud, and then to take that information and create the objects that are active in the DB.










      share|improve this question













      I have a server and I am using ORMLite for the connection with the server, however I had seen the examples but in the task of creating the connection don't know how to do it without using JDBC.



      // create a connection source to our database
      ConnectionSource connectionSource =
      new JdbcConnectionSource('jdbc:mysql://internetserver/');



      I had seen a lot of posts that says how JDBC is not right in Android but I see no examples and no updated posts that explains the best/most correct way to do a DB connection for an ORM with Android. Just to make you know, my idea are shops with data alocated on the cloud, and then to take that information and create the objects that are active in the DB.







      android sql-server android-studio database-connection ormlite






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 8 at 8:27









      Maespi

      155




      155
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          I have not worked with ORMLite for a long time (it's too old, weak and leak of documentation). On Android you don't use JDBC to create database connection.I will give you some suggestions:




          1. To make a database connection on Android, we have SQLiteOpenHelper. You can read further information from: https://developer.android.com/reference/android/database/sqlite/SQLiteOpenHelper. But now a day, no one wants to execute raw queries.

          2. There are some strong ORM libraries that you can choose:


            • Active Android: https://github.com/pardom-zz/ActiveAndroid. Easy to use, just configure database name, version, schema and use.

            • Realm: https://github.com/realm/realm-java. It's not SQLite, you can use for both Android and iOS.

            • Room: https://developer.android.com/topic/libraries/architecture/room. Introduced by Google (Recommended)








          share|improve this answer








          New contributor




          Louis Solo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.


















          • And How it would be for a remote Database?
            – Maespi
            Nov 8 at 19:19










          • If you want to store your data in cloud, you can use Firebase storage.
            – Louis Solo
            2 days ago











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53203880%2formlite-with-android-db-connection%23new-answer', 'question_page');
          }
          );

          Post as a guest
































          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote



          accepted










          I have not worked with ORMLite for a long time (it's too old, weak and leak of documentation). On Android you don't use JDBC to create database connection.I will give you some suggestions:




          1. To make a database connection on Android, we have SQLiteOpenHelper. You can read further information from: https://developer.android.com/reference/android/database/sqlite/SQLiteOpenHelper. But now a day, no one wants to execute raw queries.

          2. There are some strong ORM libraries that you can choose:


            • Active Android: https://github.com/pardom-zz/ActiveAndroid. Easy to use, just configure database name, version, schema and use.

            • Realm: https://github.com/realm/realm-java. It's not SQLite, you can use for both Android and iOS.

            • Room: https://developer.android.com/topic/libraries/architecture/room. Introduced by Google (Recommended)








          share|improve this answer








          New contributor




          Louis Solo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.


















          • And How it would be for a remote Database?
            – Maespi
            Nov 8 at 19:19










          • If you want to store your data in cloud, you can use Firebase storage.
            – Louis Solo
            2 days ago















          up vote
          1
          down vote



          accepted










          I have not worked with ORMLite for a long time (it's too old, weak and leak of documentation). On Android you don't use JDBC to create database connection.I will give you some suggestions:




          1. To make a database connection on Android, we have SQLiteOpenHelper. You can read further information from: https://developer.android.com/reference/android/database/sqlite/SQLiteOpenHelper. But now a day, no one wants to execute raw queries.

          2. There are some strong ORM libraries that you can choose:


            • Active Android: https://github.com/pardom-zz/ActiveAndroid. Easy to use, just configure database name, version, schema and use.

            • Realm: https://github.com/realm/realm-java. It's not SQLite, you can use for both Android and iOS.

            • Room: https://developer.android.com/topic/libraries/architecture/room. Introduced by Google (Recommended)








          share|improve this answer








          New contributor




          Louis Solo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.


















          • And How it would be for a remote Database?
            – Maespi
            Nov 8 at 19:19










          • If you want to store your data in cloud, you can use Firebase storage.
            – Louis Solo
            2 days ago













          up vote
          1
          down vote



          accepted







          up vote
          1
          down vote



          accepted






          I have not worked with ORMLite for a long time (it's too old, weak and leak of documentation). On Android you don't use JDBC to create database connection.I will give you some suggestions:




          1. To make a database connection on Android, we have SQLiteOpenHelper. You can read further information from: https://developer.android.com/reference/android/database/sqlite/SQLiteOpenHelper. But now a day, no one wants to execute raw queries.

          2. There are some strong ORM libraries that you can choose:


            • Active Android: https://github.com/pardom-zz/ActiveAndroid. Easy to use, just configure database name, version, schema and use.

            • Realm: https://github.com/realm/realm-java. It's not SQLite, you can use for both Android and iOS.

            • Room: https://developer.android.com/topic/libraries/architecture/room. Introduced by Google (Recommended)








          share|improve this answer








          New contributor




          Louis Solo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          I have not worked with ORMLite for a long time (it's too old, weak and leak of documentation). On Android you don't use JDBC to create database connection.I will give you some suggestions:




          1. To make a database connection on Android, we have SQLiteOpenHelper. You can read further information from: https://developer.android.com/reference/android/database/sqlite/SQLiteOpenHelper. But now a day, no one wants to execute raw queries.

          2. There are some strong ORM libraries that you can choose:


            • Active Android: https://github.com/pardom-zz/ActiveAndroid. Easy to use, just configure database name, version, schema and use.

            • Realm: https://github.com/realm/realm-java. It's not SQLite, you can use for both Android and iOS.

            • Room: https://developer.android.com/topic/libraries/architecture/room. Introduced by Google (Recommended)









          share|improve this answer








          New contributor




          Louis Solo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          share|improve this answer



          share|improve this answer






          New contributor




          Louis Solo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          answered Nov 8 at 9:28









          Louis Solo

          862




          862




          New contributor




          Louis Solo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





          New contributor





          Louis Solo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.






          Louis Solo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.












          • And How it would be for a remote Database?
            – Maespi
            Nov 8 at 19:19










          • If you want to store your data in cloud, you can use Firebase storage.
            – Louis Solo
            2 days ago


















          • And How it would be for a remote Database?
            – Maespi
            Nov 8 at 19:19










          • If you want to store your data in cloud, you can use Firebase storage.
            – Louis Solo
            2 days ago
















          And How it would be for a remote Database?
          – Maespi
          Nov 8 at 19:19




          And How it would be for a remote Database?
          – Maespi
          Nov 8 at 19:19












          If you want to store your data in cloud, you can use Firebase storage.
          – Louis Solo
          2 days ago




          If you want to store your data in cloud, you can use Firebase storage.
          – Louis Solo
          2 days ago


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53203880%2formlite-with-android-db-connection%23new-answer', 'question_page');
          }
          );

          Post as a guest




















































































          Popular posts from this blog

          Schultheiß

          Verwaltungsgliederung Dänemarks

          Liste der Kulturdenkmale in Wilsdruff