Maespi
Maespi

Reputation: 45

ORMLite with Android DB Connection

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.

Upvotes: 1

Views: 882

Answers (1)

Louis Solo
Louis Solo

Reputation: 136

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:

Upvotes: 2

Related Questions