Public avaiable DB2 Databases - db2

Are there any public available Versions of the following Database:
Database: DB2 for i5/OS
Version: 07.01.0000 OS/400 V7R1M0
I´m looking either for an way to setup that specific database, or a public available one (just to connect)
Thank you.

Related

In EF Core, connection string to one of several local databases on SQL server developer edition?

I am new to EF Core and following guide in the introduction: https://learn.microsoft.com/en-us/ef/core/
I have a VS 22 console app with the EF Core nuget package installed, and several Microsoft SQL Server Developer edition databases (Not SQL Server Express).
I am having trouble connecting to my databasea and would like to ask your help to get the connection string right.
If I use the generic Server=(localdb)\mssqllocaldb, then calling add-migration and update-database does not generate an error, but the added table does not show up in any of my local databases.
In SSMS, the desired SQL database is called PC-NAME\MSSQLSERVER. What would I need to write in the connection string Server=... in order to connect to this particular database?
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlServer(
#"Server=(localdb)\mssqllocaldb;Database=Blogging;Trusted_Connection=True");
}
Thanks in advance,
Mike

Only in Linux; org.postgresql.util.PSQLException: ERROR: relation "table_name" does not exist

I've been looking around Stack Overflow and forums but no luck so far. I have a Spring Boot 2.3.3.RELEASE, JPA/Hibernate stack.
I have a table
CREATE TABLE table_name (...)
I've created the table without quotes and in lower case. It works well in local. In local I am in a Windows env with Amazon Corretto jdk11.0.8_10.
Now I have created an AWS RDS PostreSQL DB instance. It is hosted on a Linux.
When I connect from my Windows to the DB, it works fine. But when I deploy my app on AWS Elastic Beanstalk, when Hibernate tries to query the DB, I have the error
org.postgresql.util.PSQLException: ERROR: relation "table_name" does not exist.
My Entity looks like
#Entity
#Table(name = "table_name")
public class User {
}
The table is in the default public schema.
My application.properties:
spring.datasource.url=jdbc:postgresql://${RDS_HOSTNAME}:${RDS_PORT}/${RDS_DB_NAME}
spring.datasource.driverClassName=org.postgresql.Driver
spring.datasource.username=${RDS_USERNAME}
spring.datasource.password=${RDS_PASSWORD}
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQL10Dialect
spring.jpa.properties.hibernate.globally_quoted_identifiers=false
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=none
spring.jpa.hibernate.default_schema=public
It doesn't matter if I put the schema or not in the #Table.
The only difference I can spot is the environment. Windows versus Linux. When I launch the app locally and use the AWS RDS DB it works.
For diagnostic problem, you should use plain text at
spring.datasource.url=jdbc:postgresql://${RDS_HOSTNAME}:${RDS_PORT}/${RDS_DB_NAME}
# ...
spring.datasource.username=${RDS_USERNAME}
spring.datasource.password=${RDS_PASSWORD}
What is your version of Spring Boot, PostgreSQL?
This is sample
spring.datasource.driver-class-name=org.postgresql.Driver
spring.datasource.url=jdbc:postgresql://localhost:5432/postgres_demo
spring.datasource.username=postgres
spring.datasource.password=123456
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
# Hibernate ddl auto (create, create-drop, validate, update)
spring.jpa.hibernate.ddl-auto=update
Note: don't use org.hibernate.dialect.PostgreSQL10Dialect , use
spring.jpa.database=org.hibernate.dialect.PostgreSQLDialect
In the end I was using the wrong DB name. I was using postgres as DB name. Instead it was ebdb. I don't understand how I'm allowed to connect via DBeaver or PgAdmin to connect to this postgres or how when running the app locally I was able to connect to this DB name and not when the app was deployed in AWS.
The name is mentionned in the doc: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/java-rds.html
You can also see the name in the AWS RDS Configuration tab of you DB instance.

Connecting to PostgreSQL Data Source in SQL Server Import Export Tool

I'm trying to setup an easily-replicable (or even manual and I do it once a month or so) process for moving data from a large Azure PostgreSQL database to a more manageable Azure SQL database for end users that are most familiar with SQL Server. I've successfully connected to the PostgreSQL database via PGAdmin, so I know all my connection string info.
I started by installing the latest ODBC driver from here.
I then used a connection string which was given to me from the Azure portal, filled in the proper database name and password, and attempted to use the following drivers:
PostgreSQL ODBC Driver(UNICODE)
PostgreSQL ODBC Driver(ANSI)
I am getting the following error with either of them:
ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
What step am I missing in this process? Or how best can I troubleshoot this?
After more research, I attempted to add the ODBC driver here:
And got the following error (I'm not sure why Tableau is relevant to this?):
Thank you.

How to load a foodmart database in to postgres

i have installed a PostgreSQL database.Now i need to download and import a food mart database to practice some reporting techniques.I am new to this field so do not know where to start.Please it will be very helpful if anyone can provide me a guidance to start it.
This repo contains the foodmart data loader for Postgres, Mysql, Sqlserver, Sybase
https://github.com/OSBI/foodmart-data
All you need to do is clone it and launch the following script:
sh FoodMartLoader.sh --db postgres
connection props are set inside the script
For Clickhouse DB2 and SAP Hana and some other DBs look at the branches of this
fork:
https://github.com/contiamo/foodmart-data-public

How to browse a derby memory database with Eclipse Datasource Explorer?

For unit testing I use a derby in-memory database.
Is there any chance to connect to this database using a tool like Eclipse Datasource Explorer when the test is running?
I googled a lot and sometimes I found something like:
Connection-URL: jdbc:derby://localhost:1527/memory/mydb...
But it did not work for me.
It says that 1527 is the default port.
Is it possible at all to connect to a derby memory database with a tool like eclipse explorer?
Does the database open a connection-port to connect to?
Or is there something special I have to configure for this to work?
Thanks,
Alex
Hi after some more research I got the solution.
To connect to a embedded derby memory database you have to start the NetworkServerControl in your application. After that you are able to connect to the derby database by using for example the eclipse DTP Plugin / Datasource Explorer.
The code to create the in-memory db and to start the NSC could look like this:
public static void main(String args[])
{
NetworkServerControl nsc = new NetworkServerControl(InetAddress.getByName("localhost"), 1527);
nsc.start(new PrintWriter(System.out, true));
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
Connection c = DriverManager.getConnection("jdbc:derby:memory:testdb;create=true");
}
You have to include the derby.jar & derbynet.jar that comes with the jdk7 (lib\db) to be able to create the NetworkServerControl and the database.
After that you can connect to the db as long as your application (and the database) is running.
Connection-URL is: jdbc:derby://localhost:1527/memory:testdb
User and Password: your choice
Regards,
Alex