IBM DB2 JDBC connection to cataloged database via SSL - ssl

1) I cataloged a remote database DBSAMPLE(remote port 52000) with SSL locally. And I can connect to it via db2 command line (local name alias SAMPLOC). Local db2 port 50000.
2) I can connect to the remote DB via JDBC:
jdbc:db2://serv.com:52000/DBSAMPLE:sslConnection=true;sslTrustStoreLocation=truststore.jks;sslTrustStorePassword=xxxx;
3) How can I connect to the cataloged SAMPLOC(aka DBSAMPLE) via JDBC? What URL should I use?
jdbc:db2://localhost:50000/SAMPLOC:sslConnection=true;
Does not work:
com.ibm.db2.jcc.am.DisconnectNonTransientConnectionException Error Code: -4499 SQL State: 08001

(Db2) JDBC has type 4 and type 2 drivers with different properties. With a type 4 driver you would directly connect to the remote Db2 database. The type 2 driver allows connecting through the local Db2 instance using the information that is cataloged about the remote database. The connection format is special:
jdbc:db2:SAMPLOC
SAMPLOC is the name of the local database alias. Depending on security, would need to provide the username and password as parameters. See the link for details.

Related

32 Bit ODBC Driver Connection Issue

Thanks for your time. I am new to SQL Server. I am using 32 bit odbc driver 17 and SQL server version is 2008. Using the same credentials, I am able to connect through SSMS but not through ODBC driver connection settings. I am not sure whats wrong on this one. Your help is highly appreciated.
Microsoft ODBC Driver for SQL Server Version 17.04.0001
Running connectivity tests...
Attempting connection
[Microsoft][ODBC Driver 17 for SQL Server]SSL Provider: The target principal name is incorrect.
[Microsoft][ODBC Driver 17 for SQL Server]Client unable to establish connection
TESTS FAILED!
Strange since you are able to connect through SSMS.
But try to add the server name like this (with default port number): "ServerName,1433" (of course if the port for connection to the server is the default one)
I have seen this few times in the past where you are able to connect to the instance through SSMS without adding port number, and not able to connect with ODBC if the port number is not explicitly given.
Also it is very good idea to double check again all the connection details given such as - Username, Password, Default database to connect to.

Can Not connect to Remote SQL server named instance with port

Hi All We have a server where we have sql server 2008 as well as SQL server 2005 hosted on port 1444. Using SSMS, I am able to connect to 2008 instance without any problem. But when I try to connect to 2005 instance using following connection settings.
DEVDB1\SQL_2005,1444
SQL server authentication user name and password.
I get following error
"A network-related or instance-specific error occurred while
establishing a connection to SQL Server. The server was not found or
was not accessible. Verify that the instance name is correct and that
SQL Server is configured to allow remote connections. (provider: TCP
Provider, error: 0 - A Connection attempt failed because the connected
party did not properly respond after a period of time, or established
connection failed because connection host has failed to
respond)(Microsoft SQL Server, Error: 10060)"
I am able to connect to another instance on the same server. but not this.
NOTE: My colleagues are able to connect to this sql server with the same settings. It just does not work from my machine. Me and all my colleagues are working on VPN and have same machine configuration.
Is there any setting that I need to do/check to get successfully connected?
My VPN user profile was restricting access to this perticular port. Once my VPN user profile is matched with those who were able to access, the problem resolved.

SSIS Script Task Connect to DB2/MVS

I have a script task that needs to connect to both DB2 on LUW and DB2 on Z/OS. My understanding is that within the script task I should use an ADO.NET Connection manager.
This I have done for the DB2 on LUW connection using the Microsoft OLE DB Provider for DB2 and can connect just fine. Using that as a guide I am trying to create a connection manager for DB2 mainframe, almost identical except for server name / port number and DBMS platform properties. I've tried every which way to get a connection to Db2 on Z/OS and wind up with an error "Test connection failed because of an error in initializing provider. The request for the host resource failed."
I can define an OLEDB connection manager and connect via its "test connection" but cannot use in script task.
Any thoughtss most welcome,
Phil Jackson

Unable to connect Windows Azure to MySQL WorkBench

Hello guys,
i am unable to connect mysql workbench with windows azure sql database so i can manage the DB from PC without issues.
Is their a way to do it.. ? or is their an option or alternative to achieve my goal ?
Please help me regarding my query ! Thanks a lot :)
UPDATE:
Here is the error code i am getting:
[Window Title]
MySQL Workbench
[Main Instruction]
Cannot Connect to Database Server
[Content]
Your connection attempt failed for user 'username' from your host to server at xxxxxxxxx.database.windows.net:1433:
Lost connection to MySQL server at 'waiting for initial communication packet', system error: 10060
Please:
1 Check that mysql is running on server xxxxxx.database.windows.net
2 Check that mysql is running on port 1433 (note: 3306 is the default, but this can be changed)
3 Check the username has rights to connect to xxxxxx.database.windows.net from your address (mysql rights define what clients can connect to the server and from which machines)
4 Make sure you are both providing a password if needed and using the correct password for xxxxxxx.database.windows.net connecting from the host address you're connecting from
[Close]
Your server is xxxx.database.windows.net, so you are using SQL server, not MySQL server.
MySQL server format is: xxxx.mysql.database.azure.com.
You should use a MySQL server if you want to connect to MySQL Workbench.

Cannot connect to sqlexpress

I just installed of SQL Server Management Studio Express 2012, and then I try to connect database engine with servername : ./sqlexpress, but it failed.
Its raised message like below :
TITLE: Connect to Database Engine
Cannot connect to ./sqlexpress.
ADDITIONAL INFORMATION:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 3)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=3&LinkId=20476
The system cannot find the path specified.
Whats going wrong?
I've seen this in the past, most likely the wrong instance name or address. Since it is a local DB instance on your machine you will want to try connecting to (local)\SQLEXPRESS [This is the default SQL Express Instance]
If you are running a local instance of SQL Server you can just use localhost as the server name. Also you can try to remove the ./ before the server name.
If anyone else gets a failed to connect to server instance while trying to connect to a DB in C#, make sure you add localhost to the front of your database server address if you're on the same machine.
ie: myDatabase2012
should be put in as localhost\\myDatabase2012 (the second \ is needed to escape the first)