I am using Spring-Boot v1.1.10.RELEASE for my spring based web application. My DB is Postgres & used Flyway for my DB migration.
The postgres sql script file is successfully executed by flyway-maven-plugin by the following maven command i.e. mvn compile flyway:migrate
But the same Postgres sql script file is throwing PSQLException: ERROR: COPY from stdin failed: The JDBC driver currently does not support COPY operations error when running through the Spring-Boot Application.java file.
NOTE: From spring-boot I am executing the script file on fresh DB i.e. at least there is no SCHEMA_VERSION table in DB.
Any inputs?
Thanks,
Baji
By default, Spring Boot 1.1 uses Flyway 3.0 which does not support COPY FROM STDIN. Support was added in 3.1. You can either upgrade to Spring Boot 1.2 (which uses Flyway 3.1 by default) or stick with Spring Boot 1.1 and try overriding the version of Flyway to 3.1.
Related
Do I have to install the JDBC driver to use flyway with PostgreSQL?
If YES - then which JDBC - do I have to download?
I am completely new to data migration - need to know which JDBC I have to install?
Currently the PostgreSql 42.2.19 JDBC driver comes as part of Flyway.
If you are using the command line app, you can see this under the drivers folder, where you can also override it with a later JDBC.
i am using visual studio 2019 and have created an C# console application, added "Oracle.EntityFrameworkCore" and "Microsoft.EntityFrameworkCore.Tools" packages. Oracle database is already available in Server Explorer. Now i want create Models from the existing Oracle database tables using Scaffold-DbContext.
NOTE: I AM BOUND TO USE OLD 2.2.6 VERSION OF "Microsoft.EntityFrameworkCore.Tools" OTHERWISE IT GENERATES ERROR AS:
1. Package restore failed. Rolling back package changes.
2. Version conflict detected for Microsoft.EntityFrameworkCore.Relational.
Need to execute this sort of command:
Scaffold-DbContext "User Id=*****;Password=*****;Data Source=<*****>;" Oracle.EntityFrameworkCore -OutputDir Models
In order to deploy an application in Wildfly I needed to setup a JDBC module for database connection so I deployed the JDBC driver
After that, I added a datasource.
The problem I found no postgresql driver:
Any idea how to solve this?
I'm using Wildfly 10 and PostgreSQL 9.5 with Java 7
You didn't deploy the driver as a module but as a deployment. You have to create the module manually or use the jboss-cli like this:
module add --name=org.postgres --resources=/tmp/postgresql-version.jar --dependencies=javax.api,javax.transaction.api
Then register the module as a JDBC driver like this :
/subsystem=datasources/jdbc-driver=postgres:add(driver-name="postgres",driver-module-name="org.postgres",driver-class-name=org.postgresql.Driver)
Then you'll be able to create your datasource.
I create a database via rake task successfully. But I have a problem while migrating my migration files for models. I always get the following problem related to postgres.
I'm using EF 6 (Code first) with the IBM.Data.DB2.EntityFramwork nuget package to access a db2 database server. Working locally it all works as expected, but when deployed to a test server I get an exception: "System.MissingMethodException: Method not found: 'Void IBM.Data.DB2.InternalStruct6.SetDefault()"
I'm no DB2 wizard but I think the issue is related to a incompatible version of the db2 client drivers installed on the test server (9.7?). Entity framework 6 support needs version > 10.5. (I must have installed the 10.5 version locally at some point).
It would be nice to be able to run the application on any pc without additional dependencies, so my question is: Are there any way of skipping the db2 clients/drivers installation, and rather reference certain db2 dll's (or other nuget packages), to access db2 db servers?
Ok, I think asking the question resulted in a moment of enlightenment.
I guess the answer is NO, as the db2 clients/drivers actually installs the db2 odbc data source driver for db2. (Located in Administrative Tools -> Data Sources (ODBC)).