Issue with Spring Cloud Dataflow and Mysql 5.6 - spring

I have the following problem when trying to start a SCDF server connected to Mysql 5.6.
Using the following command to start a SCDF server connected to a mysql database (version 5.6):
java -jar spring-cloud-dataflow-server-2.9.0-RC1.jar --spring.datasource.url=jdbc:mysql://localhost:3306/database --spring.datasource.username=username --spring.datasource.password=password --spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
I get this error trying to start the server:
Caused by: org.flywaydb.core.internal.license.FlywayEditionUpgradeRequiredException: Flyway Teams Edition or MySQL upgrade required: MySQL 5.6 is no longer supported by Flyway Community Edition
Looking for solutions online I tried to use this command:
java -jar spring-cloud-dataflow-server-2.9.0-RC1.jar --spring.datasource.url=jdbc:mysql://localhost:3306/jacad31_database --spring.datasource.username= --spring.datasource.password= --spring.datasource.driver-class-name=org.mariadb.jdbc.Driver --spring.flyway.enabled=false --spring.datasource.initialization-mode=always
After that the server starts but then this error happens when I try to open the SCDF dashboard:
Caused by: org.mariadb.jdbc.internal.util.exceptions.MariaDbSqlException: Table 'database.app_registration' doesn't exist
I tried to add this startup command but the error continues:
--spring.datasource.schema=classpath*:/org/springframework/cloud/dataflow/server/db/migration/mysql/V1__INITIAL_SETUP.sql
I think this happens because flyway is responsible for creating server configuration files on startup but since I'm not using flyway the config tables are not created. My question is: how can I create this tables on my database without flyway?

Docs are pointing to schema files in GitHub Repo. You can create tables either manually or bootstrap those via server without flyway.

Related

Can't Connect to MySQL Using apoc.jdbc and Neo4J Community Edition 3.0.4

I'm using Neo4J Community Edition 3.0.4 for the Mac. Within the plugins folder I've got apoc and the mysql connector for Java.
I would like to connect to MySQL on localhost using JDBC.
I've created an alias in the .neo4j.conf file using.
apoc.jdbc.mysql_basemodel.url=jdbc:mysql://localhost:3306/basemodel?user=fred&password=pw
In the browser I've tried to test the connection using:
CALL apoc.load.jdbc("mysql_basemodel","t_object") YIELD row
RETURN count(*);
but get the error
Failed to invoke procedure apoc.load.jdbc: Caused by: > java.lang.RuntimeException: No apoc.jdbc.mysql_basemodel.url jdbc url specified
It's almost as if Neo4J is not reading the .neo4j.conf file with the alias defined.
If, however, I skip the alias and put the full connection string is I get the error:
Failed to invoke procedure apoc.load.jdbc: Caused by: java.lang.RuntimeException: Cannot execute SQL statement SELECT * FROM t_object.
Error:
No suitable driver found for jdbc:mysql://localhost:3306/basemodel?user=...
which seems to suggest that the mysql JDBC driver isn't found.
What am I doing wrong?
You first need to register the JDBC driver for MySQL:
CALL apoc.load.driver("com.mysql.jdbc.Driver");
Once you've registered the MySQL JDBC driver your statements using apoc.load.jdbc will make use of this this driver when connecting to MySQL.
More information available in the docs here.
Download the mysql JDBC driver (e.g. from http://mvnrepository.com/artifact/mysql/mysql-connector-java) and drop it into the /plugins folder - same location like apoc's jar file.

Cannot create a JDBC Resource or Connection Pool

I have recently installed GlassFish v4.1.1 on my computer (Windows 8.1).
When I execute my GlassFish Server and enter in the administration webpage(http://localhost:4848/common/index.jsf from the NetBeans project), I obtain:
When, when I press the button "Create New JDBC Resource" or "Create new JDBC Connection Pool" the following error appears:
I really do not understand what is going on. Could you help me please ?
Thank you so much for your help.
I'm facing the same issue and I found a solution: instead of creating the connection pool using my IDE (Netbeans), I used the command line:
My DB username is root with an empty password and I'm working on my localhost.
My table is named tmpDb and the pool myPool3.
Here is the used command
$> cd "c:\Program Files\glassfish4\bin"
$> asadmin create-jdbc-connection-pool --restype javax.sql.DataSource --datasourceclassname org.apache.derby.jdbc.ClientDataSource --validationmethod table --validationtable DUAL --property User=root:Password="":ServerName=localhost:tmpDb --ping true myPool3
Does this work for you?

Grails 3.0.1 Issue connecting to Oracle database

How should I configure in the application.yml file or anywhere else so my .m2\repository\com\oracle\ojdbc14\11.1.0\ojdbc14-11.1.0.jar is in the classpath.
Below is my error:
:bootRun
ERROR org.apache.tomcat.jdbc.pool.ConnectionPool - Unable to create initial connections of pool.
java.sql.SQLException: oracle.jdbc.OracleDriver
I had a similar problem (Grails 3.0.2 + Oracle 12c). The guys in my post helped me fix it: How-to: Grails 3.0.2 + Oracle Database 12c? . Credits should of course go to them.
Just Paste your ojdbc14-11.1.0.jar to these 2 directory
C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext
C:\Program Files\Java\jre1.8.0_121\lib\ext

How to fix "Unable to instantiate JDBC driver" Flyway command line error?

I'm new to Flyway. I'm using Flyway 3.2.1 on windows 64bit and just tried the command line tool with my local Oracle database installation (11g). I'm getting the following error:
ERROR: Unable to instantiate JDBC driver: oracle.jdbc.OracleDriver
What did I do wrong? In flyway.conf I configured my jdbc url and also username and password.
Thanks in advance
Matze
Problem solved. For Oracle you have to put the jdbc driver jar in the drivers sub directory.
This is documented here.
In summary: Go to http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html and choose the required Oracle JDBC driver version. Then download the "ojdbc6.jar" file and move it into the drivers folder beneath where Flyway is installed. The next time you run Flyway this should be picked up automatically.

Callable statement in jdbc

hi i wrote a jdbc program using callable statement and i installed the connector j also .I have created a stored procedure also in mysql .I installed the following driver also
C:\Program Files\MySQL\mysql-connector-java-5.1.21 (3)\mysql-connector-java-5.1.21
but i am still getting an error
java.sql.SQLException: No suitable driver found for jdbc:mysql:localhost
java.lang.NullPointerException
if you are doing this through eclipse then you have to put the mysql required jar file to the lib folder of the project structure or else using build path of the eclipse. If you are doing this local system then you have to set path(Environmental variable).

Resources