I want to install MySQL on my Server and create a database and access my database through my Android Code. I know that this work can be done through webservice in Android, is there any way that I can use it without webservice. I don't find anything related to this. Please provide any links useful for this kind of work.
Asked
Active
Viewed 161 times
1
-
you can directly call using jdbc odbc jar – Mahadev Dalavi Jun 21 '16 at 04:46
-
1@MahadevDalavi I really doubt that. – Bharatesh Jun 21 '16 at 04:49
-
@skadoosh Can u suggest something else or post reason of your doubt. – Rakesh Yadav Jun 21 '16 at 04:54
-
check here http://stackoverflow.com/questions/12233145/connecting-to-mysql-from-android-with-jdbc – Bharatesh Jun 21 '16 at 04:56
1 Answers
0
Yes you can write one restful web-service which will interact with your MySql database, and then you can integrate the service with your android code.
To connect your java code to MySql, you can simply use
JDBC
orhibernate
.To integrate and consume the restful web service, you can use
spring-android-rest-template(to call web service) and jackson-databind(to get responce in JSON format)
jars. You should read once this link. I have also used the same for my android app, and It is working. Its really easy to learn and use. It will take hardly 30 min. to understand it.

pbajpai
- 1,303
- 1
- 9
- 24
-
the problem is I want to avoid creating web service. Can u suggest some link to create a simple web service. – Rakesh Yadav Jun 21 '16 at 09:55
-
You can use Spring @RestController annotation to create a simple RESTful webservice, Please check this link, its very easy: https://spring.io/guides/gs/rest-service/ – pbajpai Jun 21 '16 at 10:05