Missing Pentaho MSSQL Native database JDBC driver - sql-server-2008

I get the following different error when trying to use MS SQL SERVER native connection with Use Integrated Security box checked.
Error connecting to database [Kettle_ETL native] : org.pentaho.di.core.exception.KettleDatabaseException: Error occurred while trying to connect to the database
Driver class com.microsoft.sqlserver.jdbc.SQLServerDriver could not be found, make sure the 'MS SQL Server (Native)' driver (jar file) is installed. com.microsoft.sqlserver.jdbc.SQLServerDriver
Using Pentaho Spoon version 5.3 on a Windows 64-bit machine with jre1.8.0_45 installed, I copied the sqljdbc_auth.dll (x64 version) and sqljdbc41.jar files to the /data-integration/lib folder and removed the existing sqljdbc.jar file.
Any insight into this error would be greatly appreciated.

The sqljdbc_auth.dll should be copied into the data-integration\libswt\win64 directory.
Even if you are on a 64 bit machine, it's possible that Java/PDI is running in 32 bit, so ot's advisable to also add the 32 bit version of the sqljdbc_auth.dll into the data-integration\libswt\win32 directory.

Related

Error accessing Oracle view through SSIS

I'm getting errors while trying to access an Oracle view through an SSIS package. First, since, I'm running 64-bit windows, I installed the 64-bit Oracle 12c Client. But when I tested the connection I got this error:
Test connection failed because of an error in initializing provider. Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed.
Then I tried installing the 32-bit Oracle 12c Client but got another, different error.
Test connection failed because of an error in initializing provider. ORA-12154: TNS:could not resolve the connect identifier specified
Lastly I tried installing both clients together but the last error persisted. Not sure what's going on here...
The first error comes from the fact that Visual studio is 32 bit and it's trying to use 32 bit drivers by default. You can change the runtime settings like this: https://stackoverflow.com/a/28235255/5605866
The second error might refer to tnsnames.ora file not having all the settings correctly, like in here: https://stackoverflow.com/a/40399744/5605866

pyodbc + MySQL + Windows: Data source name not found and no default driver specified

I am trying to connect to MySQL 5.6 on a Windows Server 2008 R2 localhost with pyodbc. I used the full installation for the MySQL instance on the localhost, including the ODBC connector. I have it connecting to a remote SQL Server instance beautifully, but for the life of me I can't get it to connect to the local MySQL instance. I am using this guide from connectionstrings.com as reference.
Here's some code:
import pyodbc
def create_mssql_conn():
return pyodbc.connect(r'Driver={SQL Server};Server=MSSQLSRV;Database=ecomm;Trusted_Connection=yes;')
def create_mysql_conn():
return pyodbc.connect(r'Provider=MSDASQL;Driver={MySQL ODBC 5.6 UNICODE Driver};Server=127.0.0.1;Database=ecomm;User=root;Password=myP#$$w0rd;Option=3;')
# conn = create_mssql_conn() # This one works
conn = create_mysql_conn() # This one breaks
cursor = conn.cursor()
cursor.execute('SELECT * FROM inventory')
while 1:
row = cursor.fetchone()
if not row:
break
print row
Here is the error:
pyodbc.Error: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)')
I tried everything from adding Provider=MSDASQL; to changing ANSI to UNICODE in the connection string. Any suggestions?
I was having a similar issue. I am using windows 8, and mysql.
The way I solved the problem was by going into my
control panel>Systems and Security>Administrative Tools.>ODBC Data Sources
Either the 32 bit or 64 bit version depending on your computer.
Then you click on the System DNS file. If you do not see any MySQL driver you have to click ADD. It brings up a list, from that list select the MySQL driver.
For me it was MySQL ODBC 5.3 ANSI(they have a unicode driver also). Click finish. Once you do that then you have to change your connection line in your code to the corresponding Driver that you just filled out.
Ex:
def create_mysql_conn():
return pyodbc.connect(r'Driver={MySQL ODBC 5.3 ANSI Driver};Server=MSSQLSRV;Database=ecomm;Trusted_Connection=yes;')
This should work, or at least it solved my connection issue because I was getting all sorts of different errors with everything I tried. This was what solved the issue for me.
In Win64 there are two ODBC environments: 32 and 64 bit and you can work with Python 32 bit or Python 64 bit. Check what version of Python you use and then use proper version of odbcad32.exe (32 bit version is located in the SysWoW64 directory) to create SystemDSN. With SystemDSN you can check if you can connect to the database. Then try to connect to DB from Python code.
You can list ODBC datasources available to pyodbc via my code recipe: https://code.activestate.com/recipes/578815-printing-list-of-odbc-data-sources-with-pyodbc-mod/
Head to Administrative Tools and the ODBC Data Sources. You should click on the DNS file. Most likely you'd see Microsoft Access and excel as the only data sources available, so you need to add your SQL Server. Mine was SQL Server 2008 R2, and so far, it has worked.
For the error mentioned
"pyodbc.Error: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)')"
I installed the 'Microsoft Access Database Engine 2010 Redistributable 64-bit' as I have 64-bit system and then added the DSN in the directory of MS Access database and it's working now.
Here is the link of the video for how to create DSN and connect to python.
https://www.youtube.com/watch?v=zw9P2wSnoIo

Why am I unable to connect Sql server 2008 R2 from tibco BW?

