I want to make jdbc connection to hive server through JTDS .I am not able to find proper documentation for hive jtds connection support.I am trying the following connection string
jdbc:jtds:hive2://x.x.x.x:20000/default;user='xxx';password='xxx';
I have used JTDS on a number of projects.
If you're using JTDS for windows authentication, you require a "ntlmauth.dll" file. This file is used for windows Authentication.
http://doc.cloveretl.com/documentation/UserGuide/index.jsp?topic=/com.cloveretl.gui.docs/docs/mssql-authentication.html
This link is quite useful incase my above explanation sounded confusing.
The connection string should be in the following format:
static String URL = "jdbc:jtds:sqlserver://SERVERNAME:1433;"+
"databaseName=DATABASENAME;" + // Name of database to connect to
"useNTLMv2=true;" + // To indicate use of Windows Authentication
"domain=DOMAINNAME\\";
Hope this helped
Related
Here is a tough one. So I managed to connect to our IBM DB2 database using Windows ODBC DNS method and via the catalogued name. I have the php_pdo_ibm.dll module loaded and it works when connecting doing:
$connection = new PDO('ibm:SomeDB2CataloguedDBName');
The catalogued name (ie: alias) does have the following specified:
db2 update dbm cfg using SSL_CLNT_STASH "C:\somefile.kdb"
db2 update dbm cfg using SSL_CLNT_KEYDB "C:\somefile.kdb"
In the ODBC screen, those parameters are also specified in the Advanced Settings screen:
I know that I can connect using the ODBC connection even if the DB2 DB alias has not been set up as the 3 required SSL parameters are specified there in the db2cli.ini file.
My question is, how can I use the new PDO(.....) in PHP without referencing the DB2 alias nor the ODBC DNS? I expect I would need some sort of special connection string? Thanks.
You can refer to the documentation, which shows an example of connecting via either a DSN alias , or via a connection string with explicit properties.
Both methods should let you make the connection with SSL successfully, assuming your environment is correctly configured.
For connecting with explicitly URL connection string, You need to know the correct Db2 driver name (which may differ from the one shown in the documentation) - your question does not mention which Db2 driver type you are using.
From that documentation page here is a connection URL example:
$db = new PDO(
"ibm:DRIVER={IBM DB2 ODBC DRIVER};DATABASE=testdb;" .
"HOSTNAME=11.22.33.444;PORT=56789;PROTOCOL=TCPIP;UID=testuser;PWD=testpass",
"",
"");
Depending on the Db2 driver name and version, you can add connection properties in the db2dsdriver.cfg XML file (for use with the DSN connection method), or you can place these properties in the connection URL along with any other required properties to make the connection work.
If you are using a Db2 driver that is recent (newer than year 2016) then you can get an SSL connection from CLI applications (like PHP) without needing to use a statically created keystore and without needing to separately deploy the IBM GSK8. This is possible if you have the Db2-instance (or server) certificate in ARM file format and you supply its fully qualified name with the connection attribute SSLServerCertificate="c:/path/to/certificate file"; along with Security=SSL, assuming your target Db2-server environment is already suitably configured. For details, refer to the Db2 Knowledge center for you Db2 server version.
I’ve been connecting the G1ANT robot to SQL server and it works fine.
However now I've created a new connection on our SQL server to AWS but it's not connecting to it.
This connection string works fine:
Server=GARDSQLDEV01;Database=ColumbusMk1;Trusted_Connection=True;
This connection string does not work:
Server=columbus-dev.csalh0f00gat.eu-west-2.rds.amazonaws.com,1433;Database=ColumbusMk1; User ID=sa; Password=***; Trusted_Connection=True;
Replaced the password with *** for security reasons.
Please help.
Use special character ‴long text‴ for long connection strings with spaces. It should work fine:
database ‴Server=columbus-dev.csalh0f00gat.eu-west-2.rds.amazonaws.com,
1433;Database=ColumbusMk1; User ID=sa; Password=********; Trusted_Connection=True;‴
Good luck!
I'm trying to connect to a self-hosted MySql 8 instance from a Google AdWords Script (effectively an App Script) using the Jdbc utility over SSL. My code follows the specifications in these answers here and here.
No matter what I do, I still get the following error:
ERROR: Failed to establish a database connection. Check connection string, username and password.
It turns out that the Jdbc utility only works with versions of MySql up to 5.7.
I thought I would post this here posthumously in case I can save someone else time.
The issue has been raised here and marked as fixed recently.
Other related issues can be searched here
it seems like Google has updated the jdbc connector. It is working for me now,
I'm trying to connect to a Sybase (SQL Anywhere 12) database using PHP's PDO. I spent hours trying to find the correct driver and DSN to use, with NO success AT ALL. Everytime I try to edit a single parameter I always get errors. I tried tens of different combinations of DSN parameters, nothing happens. I'll report here only a few just to give you example of what I'm trying to obtain.
I successfully installed PDO drivers - from php.ini:
PDO drivers dblib, mysql, odbc, pgsql
PDO Driver for FreeTDS/Sybase DB-lib enabled
Flavour freetds
DB params:
The IP for the DB is 192.168.100.234 and both the db instance and db name are GAMMA01. I can't tell you username and password, but let's say: user dba and pwd allright.
I can ping the server from the server where I try to start the connection.
I'm under Linux Debian Squeeze and PHP 5.3.3.
DBLIB:
I'm not able to find the correct DSN to use in order to connect to my Database server.
DSN version 1:
'dblib:host=192.168.100.234;DBN=GAMMA01'
DSN version 2:
'dblib:host=192.168.100.234;DBN=GAMMA01;UID=dba;PWD=allright;Server=GAMMA01;ASTART=No'
DSN version 3:
new PDO('dblib:host=192.168.100.234;dbname=GAMMA01', 'dba', 'allright');
Error I get
SQLSTATE[HY000] Unable to connect: Adaptive Server is unavailable or does not exist (severity 9)
FreeTDS error log (trying with both versions 5.0 and 7.0, no difference):
log.c:190:Starting log file for FreeTDS 0.82
on 2014-04-08 13:40:40 with debug flags 0x4fff.
iconv.c:363:iconv to convert client-side data to the "ANSI_X3.4-1968" character set
iconv.c:516:tds_iconv_info_init: converting "US-ASCII"->"UCS-2LE"
iconv.c:516:tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE"
net.c:210:Connecting to 192.168.100.234 port 5200 (TDS version 7.0)
net.c:264:tds_open_socket: connect(2) returned "Operation now in progress"
net.c:299:getsockopt(2) reported: Connection refused
util.c:334:tdserror(0xb9a46eb0, 0xb9b60688, 20009, 115)
dblib.c:7782:dbperror(0xb9b5ff88, 20009, 115)
dblib.c:7835:20009: "Unable to connect: Adaptive Server is unavailable or does not exist"
dblib.c:5627:dbgetuserdata(0xb9b5ff88)
dblib.c:7856:"Unable to connect: Adaptive Server is unavailable or does not exist", client returns 2 (INT_CANCEL)
util.c:368:tdserror: client library returned TDS_INT_CANCEL(2)
util.c:389:tdserror: returning TDS_INT_CANCEL(2)
net.c:310:tds_open_socket() failed
dblib.c:1372:dbclose(0xb9b5ff88)
dblib.c:256:dblib_del_connection(0xb5ceea00, 0xb9b60688)
mem.c:563:tds_free_all_results()
dblib.c:303:dblib_release_tds_ctx(1)
dblib.c:5727:dbfreebuf(0xb9b5ff88)
dblib.c:718:dbloginfree(0xb9b46588)
Using sybase: DSN:
'sybase:host=192.168.100.234;dbname=GAMMA01, dba, allright'
Error:
could not find driver
ODBC:
I'm not able to connect with ODBC drivers. I read the guide here: http://www.sybase.com/files/White_Papers/PHP_SQL_Anywhere.pdf and downloaded the proper .so package here: http://scn.sap.com/docs/DOC-40537 but I can't make PHP recognize the package, load it and use it.
DSN:
'odbc:Driver={Sybase SQL Anywhere 12};NA=192.168.100.234,5200;Uid=dba;Pwd=allright;'
'odbc:Driver={SQL Anywhere 12};NA=192.168.100.234,5200;Uid=dba;Pwd=allright;'
'odbc:DRIVER={Sybase SQL Anywhere 12};SRVR=192.168.100.234;DB=gamma01;UID=dba;PWD=allright;'
'odbc:DRIVER={Sybase SQL Anywhere 12};HOSTNAME=192.168.100.234;DATABASE=gamma01;UID=dba;PWD=allright;PROTOCOL:TCPIP'
Error I get:
SQLSTATE[IM002] SQLDriverConnect: 0 [unixODBC][Driver Manager]Data source name not found, and no default driver specified
Which driver should I use to connect to Sybase db? Which is the correct DSN?
The "Data source name not found and no default driver specified." error means that the DSN or Driver you are specifying cannot be found in the odbc.ini file for your ODBC environment.
You need to make sure that your ODBC environment is setup properly. Typically, this includes a specification for the location and file name of the odbc.ini file.
Upon attempting to connect, the odbc.ini file will be searched to find a matching Data Source Name (DSN)
In your case, you are specifying a "Driver". This is a similar configuration usually found in the odbcinst.ini file; also specified by your ODBC environment.
Another thing to check for is to make sure that the ODBC environment is being found by the running process or owning user for your PHP app.
The key is to figure out what part of the connection sequence is failing. In your case, a successful connection would follow this path:
Application is started
ODBC Connection is attempted
ODBC Environment is searched to find the configuration file (usually odbcinst.ini for "Driver" configurations)
Finds a match for the value specified for "Driver=" in connection string
Connection is attempted using the values configured in the found Driver section along with other options provided in connection string.
The two main things that cause the error you are getting are these:
ODBC Environment is not configured
The DSN or Driver value is not spelled correctly.
I hope this helps.
Tony Hall
I always got failed to "fetching of list failed error".
This is my connection string in ASP.NET
"Data Source=maywood\XSQLSERVER;Initial Catalog=maywood_test;Integrated Security=SSPI"
What exactly should I input at MySQL migration tool for source parameter string
FYI,'maywood' is my computer name and I am using SQL Server 2000.
You have integrated Integrated Security=SSPI set -- perhaps you should try setting the UID and Password manually to values that you know are correct.
Data Source=maywood\XSQLSERVER;Initial Catalog=maywood_test;
User ID=myUsername;Password=myPassword;
Integrated Security uses the credentials from the Windows system that you're using to log in -- these credentials might not be valid for the database you're trying to access.