I'm looking for a java database server that has support for database to be shared and opened from a PHP web application and a java application simultaneuosly.
I found Apache Derby and H2 Database but they don't have a clear support for PHP application.
Please suggest.
It must be a Java Database Server, since we are planning that we may have to distribute the applications to customers, so we need something portable and redistributable.
Most popular databases have drivers for PHP and for Java.
They also support concurrent connections. Choosing something like SQL Server, Oracle, MySql, Postgres will work just fine.
MySQL might work fine for you. I've used it myself in projects where I both need to access it from java and PHP.
Related
I have developed a REST web-service in Java interacting with a MySQL database.I want to deploy the web-service and the create a database at a server so that I can invoke it from an application.I tried Microsoft Azure but was unable to get it done.Where can I find relevant information for this?
I had similar problems with a MySQL database using the third party option in the Azure Marketplace from ClearDb. What I ended up doing was switching my database from a MySQL instance to an Azure Database Instance (Subset of SQL Server's features.) This worked perfectly for me! I was able to query from my database feed data to my api, and access the API through my Azure Web App.
I understand this may not be an option for you, however, Digital Ocean is a great cloud hosting option (with scaling similar to Azure, although not as good in my honest opinion.) You can set up a Linux Environment with a MySQL Server and JVM and serve your whole API through there. Best of Luck!
#coderden, According to your description, I think you have been deployed your Java Application on an Azure WebApp. Then when you created a MySQL database on Azure for connection from the Java webapp, please make sure the webapp & mysql instance created in a same resource group and note the connection string of MySQL on Azure.
As reference, please see the article to try again although it's for PHP, the steps are the same for Java.
To make connection to sqlite database and do some transaction, is it mandatory that a database software should be installed in the machine. I have seen that some libraries just handle connection and transactions without even database software. Or did I miss to notice that there were some database is already installed? How does the connection mechanism works?
A link to good article with detailed explanation would help me!
Thank you.
There are 2 options:
Use your DB locally:
For this you will need to install SQLLite on your machine, and in your project use JDBC jars for the connections from your java project to the DB. You may send queries to the DB as a string like "SELECT XXX FROM YYY WHERE a>b" or use Object Relational Mapping (ORM) tools like Hibernate.
If you have a remote DB installed on a VM on some cloud for example, then you don't need to install any DB on your local computer. But you will still need to use JDBC for connection.
You need Jdbc driver only or you can use ORM like hibernate.
Youtube has many tutorials about java and databases:
https://www.youtube.com/results?search_query=java+database+tutorial
If you are a begginer, start with jdbc with sql queries, later you should start using ORM's.
Probably you need to install mysql server or use this website https://www.elephantsql.com/ to get database instant.
I want to connect to oracle 10g databases in java without help from odbc and jdbc drivers. Is there any way to do that??? Thanks in advance
No. That's exactly what the JDBC drivers are for. To connect to the database.
Strictly speaking you could write your own driver (and call it something else), but that would be an immense amount of work, just because you refuse to do things the correct way.
Yes, it is possible. Oracle can act as a web service provider.
In the 10g version, you can only publish REST XML/JSON services; in 11g, support for SOAP web services was added.
Please note that the services provided by Oracle need to be implemented in PL/SQL; essentially you would be writing stored procedures that wrap the SQL queries you normally send over JDBC. Compared to JDBC, the web service / REST API is a very different tool as it works on a higher level of abstraction. You should only use it when required (e.g. if you don't want to mix SQL with your Java code), not because of false beliefs about security issues with JDBC drivers.
See this Oracle-Base article for more information.
I'm working on a plugin for an emulator that is going to allow people to host a control panel through a website to view statistics, etc; Currently I have XAMPP installed which is running my SQL Server, and the HTTP Server is being handled through the Netty networking library in Java.
I'm curious as to if there is a way to host the SQL Server from within Java, similar to the HTTP Server. It'd also greatly simplify the process of installation for the plugin.
The other option was to use ObjectDB, but after looking into it, it seems like it requires Quercus and I don't want to go through that.
The term you're looking for is "embedded database".
There are a number of databases that you can use as an embedded database, and you can choose to use them as an in-memory database (which means the data is gone when your application stops) or make them save data to a file on disk, so that the data is still there when you stop and re-start the application.
Examples of databases that can be used in this way: H2 Database, HSQLDB, Apache Derby.
I want to ask best server for a simple desktop java application.
Please suggest me a server using which i can port my database files on another computer.
can i have an option of MYSQL server 5.1.
in which i develop my application and then i can easily port it to another computer as it is with database.
Not really sure about your application requirements, but for simple application look at embedded databases like Apache Derby.
MySQL and really any other database are also quite straightforward to transfer via data dump/load. In case of MySQL even the data files copy will work.