Error connecting to memsql with mysql J connector - java

I have memsql server version 6.7. I am able to connect to it using mysql java connector version 5.1.47 from my spring boot application.
But when i upgrade connector version to 8.0.16 I get below error -
Caused by: java.sql.SQLException: Unknown system variable 'performance_schema'
Ran query SHOW VARIABLES; on my memsql instance and I do not see system variable 'performance_schema'.
Can i change datasource.url string to ignore this variable? Any other latest version of driver is supported?

If your concern is the security issue in the 8.0.15 mysql driver you could use the mariaDb drivers instead. We generally recommend folks use them with MemSQL:
https://docs.memsql.com/client-downloads/
MySQL 8 made a number of breaking changes (i.e., you will have issues with MySQL 8 drivers connecting to older versions of MySQL as well : https://bugs.mysql.com/bug.php?id=90994)

From https://github.com/spring-projects/spring-boot/issues/17090:
A relevant change in Spring Boot 2.1.5 would appear to be that it upgraded MySQL's Java connector from 8.0.15 to 8.0.16. The 8.0.x driver should be compatible with MySQL 5.6, 5.7, and 8.0 so this would either appear to be a problem with your configuration or, probably more likely, a regression in the driver. If you would like to pursue this, I would recommend asking for some help on the MySQL forums and providing sufficient information to allow someone to reproduce the problem.
Try version 8.0.15 to see if that works better.

Related

Compability JDBC driver versions and PostgreSQL versions

Can anyone point me on where to find an exact documenation which postgreSQL database version requires which JDBC driver version?
In the case at hand I want to know: What is the minimum required JDBC version in a Java server application connecting to a database of version PostgreSQL 11.13?
Unfortunately the PostgreSQL JDBC Driver website is not really precise on this:
The current version of the driver should be compatible with PostgreSQL
8.2 and higher, and Java 6 (JDBC 4.0), Java 7 (JDBC 4.1), Java 8 (JDBC 4.2) and Java 9.
https://jdbc.postgresql.org/about/about.html
The question is a wrong one. Why would you want to use a JDBC driver that has as many bugs as possible?
Rather, you want to ask what the oldest version is that the latest JDBC driver supports, and the documentation will tell you that
[...] nning old applications or JVMs), this is the driver you should be using. It supports PostgreSQL 8.2 or newer and requires Java 6 or newer.
Always use the latest JDBC driver, and you won't go wrong.

Which version of oracle thin driver to use with application deployed on Websphere 7.0

I am trying to connect to my 10g database using oracle driver in ojdbc14.jar. My webservice is running on Websphere 7.0 which uses Jre 1.6.
When I am trying to access the Webservice, I am getting the following exception.
"JDBC driver name : Oracle JDBC driver
JDBC driver version : 10.2.0.4.0
JDBC driver specification level : 10.2
Oracle does not support the use of version 10 of their JDBC driver with the version of the Java runtime
environment that is used by the application server."
Please let me know which version of oracle thin driver I have to use to connect to my 10g Database using Websphere 7.0.
If Oracle 10g ships with a JDBC driver called ojdbc6.jar, then you should use it instead of ojdbc14.jar.
Otherwise, you can use the Oracle 11g JDBC driver (I know, for sure, that it ships with ojdbc16.jar). Unless otherwise noted, Oracle's JDBC drivers are backward compatible.
You said following (in the last line of your original question):
"Please let me know which version of oracle thin driver I have to use to connect to my 10g Database using Websphere 7.0.".
So, please note that you don't have to worry about the version of driver to connect to your database.
That's so because "Oracle 10g Database" is by default shipped with the RIGHT driver to connect to it.
Apart from this, which version of JDK are you using in WebSphere 7 ?

Not able to connect to Teradata using jdbc

I am trying to connect to Teradata using jdbc. My application is running in JDK 1.4.
The url i am using is "jdbc:teradata:///TMODE=ANSI,CHARSET=UTF8";
I get "No suitable driver error" when i try to run using JDK 1.4.
However, I am able to run my app using JDK 1.7 with the same url.
I have both terajdbc4.jar and tdgssconfig.jar in my Netbeans libraries.
You probably use the wrong version of either Java, Teradata JDBC or Teradata Utilities (TTU).
Take a look here, what is compatible with what: Compatibility
The matrix is part of this reference which holds information how to use JDBC with different Application Server like JBoss, Tomcat, WebSphere, ColdFusion, WebLogic, SAP etc.

Does a database systems latest driver support all previous versions?

I trying to develop a program, which as a part of it functionality, needs to connect to a selected database(either Oracle, SQL Server, MySQL etc). I am using java for the program. Is it okay for me to use the latest jar file for each database? Will this latest driver support connectivity to all the previous versions of the database. For example if I use sqljdbc4.jar for SQL Server, will it support even older SQL Servers like SQL Server 2000. Or do i need to include all the driver jar files for support and modify code based on version?
The database driver used within your code should match the version of the database you are using. Why would you want to use a newer release of a driver when your not using the database it corresponds with?
With that being said many database drivers are backwards compatible to a certain point. For example, the Oracle 11g Drivers state:
The JDBC drivers are certified to work with the currently supported
versions of Oracle Database. For example, the JDBC Thin drivers in
Oracle Database 11g Release 1 (11.1) are certified to work with the
10.2.x, 10.1.x, 9.2.x, and 9.0.1.x Oracle Database releases. However, they are not certified to work with older, unsupported database
releases, such as 8.0.x and 7.x.
You should investigate your target driver to determine its compatibility with the database your using.
Yes, Most of jDBC drivers are backward compatible. When database are added new features, jDBC driver changes to support new features but will remain compatible for older version.

Using MySQL 3.x and 5.x simultaneously from Java

How can I use MySQL 3.x and MySQL 5.x simultaneously from my Java application if the two versions need different versions of JDBC drivers but the driver class name is the same?
For MySQL 3.x I downloaded MySQL Connector/J 3.0.17 and for MySQL 5.x I have MySQL Connector/J 5.1.12. How can I use them both?
First check whether (as mentioned by #DaveHowes +1) you can use JDBC driver for v5 with DB v3. It probably works. In this case you have no problem.
If it does not work you have to use separate class loaders for 2 connectors to 2 different DBs. So, neither v5 nor v3 JDBC driver will not be in "regular" classpath of your application. Instead you should create some kind of wrapper that will instantiate its own UrlClassLoader: and start driver. The mentioned collector should expose API that allows you to perform JDBC query. I hope this will work. All this if you are using pure JDBC. If you are using some kind of tools (e.g. Hibernate, iBatis etc.) I wish you good luck :) and suggest to ask more specific question that mentions tool you are using.

Categories