How can i create server side application for postgreSQL (for android app and no Firebase) - java

I'm a beginner at java and i'm developing a big app the big issue is that i need a big database for which i should make a server side application(which i don't know how) to connect to Postgres. I did not find anything about making it and connecting it to PostgreSQL to Android Studio for instance.. I'm really confused and can't find anything about the topic. Excuse my bad English.

I recomend to see this example
Mysql is being used, but you could simple change the "jdbc driver" to connect with PostgreSQL
First change driver in pom.xml
and then replace the url in src/main/resources/ with the connection info of your postgres instance.
also add this line to the properties:
On postgres user is a reserved keyword, so you have to change the name of the table that maps with User entity:
import javax.persistence.Table;
#Entity // This tells Hibernate to make a table out of this class
#Table(name = "users")
In this way you have the example working.
If not needed to do in Java, you can do it on other languages and frameworks, but the main idea would be to have an API and fetch or post data from/to.
I leave you some useful links to have more information
PostgreSQL JDBC Driver :
Hibernate, a Java ORM


Spring Boot Test using Neo4j embedded database with JDBC Bolt driver

Is it possible to connect to an embedded Neo4j database the same way you would do with an H2 in-memory database to mock an Oracle database?
I've tried to do this:
final BoltConnector boltConnector = new BoltConnector("bolt");
graphDb = new GraphDatabaseFactory()
.setConfig(boltConnector.enabled, TRUE)
.setConfig(boltConnector.listen_address, listenAddress("", 7688))
.setConfig(GraphDatabaseSettings.auth_enabled, FALSE)
And then make a request using the JDBC Bolt driver with the following spring.datasource configuration:
profiles: test
driver-class-name: org.neo4j.jdbc.bolt.BoltDriver
url: jdbc:neo4j:bolt://
But I always get the following error:
Unable to connect to, ensure the database is running and that there is a working network connection to it.
Of course the embedded database works when I use the graphDb instance and execute requests against it. But I want my application to connect to the embedded database as it does when connecting to a remote Neo4j database.
This is for testing purpose.
I finally RTFM...
I had the following dependency in my pom.xml:
Then I found this:
The documentation is a bit outdated because it uses deprecated configuration. But they explain this:
The Neo4j Browser and the official Neo4j Drivers use the Bolt database
protocol to communicate with Neo4j. By default, Neo4j Embedded does
not expose a Bolt connector, but you can enable one. Doing so allows
you to connect the services Neo4j Browser to your embedded instance.
And they make clear the correct dependency to use is:

Migrate standard DAO with SQL to Hibernate and/or Spring data JPA [closed]

I'm working on project, that uses Spring framework (Spring MVC, DAO etc.)
Project is not so big and uses Jetty servlet container, PostgreSQL database with standard DAO classes(sql requests). I need to make it possible to use Hibernate/Spring JPA instead SQL queries.
I found a few states describes migration to spring boot:
I'm add spring boot dependencies in project:
Also I add package "entity" on the same level with old UserDao class and I need to use Spring JPA Repositories instead of using old DAO classes.
What actions I need to do for that replacement for table Users, that contains user id, name and email?
Need I use Hibernate or Spring JPA is enough?
You don't need to migrate to Spring Boot if you don't want to. Spring Boot has much easier configuration than legacy spring project, but still you can use legacy.
If you want to use Repositories as your data access layer, you can use Spring Data JPA with Postgres Driver Spring Data JPA Docs, but if you want to use only Hibernate with standard DAO classes, and EntityManager, you can add only hibernate dependency, Spring ORM and Postgres Driver. After that you just need to configure your Persistence Unit and Transaction managment withis your application (through persistence.xml or Java configuration).

How to implement ref cursors within stored procedure in MariaDB?

We are currently using MariaDB v10.1.19 to as a database. We wanted to know if this particular version supports the refcursor concept within store procedure like Oracle DB.
Tried to look at some of the sites but could not get a final answer.
We would be using Java8 using below jdbc connector

Neo4j Non-Rest Environment

I have tried running SDN 4, but still can't seem to make it run without its REST service (web service). I wonder if it is possible to make Neo4j run without REST(Web) service? Currently trying to make an app to do simple CRUD to the database like MyBatis.
SDN 4.1 (4.1.1.RELEASE) supports Neo4j running in embedded mode.
You need the embedded driver dependency:
and then you'll configure it. Both auto configuration and java configuration modes are supported. The manual contains information about how to do this:
There's a sample application that uses the embedded driver:

What mysql driver do I use with spring/hibernate?

Little confused, is 'driverclassname' and 'hibernate.dialect' both referring to the mysql driver?
What should I be using? Is the connectorJ the one I should use?
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
<property name="url" value="jdbc:mysql://localhost/blah"/>
<property name="hibernateProperties">
I'm using Maven so if I can get the driver from maven that would be ideal.
Running my app in tomcat I get the error:
Cannot create JDBC driver of class 'org.hsqldb.jdbcDriver' for connect URL
Little confused, is 'driverclassname' and 'hibernate.dialect' both referring to the mysql driver?
No, they are not. The driverclassname is referring to, well, the driver class name which is the class from a given JDBC driver that implements java.sql.Driver. The driver class name is driver specific.
When using MySQL's JDBC driver aka MySQL Connector/J, this class is com.mysql.jdbc.Driver as explained in the MySQL Connector/J documentation: Driver/Datasource Class Names, URL Syntax and Configuration Properties for Connector/J
The name of the class that implements
java.sql.Driver in MySQL Connector/J
is com.mysql.jdbc.Driver. (...)
And actually, they even provide instructions to use their driver with Spring. See the section Using Connector/J with Spring.
The hibernate.dialect is different, this configuration property is used to define the classname of a Hibernate org.hibernate.dialect.Dialect which allows Hibernate to generate SQL optimized for a particular relational database. Again this is explained in the Hibernate documentation:
3.4. Optional configuration properties
(...) The classname of a Hibernate
org.hibernate.dialect.Dialect which
allows Hibernate to generate SQL
optimized for a particular relational
e.g. full.classname.of.Dialect
In most cases Hibernate will actually
be able to choose the correct
implementation based on the JDBC
metadata returned by the JDBC driver.
For MySQL 5.x, you should use org.hibernate.dialect.MySQL5InnoDBDialect if you are using InnoDB tables (this would be my recommendation) or org.hibernate.dialect.MySQL5Dialect if you're not. See the section 3.4.1. SQL Dialects for a (non exhaustive) list.
Last point, the Maven part that you didn't even mention in your question... The MySQL JDBC driver is available in the Maven central repository and you should use a repository search engine (as I already suggested). For example, the following query:
allows to find the maven coordinates of the ultimate version in two clicks:
PS: I don't mean to be rude and I'm glad to help but you should really try to leverage the documentation of the products or frameworks you're using. What you're asking in this question is well documented (as I showed) and can be found easily. Learning to find basic information by yourself is a fundamental skill for a software developer in my opinion.
regarding maven mysql definition, here's one that seems to work.
The driverClassName should be referring to the class name of the JDBC driver you'd like to load (as you usually would do using Class#forName() in "plain" JDBC). The one you're currently specifying is correct for the MySQL JDBC driver (Update: you quickly edited it into a HSQLDB JDBC driver one, this is only correct for a Hypersonic DB, not for a MySQL DB).
The hibernate.dialect should be referring to the class name of the Hibernate Dialect implementation you'd like to use for the particular database, so that Hibernate knows what the DB in question understands so that it can autogenerate the suitable SQL statements. The one you're currently specifying is correct for the MySQL database.
That said, it sounds like that you're having problems with it. Probably you haven't installed the MySQL JDBC driver? Are you getting a ClassNotFoundException on it? Just downloading Connector/J, extracting the zip and placing the JAR file in the runtime classpath ought to be sufficient.