I have a server with Windows Server 2003 SP2 and third party application developed with Java SE version 5.0. This app connecting to external database server via configured ODBC source.
In my ODBC sources I have configured source to external MS SQL server. As I can say it uses this driver: SQLSRV32.DLL Version: 2000.86.3959.00. When I configure this source and test conenction it says that connection is successfull.
Many years external DB server runned under MS SQL Server 2008 and all was OK. But now they migrated to MS SQL Server 2012 and my java app lost connection to it with exception like this:
[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]The incoming
tabular data stream (TDS) remote procedure call (RPC) protocol stream
is incorrect. Parameter 1 (""): Data type 0x38 is unknown.
How can I fix connection? Is there any driver I need to install for Windows or Java?
You are using an outdated and obsolete driver version. The error is a result of a bug in the SQLServer 2000 driver
. To correct the issue you need to update the driver to a newer version. For more specific information on the cause and resolution of the error, see:
Microsoft KB Article 915834
To upgrade to later (2005+) drivers, you will be required update the jar files and the connection string used as described in the article. If you do not have access to the code to make a change, you will need to contact Microsoft and request an available hotfix that fixes the bug in the 2000 drivers as described in the KB and shown here:
To resolve this problem immediately, contact Microsoft Product Support
Services to obtain the hotfix. For a complete list of Microsoft
Product Support Services telephone numbers and information about
support costs, visit the following Microsoft Web site:
http://support.microsoft.com/contactus/?ws=support
It may also be possible to find a later 'patched' version of the driver .dll file. I was able to find an example of the download at this URL: Sqlsrv32.dll 2000.086.4412.00 which is a later version than the one you are using and may correct the issue. If that doesn't work search around for downloads later than this one, which as you can see is build #4412. If you download from a site other than Microsoft,make sure you do a virus scan of the file before using it.
Related
I downloaded the latest Bitnami Jaspersoft (7.1.1) appliance, and when creating a PostgreSQL (JDBC) Data Source to a PostgreSQL via the Jaspersoft web front-end, the "Test Connection" button always fails with an error message "Connection failed". I downloaded the appliance as an OVM, I'm running it as a VirtualBox VM.
To ensure it's not due to networking issues, I installed psql in the appliance (it's a Debian box) to ensure it can actually connect to my PostgreSQL database (it's a separate server), and it connects well via command-line psql, so I assume the problem is a JDBC issue. I also tried opening port-forwarding 5432 via ssh, so that I can connect to my database via localhost.
My question is, how can debug connection problems in Jaspersoft, or identify what is causing the failure? Jaspersoft 7.1.1 appliance comes with MySQL and PostgreSQL JDBC drivers already installed, and I was able to create and successfully test a new Data Source to the local standard MySQL database, so that driver definitely works. I couldn't find any log files that would output any error messages when testing the connection.
The appliance comes with the following JDBC driver: /opt/bitnami/apache-tomcat/lib/postgresql-9.1-903.jdbc4.jar. It also includes the following files:
/opt/bitnami/apps/jasperserver/buildomatic/conf_source/db/postgresql/jdbc/postgresql-9.4-1210.jdbc41.jar
/opt/bitnami/apps/jasperserver/buildomatic/conf_source/db/postgresql/jdbc/postgresql-9.4-1210.jdbc42.jar
/opt/bitnami/apps/jasperserver/buildomatic/conf_source/db/app-srv-jdbc-drivers/postgresql-9.4-1210.jdbc41.jar
/opt/bitnami/apps/jasperserver/buildomatic/conf_source/ieCe/lib/postgresql-9.4-1210.jdbc41.jar
I'm unfamiliar with Tomcat, and although I understand java code, I'm not a full-stack java developer. How can I debug this problem?
After hacking on it for a while, I tried replacing the file /opt/bitnami/apache-tomcat/lib/postgresql-9.1-903.jdbc4.jar with the latest jdbc driver from jdbc.postgresql.org, and restarted the server. This did the trick! I wonder why the latest Jaspersoft Server appliance comes pre-installed with such an old jdbc driver. Also, installing it via the web-based interface as per the documentation didn't work either.
Answering my own question here just in case anyone else gets stuck with the same problem!
Postgresq by default is not allow connection from remote hosts. It possible if you running postgresql and jaspersoft on different hosts.
How to Allow Remote Access to PostgreSQL database
I have a small HSQLDB program to test bits of SQL. I am getting this error:
A pre-version 2.0 client attempted to connect. We rejected them.
Yet the only JDBC driver I have is the HSQLDB v2.3 in the most recent download:
hsqldb/lib/hsqldb.jar
I'm using this string to load the JDBC driver:
Class.forName("org.hsqldb.jdbcDriver");
And the connection string is:
connectionStr = "jdbc:hsqldb:hsql://localhost/tmp_db";
user=sa, password=
Default values. My HSQLDB server seems to have started OK with a database as follows:
server.dbname.0=**tmp_db**
server.database.0=file:r:/.data/hsqldb/**tmp_db/tmp**
[Server#372f7a8d]: Database [index=2, id=2, db=file:r:/.data/hsqldb/**tmp_db/tmp**, alias=tmp_db] opened sucessfully in 26 ms.
I'm using Netbeans and when I connect via the Services tab, the database seems to be opening OK. Wouldn't Netbeans be using the same driver? Can I check that?
The big question is how do we specify the version 2 client connection, driver or parameters? Must I get a different JAR for the correct driver?
One last thing. The test program works fine if I use a file based connection, such as:
jdbc:hsqldb:db_file
Frustratingly too, the server connection string seemed to be working earlier today. At least I could drop/create tables while I was making changes.
You must use the same jars (or at least recent, compatible versions) on the client and server.
The error shows you are using the 2.x version jar on the server but a 1.8 jar on the client. Check NetBeans to see if some extension you have loaded has the old driver. You can use the correct jar in your NetBeans project by adding it as a library.
If the error is not from NetBeans, check your application's classpath and make sure you have the latest jar in it.
I am experience a strange performance issue when accessing data from SQL Server from a Spring based application. In my current setup, the Spring java application runs on a separate machine accessing data from a remote SQL Server DB. I am using NamedParameterTemplate in Spring, which I believe uses Prepared Statement to execute the query. For some reason, some of the query takes a long time to complete (approx. 2 mins). The JAVA app runs on a 64bit machine running 64bit version of Java v1.6, and the SQL Server is MS SQL Server 2008 R2.
The strangeness, is if I run the same java app from my laptop running Windows XP 32bit, running the same version of Java v1.6, the query takes less than a second, accessing the exact same remote DB server (infact, I am connected through VPN)
This shows the issue is not with the Spring framework but may be with the SQL JDBC Driver. I am using Microsoft JDBC Driver 4.0 for SQL Server (sqljdbc.jar)
I am completely clueless, as what could possibly be wrong and not sure where to start my debugging process.
I understand, there isn't much information in my question, so please let me know if you need any specific detail.
Thanks for any help/suggestions.
I think this may be due to the combination of your java version and jdbc driver failing to handshake the connection with the server. See Driver.getConnection hangs using SQLServer driver and Java 1.6.0_29 and http://blogs.msdn.com/b/jdbcteam/archive/2012/01/19/patch-available-for-sql-server-and-java-6-update-30.aspx
If so, switching to 1.6.0 upgrade 30 or higher and applying kb 2653857 ought to fix it.
My Java application uses a .mdb database and i want to run this application on MAC OS for that am definitely gonna nead a TYPE 4 JDBC driver i have google and came across two
- HXTT & StelsMDB but both are out of my reach
So if any body has some alternative or suggestions please reply.
Thanks in advance
I've used jackcess to read the tables from an MDB and convert the database to sqlite3. Not ideal if you need to keep the .mdb format, but it allowed me to keep the database in a single file and made the database cross-platform.
MS Access databases on MS Windows are driven by the Microsoft Jet Engine. Different from client server database management systems like MS SQL Server or MySQL the connection to a MS Access database runs in embedded mode via OLE and some DLLs.
As far as I know there is no Jet Engine implementation for operating systems other than MS Windows. So if you want to connect to a MDB file on Mac OS a simple JDBC driver is not enough. There has to be some kind of emulation layer to emulate the Jet Engine DLLs. According to the HXTT website this is exactly the way the HXTT JDBC driver works.
From the HXTT website:
It contains a fast database engine
written in Java, which supports
embedded and server modes.
If the usage of the MS Access database format is an absolute requirement, then these kind of emulation might be the best way for you. But you have to testify if the compatibility level is high enough. (Maybe there is no way to access VBA macros contained in the MDB file.)
It seems there is no open source project doing the same kind of emulation like HXTT.
There are several alternatives. If you want an embedded database system then you can use for example
SQLite (this JDBC driver supports Mac Os) (one database file, requires some native libraries),
H2 (only a few database files, pure Java) or
Apache Derby (many database files, pure Java).
Or you can use a client server database management system, install the server on a host and connect to that host from your Mac OS machine. For that you can use for example
PostgreSQL
Firebird
MySQL
Even the pure Java databases H2 and Derby have client server modes.
I suppose UCanAccess is what you are looking for.
It is an open source Java JDBC Driver implementation which allows Java developers and jdbc client programs (e.g., DBeaver, NetBeans, SQLeo, Open Office Base, Libre Office Base, Squirrell) to read/write Microsoft Access database. Because it is a pure java implementation it run in both Windows and non-Windows Operative Systems (e.g., linux/unix). No ODBC needed.
StelsMDB is not as expensive as HXTT, still not open source...
http://www.csv-jdbc.com/stels_mdb_jdbc.htm
Have'n tried it, but evaluation copy is available.
Anyone else got suggestions? I'm looking for an opensource variant myself. Shouldn't be impossible to build on top of jaccess ...
We use stelsMDB JDBC driver at our server to read/write MDB files. It is platform-independent, so you can use it in MacOS as well.
Moved a bunch of databases from sql server 2000 to 2008. One of the
applications is on JBoss 3.2.2 and is now failing to connect to the
database. The particular error is "The incoming tabular data stream
(TDS) remote procedure call (RPC) protocol stream is incorect.
Parameter 1 (""): Data type 0x38 is unknown."
I looked around google for a while have determined this is because I'm
using MS SQL Server 2000 Driver for JDBC and this driver will not work
with MSSql server 2008. It will connect but will not work.
So my question is how do I get Jboss to use the new MSSql server JDBC
driver version 2.
I'm not familiar with JBoss at all. The new driver comes with a JAR
file but I'm not sure how to tell JBoss to use that instead of the old
driver.
Thank you in advance for all your help.
Most often , to make the JDBC driver class available to JBoss, the driver's jar is copied to the lib directory of the default server configuration (assuming that is the configuration you are running, of course).
So, in order to make JBoss use the new driver, remove the old jar from the lib directory (if it's not there look at the startup script and find from where it's added to the $CLASSPATH), replace it with the new driver, update your mssql-ds.xml if required (especially the <connection-url> and <driver-class>, check the driver documentation), restart Jboss.