When I'm trying to connect to sql server from tibco JDBC connection getting the following errors.
For com.microsoft.sqlserver.jdbc.SQLServerDriver
BW-JDBC-100034 "Configuration Test Failed. Exception [com.microsoft.sqlserver.jdbc.SQLServerException] occurred. com.microsoft.sqlserver.jdbc.SQLServerException: Software caused connection abort: recv failed"
and for tibcosoftwareinc.jdbc.sqlserver.SQLServerDriver
BW-JDBC-100033 "Configuration Test Failed. Failed to find or load the JDBC driver: tibcosoftwareinc.jdbc.sqlserver.SQLServerDriver"
I've placed the jar files in C:\tibco\tpcl\5.7\lib folder and also tried by placing the jar files in C:\tibco\tpcl\5.7\jdbc folder.
Can any please let me know how to solve this problem?
you should put the jar files in tibco bw/lib folder.
For me its C:\tibco\bw\5.10\lib
Additionally if you want to connect ms sql server using windows authentication then you also have to keep windows/system32 folder or add to class path.
Your JDBC drivers should be placed in:
C:\tibco\tpcl\5.7\jdbc
You must create the jdbc folder if it doesn't exist.
I had the same problem and Its resolved now.
First - Check If you are able to connect to a different Sql server using the JDBC connection in Tibco designer. If yes - there is an issue with the Sql server in your machine.
You should upgrade to Sql Server 2008 Service Pack 2. I did, restarted my Sql server and was able to connect. Download it from here. Also you need to make sure you have the jdbc folder in your C:\tibco\tpcl\5.7\ and you have the corresponding class path tibco.env.STD_CP_EXT in the designer.tra.
Just FYI, a relevant fix is in in SP2 patch:-
http://support.microsoft.com/kb/2653857
FIX: You cannot connect to SQL Server by using JDBC Driver for SQL Server after you upgrade to JRE 6 update 29 or a later version

Mysql table on Excel sheet?

I am using Windows7 and Microsoft office 2010 and mysql5. I want to connect Microsoft excel with my database mysql. I have installed all the drivers. I have created a data source as well. I am going step-by-step to connect, but at the end when i click on test connections, I receive this error message
Test connection failed because of error in intializing provider unspecified error.
You probably are not using the right ODBC driver.
Please check if you downloaded the one that matches your MySQL database. (not only version number, but especially if it is a 32-bit server or a 64-bit server).

MySQL ODBC Issue: Data source name not found and no default driver specified

I'm currently trying to run a classic ASP application which I've been given source code for. I want to set up on my 64bit Windows 7 dev machine and am having trouble with an ODBC based data connection to a MySQL instance.
I'm seeing the error:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found
and no default driver specified
/includes/<File Name>.asp, line 100
What I've tried:
The connection is DSN-less.
The application is running under IIS app pool with local system permissions. w3wp.exe can be seen running under NT AUTHORITY/SYSTEM in process monitor.
The application is running under IIS app pool with 32 bit applications allowed to run.
Have tried with Connector/ODBC 5.1.10 64 bit version only installed from http://dev.mysql.com (At this point no driver was listed under C:\Windows\SysWOW64\odbcad32.exe but was under C:\Windows\system32\odbcad32.exe)
Have tried with Connector/ODBC 5.1.10 32 bit version only installed from http://dev.mysql.com (At this point no driver was listed under C:\Windows\system32\odbcad32.exe but was under C:\Windows\SysWOW64\odbcad32.exe)
Have tried with Connector/ODBC 5.1.10 32 bit and 64 bit versions installed.
Verified driver name is not misspelled. Along with other checks from here http://support.microsoft.com/kb/306345.
Driver={MySQL ODBC 5.1 Driver};Server=localhost;Database=DBName;User=root;Password=Password;Option=3
Additional Information:
I'm monitoring in process monitor, and the two results are:
PATH NOT FOUND (Looking for .asp/web.config which seems odd.
BUFFER OVERFLOW
Both entries show:
User: NT AUTHORITY\SYSTEM
Process:
C:\Windows\SysWOW64\inetsrv\w3wp.exe
C:\Windows\SysWOW64\odbcint.dll
I'm stumped can any one make a suggestion on how I get this running in the context I have described?
Solved the problem now. Recording here in case this of use to others.
The issue was much simpler than it first appeared. The problem was that the application used a mixture of named and unnamed datasources (DSN / DSN-Less).
It was not apparent to me that any named connections were used until I set up the application for debugging in Visual studio. Here is a rough guide to debugging the application in visual studio (Except I used HTTP based website, rather than file system):
http://www.codeproject.com/Articles/28792/Debugging-Classic-ASP-VBScript-in-Visual-Studio-20
Following creating the required DSN, there were some further exceptions being thrown regarding default values in database columns. This was due to a MySQL setting that can be changed in the my.ini file.
http://bugs.mysql.com/bug.php?id=14306
C:\Program Files (x86)\MySQL\MySQL Server 5.5\my.ini
# Set the SQL mode to strict
# sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
sql-mode=""
I found this to work from Windows to MySQL as a DSN-less connection. The trick was to ELIMINATE the port spec at the end of the server address.
"DRIVER={MySQL ODBC 5.3 UNICODE Driver}; Server=**;Database=**;User=**;Password=**; OPTION=3"
Note: Server string is the internet address of the server, BUT NO PORT
SPECIFIED - ie, NO ":3306" on the end