How to connect pentaho BI to an H2 database? - pentaho

For the life of me I can't get pentaho BI to connect to my h2 datasource.
Current configuration:
Database Type: H2 Native (JDBC)
Host Name: localhost
Database Name: /home/myusername/h2/pemc_for_pentaho
Port Number: 3306
Username: sa
Password: sa
I'm sure my mistake is with the Database Name. If it helps, in tomcat's catalina.out I'm getting this:
org.h2.jdbc.JdbcSQLException: Error opening database: "Could not load properties /home/clim/pentaho/biserver-ce/tomcat/bin/h2:/localhost:3306/ho
me/clim/h2/pemc_for_pentaho.lock.db" [8000-131]
Please help before I lose all my hair over this.

Related

Quarkus: Overwrite DEV profile config with empty values for Postgres properties

I'm using Quarkus (2.7.3.Final) with Postgres (quarkus-jdbc-postgresql).
And I really like Quarkus' approach that if you configure no username, password and url for your datasource it will try to start a testcontainer and emulate the database, when you start the app in development mode.
So for example if you define this in your application.yml (or application.properties), Quarkus will start a Postgres testcontainer for you, when you start the app with ./mvnw clean quarkus:dev:
quarkus:
datasource:
username:
password:
db-kind: postgresql
jdbc:
driver: org.postgresql.Driver
url:
The log says "Dev Services for the default datasource (postgresql) started."
Pretty neat! :-)
However, what I really want is to define my real/productive database connection settings in my application.yml. And then overwrite them in the application-dev.yml, so that only in the development mode the testcontainer is started:
application.yml with PROD settings:
quarkus:
datasource:
username: myuser
password: mypassword
db-kind: postgresql
jdbc:
driver: org.postgresql.Driver
url: jdbc:postgresql://hostname:5432/mydb
application-dev.yml with DEV settings:
quarkus:
datasource:
username:
password:
jdbc:
url:
But overwriting the properties with null values doesn't work, when I start the app in development mode I get the error:
Datasource '<default>': Connection to hostname:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
The overwriting itself works, if I change my application-dev.yml to use an embedded H2 instead of the implicit testcontainer, the application starts:
application-dev.yml with H2 settings:
quarkus:
datasource:
username: sa
password: mypassword
db-kind: h2
jdbc:
driver: org.h2.Driver
url: jdbc:h2:mem:mydb;DB_CLOSE_DELAY=-1
So my question is: How can I overwrite my datasource configuration with null values, so that Quarkus uses testcontainers in dev mode?
And by the way, switching from a application.yml to Quarkus default application.properties unfortunately did not help.
Thanks a lot!
Just to complete this: Combining the previous answers and comments using the prod profile this my solution:
application.yml with DEV settings:
quarkus:
datasource:
username:
password:
db-kind: postgresql
jdbc:
driver: org.postgresql.Driver
url:
application-prod.yml with PROD settings:
quarkus:
datasource:
username: myuser
password: mypassword
jdbc:
url: jdbc:postgresql://hostname:5432/mydb
The application-dev.yml isn't needed this way. Thanks folks! :-)
Following Quarkus' official documentation,
If a profile does not define a value for a specific attribute, the
default (no profile) value is used
This behaviour will be useful in many cases, but in yours might lead to the inability to override properties once defined in the default profile back to their empty state.
I would suggest you to swap your profiles around i.e. treat the null-valued dev configuration as a default and provide meaningful non-null prod values in an overriding profile.
If you are worried that dev values might be used this way accidentally in prod environment, remember that Quarkus is going to use prod profile by default if not told otherwise.

Connect App Engine to Google cloud SQL fails

I'm following this guide
I'm filling the config like this:
val datasourceConfig = HikariConfig().apply {
jdbcUrl = "jdbc:mysql:///$DB_NAME"
username = DB_PASS
password = DB_USER
mapOf(
"cloudSqlInstance" to CLOUD_SQL_CONNECTION_NAME,
"socketFactory" to "com.google.cloud.sql.mysql.SocketFactory",
"ipTypes" to "PUBLIC,PRIVATE",
).forEach {
addDataSourceProperty(
it.key,
it.value
)
}
}
output of the gcloud sql instances describe project-name:
backendType: SECOND_GEN
connectionName: project-name:europe-west1:project-name-db
databaseVersion: MYSQL_5_7
failoverReplica:
available: true
gceZone: europe-west1-d
instanceType: CLOUD_SQL_INSTANCE
ipAddresses:
- ipAddress: *.*.*.*
type: PRIMARY
kind: sql#instance
name: project-name-db
project: project-name
region: europe-west1
from which I'm filling my env variables:
DB_NAME=project-name-db
CLOUD_SQL_CONNECTION_NAME=project-name:europe-west1:project-name-db
On the deployed app line val dataSource = HikariDataSource(datasourceConfig) crashes with the following exception:
com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Cannot connect to MySQL server on localhost:3,306.
Make sure that there is a MySQL server running on the machine/port you are trying to connect to and that the machine this software is running on is able to connect to this host/port (i.e. not firewalled). Also make sure that the server has not been started with the --skip-networking flag.
update: I've tried adding google between second and third slashes("jdbc:mysql://google/$DB_NAME"), according to this answer, now I get:
Cannot connect to MySQL server on google:3,306.
I was missing the following dependency:
implementation("com.google.cloud.sql:mysql-socket-factory-connector-j-8:1.2.2")
more info here
Also DB_NAME is not name of gcloud sql instances output, but a database name that should be created in Console -> Project -> Sql -> Databases

