How to connect to client after installing db2 in docker? - database

I am tried installing DB2 in Mac using Docker. I installed it. But how to connect to the server from any client example(DbVisualizer) Today only i heard about this application so i am novice on it.
I tried to give
database server - localhost
port:50000
Database:SAMPLE(which is present)
even ping is not working for above db details. Am i missing anything?

Related

"The semaphore timeout period has expired" on connect to MS SQLServer inside WIndows Container

I have faced with very strange issue.
Host OS is Windows 10 Pro, installed Docker for Windows.
When I run microsoft/mssql-server-windows-developer container using simple command
docker run -d -p 1433:1433 -e sa_password=<SA_PASSWORD> -e ACCEPT_EULA=Y microsoft/mssql-server-windows-developer
I can connect to SQL Server via MS SQL Management Studio using server name=localhost. But I can't open Server Properties or open "Attach DB" wizard. There is the same error all the time "The semaphore timeout period has expired".
I can run container with attached DBs and I can execute sql inside MS SQL Management Studio. But when I run my Web Application - I get the same error "The semaphore timeout period has expired" on connect to DB.
Then I tried to connect to SQL Server using IP address which I get via docker container inspect - in my case it was 172.28.93.83. And everything worked as it should - I can manage with SQL Server, my Web Application connects to the DB, etc.
So, what is the issue there? I still want to use localhost to connect to server to have unified connection string in all developers environments.
When I tried to run Linux container - everything worked fine using localhost to connect to server.
I could be important - before I decided to use docker to work with MS SQL Server I had MS SQL Server installed and then uninstalled it. Maybe it made some changes in a routing or network which I have to remove...
I would appreciate any help
Try with increase timeout seconds in connection string.
I solved a similar incident changing the metric to the card generated by Docker.
I put 5000.
Luck.

.Net Core app in docker container can't connect to SQL Server

So I know there are a load of questions on SO related to this already, but I think at this point I've read them all, tried all the suggestions, and still haven't found a resolution.
I've got a simple .Net core MVC app with a connection to a local MSSQL database. I have been unable to get it to connect to SQL when running it in a container... I just get an error that a connection couldn't be established. When run in IIS Express it connects fine.
My connection string is:
Data Source=10.11.56.36,1433;Initial Catalog=TestDB;Integrated Security=false;User id=testdb;Password=######;MultipleActiveResultSets=True
My container is launched via:
docker run -it -p 8080:80 testing
Here are the things I've attempted so far:
Ensured the SQL server is configured to accept remote connections
Used "host.docker.internal" for server name
Ping'd the SQL server IP to ensure it's accessible to the container
Verified port 1433 is allowed through the firewall
Tried a different port and configured SQL server to listen on that
Tried without the port in the connection string
There were a host of other things I've tried as well in the last few hours of beating my head on this, but I've made no progress at all. What am I missing?
Any help would be greatly appreciated.
Please check if this bug is the reason for your error, if you are running a Linux Container:
https://github.com/dotnet/corefx/issues/29147
If so, the fix is to add the following to the runtime image in dockerfile
RUN apk add --no-cache icu-libs
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
I just had this issue. I spent 3 days and the fix for me was to use a fully qualified domain name.
MyServerName.MyDomain.com

Connect to SQL Server Developer from ASP.NET Core app running in Docker for Windows

I'm trying to connect to my SQL Server Developer edition on my local Windows 10 Pro machine from a docker image created using Visual Studio Tools for Docker Desktop for Windows. I've followed the tutorial here. Which helped me make sure that SQL Server is functional and exposed to the outside world.
My preference would be to somehow start docker with NET=HOST and just use . to access my DB. But, I'm not sure how to do that and I'm not sure if that even works on Windows.
Now I can't seem to get the connection right to actually connect to SQL. I've tried these:
Server={MyIPv4Address}:434;Database=MyDB;
MultipleActiveResultSets=true;User
Id=DeveloperLocalHost;Password=MyAwesomePassword
Server={MyIPv4Address};Database=MyDB;
MultipleActiveResultSets=true;User
Id=DeveloperLocalHost;Password=MyAwesomePassword
Server=.;Database=MyDB;
MultipleActiveResultSets=true;User
Id=DeveloperLocalHost;Password=MyAwesomePassword
I've tried many others from tutorials I have looked at online but don't remember them all. I'm a bit perplexed.
I would expect the second method (actual host IP and default 1433 port) to work as long as your SQL instance is configured to allow remote connections. Run this PS command from your container to verify port connectivity:
echo ((new-object Net.Sockets.TcpClient).Client.Connect("MyIPv4Address", "1433")) "connection successful"
Once you verify connectivity, you should be able to start the container with an environment variable and use that for your connection.

NodeJS: How to connect to MSQL database using Windows Authentication/trustedConnection from Mac

I'm building a NodeJS app on my Mac and I need to connect to a MSSQL database.
Using the node module mssql, I'm able to connect to the server. But authentication fails because the database server requires the use of Windows Authorization or 'trustedConnection'. If I could use the Microsoft Driver for Node.js for SQL Server with mssql, I could provide a true value for 'options.trustedConnection', but that driver is Windows only.
Is there any way to do what I'm attempting? I don't see a way with the other drivers/node modules (tedious, tds, etc) to provide a connection string that would set trustedConnection to true or use Windows Authentication.
I just successfully connected to the SQL Server from Ubuntu 14.04.
I use FreeTDS as the driver, and unxiODBC as the driver manager, node odbc as the Node.js module to connect. I think this might be used on OSX as well.
More information can see this link. I blog it, and hope can save someone else's time.
But I need to do more research because I want to use this node module mssql to connect. mssql uses tds or tedious as drivers.

Connecting Java EE application with Sql Server in virtual box

I have Ubuntu installed on my laptop, and I'm developing a web application with java, using eclipse, and I want to connect, with sql server. To do this I have installed sql server 2012 in my virtual machine(Virtual box).
I have installed windows 7. I'm using Bridged Adapter setting, to receive ip from dhcp.
I have tested connection with ping command and is running successful, but when I run my application I have this error: Unknown server host name 'PEACH-PC'
the PEACH-PC is the
have you added Peach-PC variable in the etc/hosts file? that may be the case. If not add the ip and the variable there.

Resources