Category : jdbc

Below is the previous version of entrypoint.sh for our service’s docker image. #!/usr/bin/env bash pushd /app/Liquibase ./liquibase –classpath=postgresjdbc.jar –driver=org.postgresql.Driver –url="jdbc:postgresql://${DATABASE_SERVER}:${DATABASE_PORT}/${DATABASE_NAME}" –username="${USERNAME}" –password="${PASSWORD}" –changeLogFile="./Scripts/db-changelog.xml" update status=$? popd echo if [ $status -ne 0 ] then exit $status fi ./MyServices.API In a multi-container environment, every docker container will try to run the liquibase update resulting in deadlock. ..

Read more

def getSingleLegTransactionBySelection(selectionId: Long)(implicit db: backend.Database, ectx: ExecutionContext) = db.run { logger.info("Ask for settled single leg transactions that contain the un-resulted selection.") sql"""select t.id FROM transactions t LEFT JOIN wallets w ON t.wallet_id = w.id LEFT JOIN transaction_statuses ts on t.status_id = ts.id where (t.details @> ‘{"legs":[{"selection":{"id":${selectionId}}}]}’) and ((t.details @> ‘{"type":"SGL"}’)) and (w.universe = ‘spin’) and ..

Read more

I have a Mysql-server docker instance with PORTS 3306/tcp, 33060-33061/tcp. I am trying to connect to it through JDBC but I keep receiving the error Caused by: com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure. I have created a user test and a database also named test. The code I am using is the following: package com.example.testconnection; import java.sql.Connection; ..

Read more

I’ve a running MySQL database on a container that looks like this (docker-compose): version: ‘3’ services: my-database: image: mysql:latest volumes: – ./data:/docker-entrypoint-initdb.d container_name: db command: –default-authentication-plugin=mysql_native_password environment: MYSQL_ROOT_PASSWORD: admin MYSQL_DATABASE: myP4ssw0rd+ cap_add: – SYS_NICE ports: – "3308:3306" networks: – database networks: database: external: true When I’m running my app, I use the following jdbc url ..

Read more

So I’m trying to run a local instance of logstash through docker. Was able to build the container properly, but now having errors while trying to run it. This is the error message: [2021-08-16T18:37:20,291][ERROR][logstash.javapipeline ][main] Pipeline error {:pipeline_id=>"main", :exception=>#<LogStash::Filters::Jdbc::ConnectionJdbcException: LoadError: no such file to load — sequel/adapters/https>, :backtrace=>["org/jruby/RubyKernel.java:974:in require’", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in require’", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/sequel-5.43.0/lib/sequel/database/connecting.rb:87:in load_adapter’", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/sequel-5.43.0/lib/sequel/database/connecting.rb:17:in adapter_class’", ..

Read more

I’ve got simple docker-compose.yml file version: ‘2.2’ services: postgres-db: image: postgres:latest ports: – 5432:5432 environment: – POSTGRES_USER=jdbc – POSTGRES_PASSWORD=pass Then I run my DB by docker-compose up -d Go to server instance docker exec -i myjava-app_postgres-db_1 psql -U jdbc and create database CREATE DATABASE mydb After running Main class, when I try to test db ..

Read more

I would like to use Keycloak latest version (14.0.0) Docker image with Oracle JDBC, and as far as I know jboss/keycloak:14.0.0 image does not come with Oracle JDBC driver. First, I added the driver to the proper directory as a volume in a docker-compose file. keycloak: image: jboss/keycloak:14.0.0 ports: – 9080:8080 – 9443:8443 networks: – ..

Read more