1

I'm currently creating an android application and need to connect to a InterSystems cache (ODBC) database, this is the first time I have developed for android and have never connected to a database in java in the past, any help will be appreciated.

Vlasec
  • 5,500
  • 3
  • 27
  • 30
ccStars
  • 817
  • 2
  • 11
  • 34

2 Answers2

2

For Android development, I would highly recommend to use web services or Rest instead of ODBC. But there is a standard JDBC Java documentation (not sure if it will work in Android at all though):

http://docs.intersystems.com/cache20131/csp/docbook/DocBook.UI.Page.cls?KEY=ITECHREF_jdbc

You can also have a look at newer Zen Mobile framework designed specially for iOS/Android Cache development, ask for a copy in WRC

SSH
  • 2,533
  • 16
  • 21
0

Do you really think it's a good idea to connect to the DB right from the user app? Accessing directly from user app to the DB is usually bad for you. I don't say "don't do it". Caché allows you to grant privileges to individual tables in SMP. (But you can't let the user to only access some records of a table.)

I know InterSystems Ensemble can communicate using SOAP, I am not sure about just Caché and REST, you would have to do a research of your own. However, I think it's a better idea than accessing the DB directly from the client. You could also cause problems with database's integrity by doing so.

Vlasec
  • 5,500
  • 3
  • 27
  • 30
  • You always could implement REST in Caché, with 13.2 this will be made even easier. Wether you then use SOAP or JSON or something completely different is then completely up to you. – kazamatzuri Jun 26 '13 at 17:44
  • Well, yeah, REST is quite lightweight anyway, and using JSON as format of data exchange is good, but XML wouldn't be that bad either. One way or another, still better than direct DB access from a phone. – Vlasec Jun 27 '13 at 08:21