Connecting my jhipster project to postgresSql

I'm trying to connect my jhipster project with postgresql but I'm getting an error about the password.
Here is the error I'm getting
HHH000342: Could not obtain connection to query metadata : FATAL: password authentication failed for user "fabrice"
I have seen in pgadmin and the password is correct and so is the username .
My application-dev.yml
datasource:
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:postgresql://localhost:5432/fabrice
username: fabrice
password: postgres
hikari:
poolName: Hikari
auto-commit: false
This is the postgres users photos:
I think this was what you wanted :
CREATE ROLE fabrice WITH
LOGIN
NOSUPERUSER
INHERIT
NOCREATEDB
NOCREATEROLE
NOREPLICATION
ENCRYPTED PASSWORD 'md576436d4007f2e5338a99e5a76181a7a4';
The problem was the port used by postgreSql it was 5433 instead of 5432 .So for the others persons you may check the port used by postgresql

DDEV Prestashop database connection

I want to install a Prestashop with DDEV, but I can't connect to database.
I tried 127.0.0.1:32775 and localhost:32775, with "db" as user/db/password
But I get this error:
Database Server is not found. Please verify the login, password and server fields (DbPDO)
Database is up and running, connection via commandline is working:
mysql --host=127.0.0.1 --port=32775 --user=db --password=db --database=db
Project information:
PrestaShop 1.7.6.2 Installer (I first tried github/composer installation - error, then zip download with wizard - same error)
ddev version v1.11.2
DDEV project type: php
Host: MacOS 10.15.1
DDEV config.yaml - changes to default: router_http(s)_port
APIVersion: v1.11.2
name: prestatest
type: php
docroot: ""
php_version: "7.2"
webserver_type: nginx-fpm
router_http_port: "880"
router_https_port: "8443"
xdebug_enabled: false
additional_hostnames: []
additional_fqdns: []
mariadb_version: "10.2"
nfs_mount_enabled: false
provider: default
use_dns_when_possible: true
timezone: ""
ddev describe will show you the db connection information.
Host: db
User: db
Password: db
Database: db
Mostly people forget the hostname configuration.

RemoteConnection to SQL server2008 express failed on Visual Studio

After 2 Days of search i still didnt find an answer.
Situation:
Server:
SQL Server 2008 Express installed on RemoteServer
TCP/IP: Enabled on port 1433
Named Pipes: Enabled
Database: ConDB.mdf (attached to server)
Workstation:
Microsoft Management Studio: Connection to database works
Servertype: Databasemodul
Servername: MTTC5020\SQLEXPRESS,1433
Authentifcation: SQL
Server-Authentification Username:
testuser Password: 1234
Visual Studio 2010 Express:
Error on Database Explorer: SQL
Network Interfaces, error: 26 - Error
Locating Server/Instance
Specified
Same Error Through Connection via Appconfig and connectionstring:
<connectionStrings>
<add name="ContainerDB.My.MySettings.ConDBConnectionString" connectionString="Data Source=MTTC5020\SQLEXPRESS,1433;Initial Catalog=ConDB.mdf;User ID=testuser;Password=1234;Integrated Security=false"
providerName="System.Data.SqlClient.SqlConnection" />
</connectionStrings>
I also tried many other connectionstrings (Via IP / AttachedDBFileName / etc.)
I also tried everything here: MSDN portcheck through SQLCMD -U testuser -P 1234 -S MTTC5020\SQLEXPRESS,1433 works aswell Any suggestions?
I now found the issue.
The connectionstring for the dbml is not only stored in the .config file.
checkout the workaround for this at:
LINQ to SQL Connection Strings
Because by default express editions are installed as named instances, SQL Server on the remote machine needs to be allowed in firewall, not only the port, but the service, because named instances probably will change the port from time to time. Check this post, hope this helps blogs.msdn.com/b/sqlexpress/