Connection between Java program and website - java

I'm still new to java programming and web application development, though I just want to ask is it possible to create a java program and a website that has a single database(most preferably phpmyadmin) meaning the java program and the website are more likely connected through the use of this particular database. If what I'm suggesting is not possible then is their a way to create a java program that is directly connected to the website?

is it possible to create a java program and a website that has a
single database
yes, your Web-database-server should be configured to allowe remote connections
but this is not recommended due to security issues.
alternative: using web services
most preferably phpmyadmin
phpmyadmin is just a grafical web user interface which enables the admin of a Database to manage SQL Services

Related

Read and display SQL table from network on Android application using SQLite [duplicate]

I am developing an application which is associated with a website. My application home screen contains login and register buttons. In user registration, all field values have to be stored in SQL Server.
Is it possible to connect to SQL Server from a mobile Android application? If so how?
On your website, I would create services that expose just the information you will need in your Android application. Never pass SQL strings. As Robin said, that's a major security issue. Then just consume these services in your app.
That sounds like a security disaster waiting to happen. How are you going to prevent people doing unauthorised transactions against the database?
I don't know a single company that intentionally exposes their SQL database directly to the world, i.e. without forcing everything to go through a web interface.

Create HTML5 web database in project directory

I am a newbie in using HTML5 web database. If I create a website using it and host it, different users will have their own different databases as the database is created in the user's local machine.
Is it possible to create a HTML5 web database in the project's directory itself so that every user will access the same database?
Specifically I need to use a programming language like Java
Yes it is, but you will need backend logic to make the connection with the database.
As a backend programation language you can use PHP, Python, Ruby, etc.. pair it with a framework, and it should be much more manageable..
I use python, and a framework, easy to use is flask.

How Connect to Remote MySQL server through Android App via JDBC

I first successfully connected via JDBC to a remote MySQL server with a Java program. That I understand how to do. My goal is do the same thing with an Android application and display data from a remote MySQL server.
Question 1 Can someone explain the process outline to do this via Android ? (I am new to Android and am a little stronger with Java, could use a little guidance).
Question 2 I found this tutorial on javatutorialpoint.com titled: Android MySQL Client but it wants me to use the SOAP API. Not sure why, if someone could explain.
Not asking for it to be done for me. I just want someone to outline the main steps in order to make it happen. Just the process that needs to occur is all I am asking.
Question #1:
I stumbled upon this link some time ago:
http://docs.oracle.com/cd/E17076_02/html/installation/build_android_jdbc.html
(Disclaimer: I haven't read the whole tutorial myself)
It tells you what's needed for getting the MySQL connector to work with Android.
Basically, from what I know, the standard MySQL connector for Java, doesn't work out of the box for Android. You'll need to build it on your own.
After building the connector, you can include it in your Android project, precisely the same way as you do in a normal Java project.
Your Question #2:
SOAP is a mere layer of abstraction, for not working directly on the database. If you use a layer like SOAP, you can swiftly change your database layer without affecting much of the communication from-and-to the Android app.
You can use the same methods in Android you used in Java (Android is written in Java, after all, and you are able to use the majority of its libraries in android). However, be careful with doing so.
It would probably be better from a security standpoint to set up a web service to communicate with the database, rather than you allowing your android app to communicate directly with it, which would actually require you to embed your mysql username and password in the app code. A SOAP or RESTful web service could enable your server to communicate with the DB and then serve the data from it to your app.
It's done the same as in Java (Android apps are build in Java unless you're using the NDK).
You don't need SOAP if you only want to get data from a remote DB.
See this question.

Help regarding What DBMS to use for interaction between android phone, server and database?

I am looking for some guideance in terms of what database to use server(using servlets) side of my android application.
Further down the line i will setup a website that will need to access the information from with the database.
At the moment from what i know i can use hibernate for object mapping to RDBMS or i can use JDBC for interaction with a MySql Database.
Do you guys have any best practices for using either the above or a different system for interaction between servlet and database?
If you are looking to get started quickly, you could use AppInventor, but if you want to build a backend yourself I suggest Ruby on Rails(get ubuntu if you don't have it!). Its easy to learn, easy to install, and very user-friendly.
The server and database will be handled by the Ruby on Rails framework.
Android application just acts as a client that makes request and accepts response from a Server. Server could be written using Servelets / JSP, ASP or PHP. As far as I know it doesn't matter to android client which database server is used at the server side as far as client is getting the response from the server.

Application that provides local and remote access to data

I need to develop an application with following features and want to
understand if GWT can be used to develop this application or is it the
right technology to use ?
1) Backend is in Java and uses MySQL
2) Desktop based UI to create some datafiles and data will be stored
in MySQL DB. This app will generate the data.
3) A desktop based application using which users can get access to
that database on a CD. This app will provide access to data locally
stored on a CD.
4) A web interface using which users can get access to the database
remotely. This app will provide remote access to data.
For local access also, we have the flexibility to install and run the
web server.
Should I use GWT for the UI part or should I use some thing else ? I
would like to provide common UI, look & feel for local and remote
access to data.
Please advice.
Thanks,
Deep
As you can run the web server also locally, I don't see a problem to re-use the same GWT app for both use cases.
It would be harder if your users must communicate with both the remote and local server from the same browser window/tab, at the same time. That can only be done with JSONP, which is possible with GWT, but it's not as nice as GWTRPC.

Categories