Is there any support to sql server compact on android yet? - java

I was developing my application on windows mobile using sql server compact successfully, what I need now does this sql server compact is supported on android sdk ? One thing I want to use sql server compact on android instead of sql lite because of the database engine can read data in multiple thread / multiple connectivity at the same time when performing table lookup while the other connection is reading table. I cannot perform this action on sqllite, sqllite use file locking on its engine.
Does anyone facing this kind of problem like I did ?

In it's current form, sql server can't yet be supported by Android, which is why there is sql lite.

Related

Saving data from android app to remote server

I am just a beginner in android app development and that's why I have many doubts. I am building one application where the user enters some data in editText. Now I want to save that data in my database. My database is running on my laptop. How would my app connect to the database? Do I need a web server in between? If yes then which web server is used for Android apps? Basically, i want to know the flow of data from app to the database.
Study more from Udacity.com, its free.
You may use a jdbc Connector to connect to database.
Connect your jdbc connector over local network ip\servername and database connection string
You can use REST Service when it comes to web Service on Android like this. You can either pass the values as parameters or an Object depending on your requirement. All the best
Wamp server is best option to play with server related utilities.You can use it even if you are offline. and it provides various option for data storage. It Mainly uses MySql and PHP scripts for fast performance.
For More details Click Here

Is it possible to connect an Android application to MySQL database, without Async tasks?

I'm learning Android development and mostly to retrieve data from the server side databases,I use Async tasks, to obtain data from PHP and MySQL.
I want to know whether is it possible to connect the android application directly to the MySQL database.What would be the adverse effects of doing so? And is there any example on how to perform CRUD operations using such direct MySQL connection?
According to: https://developer.android.com/reference/android/os/NetworkOnMainThreadException.html
you can't networking in main thread and according to:
Can an Android App connect directly to an online mysql database
Connecting to MySQL from Android with JDBC
Direct connection to MySQL in Android is not recommend/not possible.
If you anytime feel like using different Networking Calls. Use Volley, it is fast and better than Asynctask request. As per your question network calls are not possible on Main UI.
Try reading more about Volley which google introduced in 2013. A very good MySQL CRUD example on my blog. here

Java + Ms SQL Server 2008 R2 after insert trigger notification

I need to write web application using java webgui Vaadin Framework which will be real-time updated with new records inserted to MsSQL database by MsWin2k8R2 NPS.
Since NPS stores logs to files and/or DB, I prefer DB, but I'd like to know how my java program can be notified by SQL server when NPS server inserts data to database and then re-fetch or extract from SQL server notification and display it in browser.
I already have Java<->Ms SQL connection established.
What I already know:
SqlDependency class could be used but it is only for .NET and I'm working in Java
SQL Server Service Broker - this is some kind of a feature in SQL Server which can be used for this but I currently don't understand correctly how to do it and what it really is
SQL Extended Events - same as above
SQL Notifications - same as above
SQL CRL Triggers - trigger written in C++, C# or maybe in Java which is executed on specified situation but this is done synchronously and will slow down whole operation
Now. I've found this post:
https://stackoverflow.com/a/534831/1235977
I would suggest having a trigger on the table that calls the SQL Server Service Broker, that then (asynchronously) executes a CLR stored procedure that does all your work in a different thread.
But I don't know how to do this.
So what I need is:
Simple table in SQL Server which when inserted data into will notify my Java program somehow. It can be using REST web services, JMS or anything what is language independent.
Please provide step by step examples/solutions.
You can use trigger functionality of SQL.
There is a solution:
SQL Triggrer for table that calls Stored procedure
The stored procedure calls some c# code that will REST service by http.
Your back-end will process http requestes from stored proc.

Connect Android App on a PC-based database

I'm creating an Android App that would have to access a database on my PC. I know how to program in Java and access a MySQL on my PC using JDBC ODBC. Could anyone lead me to the right place?
android don't support jdbc.
why don't you make a application-server?
the architecture is this.
Android <<--(using REST/JSON)-->>Application-Server(including JDBC or ODBC) <<-->> Database
using json or rest is good to reduce data traffic.
and generally the application server is faster than Android device.

Google App engine external database

I've been searching and can't find an answer anywhere. I also haven't had time to try it out either.
Is it possible, using java in the Google App Engine (GAE), to connect to a remote database. Whether it MySql, SQLServer, etc. Will it be allowed to make calls outside of it's domain? Is it possible to even use the required libraries to make such a connection?
The closest thing that you will find is the Google Secure Data Connector. All connections outbound from GAE are HTTP based, so you're very unlikely to get a jdbc type connection to a database server (MySql, SqlServer, etc).
IMHO you can try to tunnel JDBC through HTTP. It is possible. For example here is free solution http://sourceforge.net/projects/sqlgateway/ and here commercial http://www.idssoftware.com/jdbcdrv.html :)
I do this all the time using a REST API on the server that contains the database. Depending on your needs (eg, do you need ad-hoc queries) you may want to choose a REST API with some flexibility.
There are quite a few simple REST-DB libraries around, such as http://phprestsql.sourceforge.net/
Though you may want to simply roll your own using http://www.playframework.org/ or http://guides.rubyonrails.org/getting_started.html#rest
Dont use HTTP for DB connections as it is less secure.
Use CLoud SQL instead (jdbc type connection, mysql like queries and drivers in jars)
getting started with cloud sql
an easy video for java + cloud sql + app engine

Categories