I am having some troubles to connect my multimodule maven project to proxysql.
When i connect to two different environments - one with mysql 8 and other with mysql 5, the app is connecting fine and working fine.
When I connect to the proxy with mysql-connector via cj driver is throwing:
java.sql.SQLException: Unknown system variable 'query_cache_size'
Tried to change to mariadb and it throws:
java.sql.SQLException: Unknown system variable 'tx_isolation'
This happens with the latest versions of mysql-connector and mariadb client.
When i created a simple maven module(non-spring) via ConnectionFactory is connecting! (mariadb client 2.7.0 or lower)
When i created a simple Spring app and tried to connect - same errors.
Does anyone could help here :(
I am using mybatis as ORM.
Maybe it's the jdbc version inside of the spring or the mybatis one.
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.
currently, I am facing some odd behavior.
I have a Java EE Web Application that I am deploying to a wildfly server. This Java EE Application needs a database to which we need to connect via vpn. We are using OpenVPN. When I am using SSMS I have no problems connecting to the database. When I am using pure JDBC, there also is no problem.
But if I am creating a datasource in wildfly (and I am using the exact same jdbc connection url) it does not working. I am using the wildfly admin ui and click the test-button.
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host 10.1.115.51, port 1433 has failed. Error: "connect timed out. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".
I mean, the stack trace is pretty clear. However, the connection should be possbile as I connect via ssms and pure jdbc. Just wildfly datasource is not working.
Furhtermore, I have installed a MS SQL Server on the same mashine the wildfly is running on and using this MS SQL instance the datasource is working fine.
The jdbc url connection url is the following:
jdbc:sqlserver://< ip >:1433;databaseName=projdat;user= ** ;password= **
I have compared the jdbc url connection urls multiple times. Both in the pure jdbc and in the datasource they are the same.
Does anybody have any ideas? Is possible that I need to configure openvpn in a special way that wildfly can connect or do I need to configure Wildfly to be able to connect via vpn. Or do I have to configure the MS SQL Server in special way?
Version of MS SQL Server: 12
Version Wildfly: 19.0.0.Final
SQL Server driver: mssql-jdbc-8.2.2.jre8.jar
I apreciate any hint or advise.
Apparently, I was using an older version of Wildfly (in fact, it was wildfly 16). After I upgraded to Wildfly 19, it is now working. However, I have no clue why it was not working with wildfly 16.
I've been trying to connect MySQL to Java for a while now but I keep getting this error:
Here's my Admin Properties for the MySQL Server:
I'm using MySQL connector v8.0.19 and I tried using the v5 but still got the same error.
Try to change another MySQL server version, I encounter a bug causing MySQL Server 8.0.17 cannot connect via various of the connector inside Netbeans IDE.
Below are MySQL connector failed to connect MySQL server 8.0.17, which is showing exception of "java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long":
mysql-connector-java-5.1.23-bin.jar
mysql-connector-java-5.1.45-sources.jar
mysql-connector-java-5.1.48-bin.jar
mysql-connector-java-8.0.17.jar
mysql-connector-java-8.0.18.jar
mysql-connector-java-8.0.19.jar
End up I using MySQL server 5.7.26, which development purpose is okay, can connect using any of the connector without any issue.
I am new in Oracle Database. I have successfully done these:
Installed and configured Oracle Database 12c in Windows 10 VMware virtual machine.
Connected to HR schema from SQL*PLUS, SQL Developer, Navicat.
Created a ASP.NET web application project and connected to HR schema from Visual Studio 2015.
Now I want to connect to HR schema through JDBC from IntelliJ IDEA 14. Unfortunately I cannot connect though I have installed JDBC drivers. I have read the reference here but it does not work. I am getting the following error:
Connection to Oracle - HR#localhost failed
java.sql.SQLException: Listener refused the connection with the following error:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:489)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:553)
...
For better demonstration, a screenshot is attached. Notice that I cannot define the service name (in this case "pdborcl") because there is no text field for this in Data Sources and Drivers window. Also notice that I can still connect to HR schema through SQL*PLUS after the error.
How to resolve this issue? Or, is it an IntelliJ IDEA bug or a JDBC bug?
You should be using "pdborcl" in the Database field. That is your service name, HR is just a schema in it.
I am trying to connect to a database hosted in https://postgres.heroku.com/databases using Netbeans (build-in) Services/Databases. I am getting this error
Cannot establish a connection to jdbc:postgresql://ec2-xx-xxx-xxx-xxx.compute-1.am
I tried this with no issues:
1. Netbeans connecting to a local postgres database.
2. Using PgAdmin III connecting to heroku postgres databases.
I tried downloading the latest postgres driver and use it in netbeans to create connection but the same error.
Thanks in advance!
When connecting outside of Heroku (e.g. locally), add this to the end of your JDBC connection URL:
?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory