How connect to Sybase custdb.db using SwisSQL? - oracle

How connect to Sybase custdb.db using SwisSQL?
I work with standart Sybase sample.
I input appropriate command line:
"mlsrv12.exe -vcrs -zu+
-c "dsn=SQL Anywhere 12 CustDB;uid=ml_server;pwd=sql"
-x http(port=80)"
Database work fine - I test it from InteractiveSQL and from Android - client.
When I try to migrate from this database to Oracle I have trouble.
Host name: 127.0.0.1
Port number: 80
User name: ml_server
Password: sql
Service ID (SID): custdb
Shema(optional): empty
What I am doing wrong?
Any help appreciated!

Related

JDBC connection fails to SAP Hana Cloud: "RTEException: -708 Receive of connect failed."

Similar to https://answers.sap.com/questions/12675326/sap-dbtech-jdbc-708-receive-of-connect-fail.html
Connection to SAP Hana Cloud fails with the error "RTEException: -708 Receive of connect failed."
Steps to reproduce:
java -version
OpenJDK Runtime Environment (build 11.0.15+10-Ubuntu-0ubuntu0.20.04.1)
java -jar ngdbc.jar -V
package package com.sap.db.jdbc, Java Platform API Specification, version 1.4, SAP HANA JDBC Driver, SAP SE, 1.120.05-8c23c50e159e9883edab0e2ebdd4e02c5919cd08
java -jar ngdbc.jar -u DBADMIN,PASSWORD -n BIG-IDENTIFIER.hana.trial-us10.hanacloud.ondemand.com:443 -d test -o encrypt=true -o validatecertificate=false
(the certificate is imported, and the error occurs even without the parameters encrypt and validatecertificate)
Contents of trace log:
ClassLoader: jdk.internal.loader.ClassLoaders$AppClassLoader#55054057
Process-ID: 320850
package package com.sap.db.jdbc, Java Platform API Specification, version 1.4, SAP HANA JDBC Driver, SAP SE, 1.120.05-8c23c50e159e9883edab0e2ebdd4e02c5919cd08 on Java 11.0.15
---- Thread 1eb44e46 main Timestamp: 2022-09-29 09:50:03.162
new Connection 'jdbc:sap://BIG-IDENTIFIER.hana.trial-us10.hanacloud.ondemand.com:443'
password=****
databaseName=test
host=BIG-IDENTIFIER....
options=
cmd=Select top 1 42 as "connect test" fro...
user=DBADMIN
HOSTLIST: [BIG-IDENTIFIER.hana.trial-us10.hanacloud.ondemand.com:443,]
new RTEException: -708 Receive of connect failed.
whereAmIjava.lang.Throwable
at com.sap.db.util.Tracer.whereAmI(Tracer.java:280)
at com.sap.db.rte.comm.RTEException.(RTEException.java:51)
at com.sap.db.rte.comm.BasicSocketComm.receiveInfoRequest(BasicSocketComm.java:587)
at com.sap.db.rte.comm.BasicSocketComm.doInfoRequest(BasicSocketComm.java:84)
at com.sap.db.rte.comm.BasicSocketComm.connectDB(BasicSocketComm.java:187)
at com.sap.db.rte.comm.SocketComm$1.open(SocketComm.java:47)
at com.sap.db.jdbc.topology.Topology.getSession(Topology.java:88)
at com.sap.db.jdbc.Driver.openByURL(Driver.java:1216)
at com.sap.db.jdbc.Driver.connect(Driver.java:313)
at com.sap.db.jdbc.Driver.main(Driver.java:858)
using null
=> FAILED
any thoughts on the why and how to solve it?
Since this is HANA Cloud Trial, I don't think, that you should use -d to specify a tenant database name. Please try to remove this parameter as you may be trying to connect to a non-existing tenant database. You can also refer to this tutorial.
Second thing to consider is the allowlist for IP addresses. Per default connections are blocked if you have not added your client ip to the allowlist. More details can be found in this blog.
Last but not least, please check if your are using the latest version of ngdb.jar. It can be obtained on this site.

RobotFramework Oracle DB Connection Issue

I'm trying to check if the oracle DB connection using the Keyword:
Connect To Database Using Custom Params
Following libraries are imported:
Database Library
JayDeBe API
This this is the connection string used:
'oracle.jdbc.driver.OracleDriver', 'jdbc:oracle:thin:#//DBHostname:Port/DBName', ['user', 'pass']
We do not get any response that can identify if the connection is established or rejected.
We see this message in RIDE:
'oracle.jdbc.driver.OracleDriver', 'jdbc:oracle:thin:#//DBHostName:Port/DBName', ['user', 'pass']
20170927 17:07:54.438 : INFO : Executing : Connect To Database Using Custom Params : jaydebeapi.connect(db_api_2.connect('oracle.jdbc.driver.OracleDriver', 'jdbc:oracle:thin:#//DBHostName:Port/DBName', ['user', 'pass']))
Can someone please help us?
We found the solution: In our case we have python 2.7(32bit) therefore we need the following:
1. Oracle Instant Client Downloads for Microsoft Windows (32-bit). you can download it from here: http://www.oracle.com/technetwork/topics/winsoft-085727.html
Set the variable path in environment variable for the Oracle Instant client.
Download cx_Oracle API (32bit- cx_Oracle-6.0.2-cp27-cp27m-win32.whl (md5) ) from the location:https://pypi.python.org/pypi/cx_Oracle/
Open command prompt and run: pip install cx_Orcle --upgrade
Open the RIDE and use the following keyword:
Connect To Database Using Custom Params cx_Oracle 'user', 'password', 'DBHOSTNAME:PORT/DBNAME'

How to load table from SQL server using H2o in R?

I try to load table into R using h2o but had the following error
my_data <- h2o.import_sql_table(my_sql_conn, table, username, password)
ERROR: Unexpected HTTP Status code: 500 Server Error (url = http://localhost:54321/99/ImportSQLTable)
java.lang.RuntimeException [1] "java.lang.RuntimeException: SQLException: No suitable driver found for jdbc:mysql://10.140.20.29/MySQL?&useSSL=false\nFailed to connect and read from SQL database with connection_url: jdbc:mysql://10.140.20.29/MySQL?&useSSL=false"
Can someone help me with this? Thank you so much!
You need a supported JDBC (Build on JDBC 42 Core) driver to connect from H2O to SQL Server. You can download Microsoft JDBC Driver 4.2 for SQL Server from the link below first:
https://www.microsoft.com/en-us/download/details.aspx?id=54671
After that please follow the article below to first test JDBC driver from R/Python H2O client and then connect to your database:
https://aichamp.wordpress.com/2017/03/20/building-h2o-glm-model-using-postgresql-database-and-jdbc-driver/
Above article is for postgres however you can use it with SQL server using an appropriate driver.
For Windows, remember to use ; instead : for the -cp argument.
java -Xmx4g -cp sqljdbc42.jar;h2o.jar water.H2OApp -port 3333
water.H2OApp is the main class in h2o.jar.
Important Note: SQL Server is not supported so far( August/2017).
You may use MariaDB to load datasets:
From Windows console:
java -Xmx4G -cp mariadb-java-client-2.1.0.jar;h2o.jar water.H2OApp -port 3333
Note. For Linux, replace ";" with ":"
From R:
sqlConn <- "jdbc:mariadb://10.106.7.46:3306/DBName"
userName <- "dbuser"
userPass <- "dbpass."
sql_Query <- "SELECT * FROM dbname.tablename;"
mydata <- h2o.import_sql_select( sqlConn, sql_Query, userName, userPass )

Convert from WE8MSWIN1252 to UTF-8 in MariaDB Engine Connect

I'm connecting to an Oracle DB with WE8MSWIN1252 encoding from a webserver that displays content in UTF-8 using MariaDB Connect Engine.
The code used for connecting the tables is like this:
CREATE TABLE mytable ENGINE=CONNECT TABLE_TYPE=ODBC TABNAME='oracle_table_name' CONNECTION='DSN=orcl;UID=someuser;PWD=passwd';
I know I have to pass somewhere the expected charset, but not sure about the syntax using this engine.
I'm able to correctly display the characters connecting directly from php using this code:
oci_connect('someuser', 'passwd', 'host', 'AL32UTF8');
The odbc.ini file looks like this:
[orcl]
Driver = Oracle 12c ODBC driver
Servername = host
I have tried putting Charset = UTF-8 in this file but it didn't work.
After many tries and a lot of investigation I understood that it was a matter of the environment setup.
I finally solved it writing the next line in /etc/init.d/mysql:
NLS_LANG=SPANISH_COLOMBIA.WE8MSWIN1252 ; export NLS_LANG
And to connect from isql the next line was needed in /root/.bash_profile:
NLS_LANG=SPANISH_COLOMBIA.AL32UTF8 ; export NLS_LANG
I was on CentOS 6, so I suppose in other environments this could not work.

Connecting to MS SQL (Azure) using FreeTDS

I'm on Mac OS X Mavericks, and trying to use pyodbc to connect to a Microsoft Azure MS SQL server. I'm wanting to use a DSN-less connection for simplicity and have installed FreeTDS and pyodbc (as that's what I want to eventually use) using MacPorts.
1. tsql config
$ tsql -C
Compile-time settings (established with the "configure" script)
Version: freetds v0.91.103
freetds.conf directory: /opt/local/etc/freetds
MS db-lib source compatibility: no
Sybase binary compatibility: no
Thread safety: yes
iconv library: yes
TDS version: 5.0
iODBC: no
unixodbc: no
SSPI "trusted" logins: no
Kerberos: no
2. odbc.ini (/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/databases/MyODBC/files/odbc.ini)
[MSSQL]
Description = MyDatabase
Driver = FreeTDS
Servername = xxxxxxx.database.windows.net
UID = username
PWD = password
Port = 1433
TDS_Version = 7.0
3. isql test
$ isql -v MSSQL
[IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified
[ISQL]ERROR: Could not SQLConnect
4. tsql test
$ tsql -H xxxxxxxx.database.windows.net -p 1433 -U xxxxxx -P xxxxxx
locale is "en_AU.UTF-8"
locale charset is "UTF-8"
using default charset "UTF-8"
Error 20002 (severity 9):
Adaptive Server connection failed
There was a problem connecting to the server
I tried it using TDSVER=8.0 and TDSVER=7.1 in front of the command as done in this post. Using TDSVER=7.1 I get a slightly different error ...
Error 20017 (severity 9):
Unexpected EOF from the server
Error 20002 (severity 9):
Adaptive Server connection failed
There was a problem connecting to the server
Can anyone help me diagnose and step through this?
Thanks!
Check this link. It solved my problems which were similar to yours.
http://martinrichards.tumblr.com/post/28488121620/connecting-to-sql-azure-using-freetds

Resources