Create HTML5 web database in project directory - java

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.

Related

Different applications to the same database

I have 3 different applications
ASP.NET web application
Java Desktop application
Android Studio mobile application
These 3 applications have the same database and and they need to connect from any part of the world with an internet connection. They share almost all the information, so, if you move something in one application it has to update the information in the other 2 applications.
I have the database on a physical server and I want to know how best to make this connection.
I have searched but I couldn't find if I have to connect directly to the server with some SQL Server, using Web Service, or something like that.
I hope someone could help.
Thank you.
I believe the best way is to first create a Web API layer (REST/SOAP) that will be used to perform all the relative operations in the centralized DB. Once that is setup, any of your applications written in any language can use the exposed web API methods to manipulate the data of the same DB.
If you are looking at a global solution - will you have multiple copies of the applications in different parts of the world as well?
In this scenario you should be looking at a cloud-hosted database with some form of geo-replication so that you can keep latency to a minimum.
There are no restrictions on the number of applications that can connect to a specific database - you do not have to create a different database for each and you may be able to reuse Stored Procedures between applications if they perform the same task.
I would however look at the concept of schemas - any database objects that are specific to one app should be separated from other - so put them in a schema for "App1". Shared objects can be in a shared schema.

application email service, send identical emails from public api and website

in a student project we are currently developing a website which service is also accessibly via native Android and Windows Phone Apps.
The mobile apps access the service through a public RESTful API written in JAVA which is running on the same server as the website. The website is written in PHP and independent from the API, but they both use the same database (MySQL).
We wanted to extend the functionality of the API and allow registration for the service in the mobile apps.
The problem is that the user receives an email with a confirmation link as soon as he registers for the service.
What is the best approach to ensure that the emails sent by the API are identical to the ones sent by the website?
The easiest way we figured out doing this would be just using the same templates for both, website and API, but in that case we need to manually keep those templates in sync.
Is there a better way than the one above?
Templates need not be in flat file model in each environment. You can store it at one place but should be read by a common intra-web-api say local RPC.
I.e. Write a script in current website environment that returns either a template or duly filled in as the requirement case may be.
And the same API should be called from both web-site php scripts and from java API.
This process will not alter the output in both the environments. The output would always be the same when on a later date you change the template.

Connection between Java program and website

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

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.

web based java application to read LDAP

I want to make a web based Java application that reads an LDAP compliant directory and creates a record in a database for each user and group in the directory.
How can i go about it?
I've used the Spring LDAP module to interact with directories. It works very well, same as all Spring code. You would use whatever relational database technology you wish to write to the database. If you're already using Spring, this won't be difficult. In this case you'd create a connection to an LDAP to read the data and another to the database to write it.
But there's a question here that's worth asking: Why do you feel like you need to duplicate the data? The DRY principle would discourage you from doing so. Wouldn't it be better to have all the information in one place or the other?
I don't see how being web-based will affect things, so long as the web server has access to the LDAP directory - you'd use classes under javax.naming.
If you want to access a directory which the browser has access to but not the web server, you'll need to write code to run on the client instead - possible a JNLP application with appropriate access to make network connections.
The general API for talking to directory services (including LDAP) in Java is JNDI (javax.naming).
The official documentation for LDAP is rubbish, but there's a good tutorial on JavaWorld here.

Categories