Connecting to a Cache (InterSystems) Database using Java - java

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.

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

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.

Related

Synchronizing Google App Engine DataStore with local instance via Datanucleus REST API or some other Java API

I'd like to know if someone can guide me in this aspect, as everything I know is that Datanucleus REST API may help into making the contents of my local Google App Engine datastore and the online one the same, but there might be also another way to do that which is easier, as I'm having great difficulties to understand how could might be done via that API. Application has been done in Java so there's no point in trying to develop it into phyton know, it's way too late for that now.
Thanks a lot for your interest.
Edit: Well I actually found some interesting tools here: http://www.appwrench.onpositive.com, but it would be better for my application if I could done by code as it would need to be executed automatically once a day, so if you know of some not too hard way to achieve what I'm telling I'll be grateful if you tell me so, if not I'll just stick with the tools.
I don't know DataNucleus, but you can connect GAE Datastore from local machines using Remote API
you can use Remote API to access a production datastore from an app
running on your local machine. You can also use Remote API to access
the datastore of one App Engine app from a different App Engine app.
With this, you can code an app to synchronize the data

Standalone DB with Hibernate

I have to develop a Spring MVC project. This give user the possibility to work online using normal web access. I also need to give user possibility to work offline.
So I want to develop a standalone java app that the users can install on theirs pc. They can exchange data with server using JSON with Jackson for example.
My question is about the client side. Supposing to handle data with an ORM like Hibernate, which standalone db are best suited for avoid to install DBMS (like mysql, mssql, ...)?
I want to avoid install many software on client.
I have developed a project like this, where the clients are Android tablet, the ORM tool is ormlite and the db sqlite. The db consist in a file.
Thank you for any response!!
Marco
I'd actually recommend H2 Database over Apache Derby. I've used both, and found that Derby can be difficult to configure and access in a non-embedded manner (which may not be an issue for you, but it was for me).
H2 was faster also.
Apache Derby works well locally, is embeddable, fast and small (2.5 MB).
If you are more comfortable working with "officially supported" products, you could go with JavaDB - it's Derby in disguise.

Database Options for Blackberry

Okay, I'm new to blackberry development and I was wondering if anyone could give me a list of database options available for blackberry applications? What do developer's "normally" do when faced with the requirement of utilizing a server for their blackberry applications? Is there any one specific database that is used for a majority of the applications (like Oracle?) out there now for blackberry? I did a Google search, but all I got back was old stuff that I'm sure has improved by now. I'm looking for some tutorial or explanation on how to remote connect to a database. Thanks for any help and advice you can give to a new blackberry developer!
Blackberry OS versions 5 and up include SQLite on the device. All devices have a proprietary storage mechanism called the Persistent Store. (You may have to use it if you need broad device support). There also the old cruddy J2ME 'record store' mechanisms.
I'd direct you to this page. It lists the current storage solutions for the Blackberry, and allows you to choose the best one for you.
Data Storage Overview - BlackBerry
As one previous poster suggested, SQLite is certainly a good option. It will allow you to have the flexability to use the same Database framework for other mobile apps - Android, iOS and Symbian all have the ability to use SQLite.
However, SQLite does come with some drawbacks. Query size, and pre-loading the database into RAM are probably the biggest two (so big queries and databases can be tricky) as well as the fact that your app will not be available to any pre-OS5 phones.
You should refer to this page for more information on that.
SQLite Overview - BlackBerry
Hope this helps,
Stuart
Check out this answer for more database options for devices running an OS version less than 5 (i.e. your friend's 8120).

Using Blackberry to access an Oracle Database?

I really hope would know how to do this cause I'm a total newbie to Blackberry development.
Basically, I was asked to write a brief report on how a blackberry would access a DB server like Oracle, and I don't know how a blackberry works well enough to figure this out. I tried searches for blackberry DB on Google and I always end up with blackberry viewer plus app for $39.99.. which is really annoying.
If anyone has done this or now how to point me to any good articles or tutorials or some code that explains how this would work that'd be awesome!!
In case you need access to an application which backend runs on Oracle, the best thing you can do is access your database through an Application Server (Java, PHP, .NET).
This way, you communicate with your Database through a common application level protocol like HTTP, SOAP/HTTP, or whatever you can use natively on your Blackberry device. You don't need to provide your device with direct communication with the Oracle database which not only is easier but more secure.
Since you code your Blackberry apps in Java, you can be positive that you will have plenty support to do HTTP request and process its responses in your application.
Your Application will communicate with Oracle with its native protocol probably through a driver (JDBC, ADO.NET, PHP's oci wrapper) depending on the technology you pick.
Everything Pablo said and some links ->
blackberry.com/eng/developers - Start to understand Blackberry Development
J2EE on Blackberry - Beginning J2ee on Blackberry
http://wbw-adc.oracle.com/technology/pub/articles/bors-adfmobile.html - Really good overview By Oracle on them and Blackberry.

How to take a Java Web-application offline?

We develop Java Web-aps (Websphere, DB2) which display graphical and databased information. We would also like to offer the same application offline (distribution via CD/DVD) with online data-update. We have tried a number of alternatives in the past, but nothing has been really stable. What are the new best practices to take a Web ap plus data (in a small database) offline?
I don't know how well it works with the CD/DVD distribution front, but the first thing that comes to mind is Gears. On the .NET side of the fence there's Silverlight 2. Then there's the Mozilla Prism project, although I don't know how far advanced that is.
These are all designed for not just offline access, but mixed offline/online, talking to a server when it's available and working locally when necessary.
I'd suggest using Apache Derby as the database (also available as Sun's Java DB, and possibly still IBM Cloudscape (does that still have DB2 compatibility in place?)).
I'm sure there's plenty of Web servers/Servlet containers about. Apache Tomcat is the obvious one. An alternative approach would be to use an embedded native browser within a single Java process. That approach should be relatively hassle free for users and tech support, and you can just use WebStart to install and update.
If you're using EJBs and other nonsense, then there are similar freebies about. I understand Sun Glassfish is nice and fast starting.
You could create an image of your server as a VMware instance and distribute it with a copy of VMware player (licensing allowing of course). Personally I'd build it on top of a Linux distribution like CentOS5.
You can bundle a JRE along with JETTY server and use a different database e.g HSQLDB (that you can bundle inside the webapp itself).
If you are using an ORM tool to connect to database, you might not have to make many code changes for this.
A lot of Application server distribute their admin consoles like this.For e.g Weblogic admin console runs offline (it uses internal ldap server for its database)
Also as far as Google gears is concerned, they are also pretty much doing the same thing.
They have a server that is bundled along with SQLDB and they allow to synchronize the data between online offline app.
You can sync the data too (use webservices in the online app) and talk over https from the offline app to sync the data, if you need the sync feature.
Also you can check this link
http://developers.sun.com/learning/javaoneonline/2007/pdf/TS-69700.pdf

Categories