I am developing a Java application in play framework and the back end of the application is Oracle. My database does not have a SID instead, it uses service ID. Also I am using Ebean in the application. This is my connection information in application.conf file.
db.default.url="jdbc:oracle:thin:#HOST:PORT/SERVICE_NAME"
db.default.user=USERNAME
db.default.pass=PASSWORD
Where I can specify the database name?
when you insert correct information about ip port and db schema it should work fine. The one thing that it missing here is:
db.default.driver=oracle.jdbc.driver.OracleDriver
Related
Neo4j have recently added a BI connector tool (neo4j.com/bi-connector) which can return relational data from your graph database to your business intelligence tool such as Tableau. The question is can i send SQL queries to this connector assuming i have added the jar file to my java application class path? If yes, which APIs should i use to send this SQL query to the driver?
I'm using Neo4j4.0.
For neo4j.com/bi-connector, if you look at the document PDF that you get when you download it, on page 10 where they show how to establish a connection you'll see that you get a connection object. After you have that, you have a standard JDBC connection which is a Java interface that tells libraries how to talk to a SQL database. There are a lot of different tools that use this interface, it's kind of user preference. A common one is JOOQ.
I am developing a Java based desktop application for a school.
As I am beginner, I am facing some issues.
Where to store the data of students or teachers (In files or database )
If in files, how I will ensure the security ?
If in Database, Can I embed db in application or I need to install db on server.
If db is installed on server, how I will manage the application if I will give that to other school users. (Means distributing the application to different users)
Do I need to create separate database for different users on servers or Can I make separate schema on same db.
First of all you need Mysql server installed for the following:
1->Store it in Database(mysql database)
2->database security (refer mysql secuity)
3->all you need is mysql connector for java put in the application folder of app you are creating
4->You can provide database inside of folder of application no
5->You can add user in same database.
You could do this:
1.Where to store the data of students or teachers (In files or database )
If you would like to go with open source databases, go with MYSQL instead of storing in files. Basic user authentication is enough to give you security to get started with your application. So no need of 2nd.
You can install and run on a remote system or your local machine depending on your application requirements and budgets.
On top your database, to communicate with it, develop a Spring web application (Spring data jpa) with REST web services so that any user can communicate with your application.
In your data base, you can manage users as well with basic authentication like username, password.
No you need not create separate schemas or dbs for each user. Instead you can create a single table that has information regarding Users for your application. For example, create a table "User_Management" which has columns like emailId, phone, name etc.
To get started, you can refer below:
http://javabeat.net/spring-data-jpa/
You should use Database (the best for this is Derby DB default for Java)
You can Embed Derby DB in application and also use this as server client.
Derby DB is light weight 2MB.
Alternatively you can use MySQL
If db is installed on server, You would create server on other school's PC or
you have to purchase the online server.
The Best as I described is Derby but if you want to use other you can use Xampp , Wampp server for local server client applications.
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.
I have a Linux server which has a Database. I want to query the Database from my Android application.
All the tutorials I find tell me to use PHP for some reason.
Can't I just query like I would normally with a Java application? Which is, I connect to the Database then send my queries as Strings.
It seems I need something like this:
Why?
PHP is just a server-side programming language. You can use any language and any server. The main issue is
Can I Query MySQL Database Directly from Android without a Web Service?
Yes you can. Just open the port where your MySql database is set usually at 3306. You also need JDBC Driver to set up connection to it.
Should I Query MySQL Database Directly from Android without a Web Service?
Unless you want to make a Database Client app (like phpMyAdmin) where each user holds his own credentials then you should not. In such case everyone will be using their own credentials to access their own db. In your case, you'd be hardcoding your database credentials in the app for everyone to access.
Well, your database user is only allowed to connect from localhost not from the outer world. If you want to execute queries from outer world then you will have to allow access from all IPs i.e. You will have to create a user create user 'app'#'%' identified by password123 (In my opinion it will be a bad approach).
Moreover you can build REST Web Services either using PHP (Recommended) or JAVA to interact with the database without opening it to world wide.
I need to make an application where the user can configure some connection parameters like server and DBMS (specifically MySQL, MSSQL and Oracle). As long as the database schema is the same, but not the server in order to use the servers already working in the client's intranet, I'm trying to find a way to force jpa use the parameters set by the user and make the transaction.
Any idea?
Use the property file contains information about the DB, username and password which will change according to the d