im trying to make a java springboot project using Neo4j in DataBase , when i try to execute and test my Api in postman this error it diplayed to me :
Connection to the database terminated. Please ensure that your database is listening on the correct host and port and that you have compatible encryption settings both on Neo4j server and driver. Note that the default encryption setting has changed in Neo4j 4.0.
i had verified what it want for the encryption by adding this line in the application.properties:
spring.data.neo4j.uri=bolt://localhost:7687
spring.data.neo4j.username=Example1
spring.data.neo4j.password=secret
spring.data.neo4j.database =stud
org.neo4j.driver.config.encrypted=true
how can i find a solution for my problem
Thanks
Related
I try to connect my Springboot application to my local MSSQL Server with hibernate. For now I've set up a local ms sql server. I couldn't establish a connection to my database using IntelliJ CE and the JPA buddy.
On the net I found a guide that used IntelliJ UE. I installed the 30 day trial and with the ultimate version I could establish a connection with the database (using View->Tool Windows->Database, SSL is not enabled).
Even though the URL is kinda messy with "...server://./db". If I replace the '//./' with '//localhost/' it does not work anymore.
Now, I soon won't have access to the ultimate version anymore. So, my question is: How do I get the same behaviour with the JPA buddy and IntelliJ Community Edition?
I guess that it is related to the selected driver 'MS SQL Server ->LocalDB<-'.
When I use the following JPA settings, it does not work in the community version (it doesnt matter if I use the 'jtds' driver or not):
In both cases I get "Error during login for the user 'dbuser'". (The server is local and I don't have SSL enabled, therefore the ';encrypt=false')
I also tried to use the application.properties with the following content:
spring.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
spring.datasource.url=jdbc:sqlserver://localhost;encrypt=false
spring.datasource.username=dbuser
spring.datasource.password=...
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
spring.jpa.hibernate.ddl-auto=update
But this didn't work either.
Any help is appreciated.
I'm new to h2, but I read a lot of documentation,
I successfully created embeded H2 mem or file database.
But I'm still not able to use server mode or mixed mode :
I launch my Web server and tcp server like this :
java -jar h2-1.4.196.jar -web -webAllowOthers -tcp -tcpAllowOthers -browser -tcpPort 9092
Trying server mode :
I create file database like this :
I open H2 console and enter following :
jdbc:h2:~/maBaseH2FichierTCP
username: sa
password:
Database is created, and I see a lock file
In my java application
url: jdbc:h2:tcp://localhost:9092/~/maBaseH2FichierTCP
same username and pwd
--> When I launch my java application properties file, it stays sticked at the phase of datasource creation.
I tried to change url: jdbc:h2:tcp://localhost:9092/~/maBaseH2FichierTCP
to jdbc:h2:tcp://localhost/~/maBaseH2FichierTCP, but no effect.
Trying mixed mode :
In H2 console, I created jdbc:h2:C:/data/maBaseFichierAutoServeur;AUTO_SERVER=TRUE
In java, url: jdbc:h2:tcp://192.168.1.152:55000/file:c:/data/maBaseFichierAutoServeur;AUTO_SERVER=TRUE
--> Behaviour is the same, application start, but when at datasource creation, it waits, and nothing more happen ...
Does someone take has a idea to make one of orther server mode work ?
I solved this first problem : It was caused by a incompatibility between h2 version of h2 console, and my h2 client in application. 1.4.196 vs 1.4.192; when debuging, we can see an exception is launched, but nothing is writen on debug or even trace I think, and programme try to execute a rollback on a connection. It ended in a infinite loop here, even if I don't understand why. When changing version, I can connect my remote base.
Howerver now, when application update the database, the updated data cannot been seen in h2 console. Does someone know why ?
I have been using Oracle cloud PAAS linux server for my DB machine (Oracle 11g) and having linux application server where i can run all my Java applications.
Assume i have spring based web application which can connect cloud DB machine. I have tried to access the schema in Toad for oracle, it is working as expected but when i try to hit the DB for retrieving the data from application it gives below error.
java.sql.SQLException: Io exception: Oracle Error ORA-12650
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:420)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:154)
at GetConnection.main(GetConnection.java:35)
I have also tried to extend the service access from SID to service name in DB machine. Still give same error. Same code works fine in another cloud machine, which was set by us. But this cloud machine was done by oracle team and most of the things are by default.
Please share your suggestion to fix this issue.
This issue is because of Oracle DB machine encryption ENCRYPTION_SERVER settings. As i understood which is default and set it to enabled, when we set it to disabled or comment the line then application will work as expected. Below is the file name for reference,
Filename : sqlnet.ora (We have to disable ENCRYPTION_SERVER settings)
File Location : ../oracle/product/11.2.0/dbhome_1/network/admin
Hope this helps some one.!
It did not help me at all. Actually I followed your solution and I ended up having another error more critical and serious than the one trying to solve.
Let me explain. First of all the value "disabled" that you mentioned is not even an accepted value for this parameter. According to Oracle (Oracle Docs) these are the accepted values that anyone can use:
SQLNET.ENCRYPTION_SERVER
Purpose
To turn encryption on for the database server.
Default
accepted
Values
accepted: to enable the security service if required or requested by the other side.
rejected: to disable the security service, even if the required by the other side.
requested: to enable the security service if the other side allows it.
required: to enable the security service and disallow the connection if the other side is not enabled for the security service.
Example
SQLNET.ENCRYPTION_SERVER=accepted
In my case being a 12c Oracle Cloud database the default was set to "required" giving me the error "Io exception: Oracle Error ORA-12650" when trying to start my application.
Setting the parameter to "accepted" solved the issue and managed to start my application.
In case you still get the error you can also set the following parameter to accepted:
SQLNET.CRYPTO_CHECKSUM_SERVER = accepted
if you see that in your sqlnet.ora the value is set to "required".
Please have in mind that my application as well as my OCI setup are for testing purposes only and they are not intended to be used in production environment. Setting the value of SQLNET.ENCRYPTION_SERVER and SQLNET.CRYPTO_CHECKSUM_SERVER to "accepted" will significantly lower your Database's security making it vulnerable to any attacks from any application that has access to it. The best case scenario is to modify your application to use the ENCRYPTION as "required".
Downgrading the OJDBC jar to version7 also works - Replace higher version(ojdbc14.jar was the culprit in my case) with ojdbc7.jar in your dependency files
My current configuration is as follows:
MySQL server version: 5.7.18
Operating System: Ubuntu 14.04
JDBC Connector: 5.1.42
The problem: I can't use the configuration file in my.cnf since it will require a server restart. Since I'm using MySQL version 5.7 it supports utf8mb4 and I've updated to the latest connector for the version 5.xx series.
I tried using init_connect as given in the documentation here using the following command and using mysql user without super user priviledges:
SET GLOBAL init_connect="SET NAMES 'utf8mb4';SET character_set_server='utf8mb4';";
and setting the connection url as follows:
jdbc:mysql://localhost:3306/xxxx?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&connectionCollation=utf8mb4_unicode_ci
I also tried adding session variable to the URL as follows but it doesn't work.
sessionVariables=character_set_server=utf8mb4,character_set_client=utf8mb4,character_set_connection=utf8mb4,character_set_results=utf8mb4
Can anyone help how to figure the connection settings to allow storing using utf8mb4?
P.S: Utf-8 works fine but it does not work with utf8mb4, so can't insert emoji's.
In one of my project, we are trying to connect to Postgres server via Java application. It gives an error when try to open connection. Stack trace is below -
{"timestamp":"2016-03-17T06:57:18.853Z",
"level":"ERROR",
"thread":"main",
"logger":"com.abc.messaging.status.configuration.ValidateDatabaseConfiguration",
"message":"Failed to initialize data source: \n
### Error opening session. Cause: java.lang.NullPointerException\n
### Cause: java.lang.NullPointerException","context":"default"}
While we have tried following -
Ping db server from application server - it's successful
Telnet db server and port (from app server)- it's also successful
We also tried a simple python script that connects to postgre server. It also connects to db successfully.
We then moved back to our staging server and tried to connect production db server from there. This is also done successfully.
We tried connecting staging db server from production app server, which also we COULDN'T.
We are assuming that we don't have any issue in our application. This is because, from staging server, application can connect to both staging db and production db. There by, it must be some application server issue or something.
PostgreSQL version - Production - 9.4.5 Staging - 9.4.4
Java version - 1.8.31
Any kind of help would be much appreciated.
Thanks in advance.