JDBC/ODBC Bridge and getArray()
I'm trying to use the getArray() method and I get the following:
java.lang.UnsupportedOperationException
I'm using the sun.jdbc.odbc.JdbcOdbcDriver
Is there any other (free) bridge that allows you to use JDBC 2.0's getArray() method?
Thanks,
Michael
I would look for a driver for the particular DBMS that you are using. Take a look here http://industry.java.sun.com/products/jdbc/drivers and here http://ourworld.compuserve.com/homepages/Ken_North/jdbcvend.htm
Col
Similar Messages
-
JDBC-ODBC Bridge and Lotus Notes
Greetings
Got this message in the Event Viewer when testing my ODBC
connection to a Lotus Notes DB:
Description:
The description for Event ID ( 0 ) in Source ( ColdFusion 8
ODBC Server ) cannot be found. The local computer may not have the
necessary registry information or message DLL files to display
messages from a remote computer. You may be able to use the
/AUXSOURCE= flag to retrieve this description; see Help and Support
for details. The following information is part of the event:
ColdFusion 8 ODBC
Server@LOCALHOST,ErrorCode=3004,ErrorMessage=sched.swschd.1424.Internal
error, an unexpected exception was detected..
The Notes DB is on another server. I have installed NotesSQL
and created an ODBC data source in Windows. I created the data
source in CF admin pointing to the Windows ODBC. When I tested the
connection I got the message above. I can connect to the Notes DB
using the Notes Client installed on the server with Coldfusion.
Any thoughts?
Thanks>
It's not a CLASSPATH problem.
Did you create an ODBC DSN named test?
You have two choices:
(1) Create an ODBC DSN named test, OR
(2) Rewrite your database URL as:
String url = "jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\\foo\\bar\\baz.mdb";
Make the DBQ equal to the path to your Access database and it'll work.
I prefer the second idiom, because it doesn't require setting up a DSN. - MOD
Yes, I have created a DSN with the name 'test'.
The second option "jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\\foo\\bar\\baz.mdb" -> is the part 'baz.mdb' the name of the my database. So it will be: "jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\\foo\\bar\\test.mdb";
But what is the biggest different between those two? What is the advantage and the disadvantage? -
JDBC-ODBC bridge connection failure.
I'm new to JDBC and JDeveloper and am having some difficulty
getting through the database applet tutorial.
I'm trying to connect to a Microsoft Access database using the
JDBC-ODBC Bridge. This is an interim stage before using a Linux
Oracle database which is not yet up and running.
When trying to add a data form, the database wizard fails at
step 4 of 7 after selecting the Sun JDBC-ODBC bridge and the
required data source the following error is presented:
Connection error
Vendor code 84
[Microsoft][ODBC Microsoft Access 97 Driver]Driver not capable
I also tried setting up (using ODBC manager) a System DSN for a
text and Excel data source, but met similar problems e.g:
[Microsoft][ODBC Excel Driver]Driver not capable
Currently JDeveloper Beta 2.0 (build 184) and the ODBC source
are on the same NT4.0 (SP4) machine.
To confuse matters I'm actually running Access 95, rather than
Access 97.
I have previously successfully connected to an Access ODBC
source via JDBC in a Java application (not applet) when
following a tutorial example that comes with the Sun JDK 1.2. I
note, however, that jdbcodbc.dll that's part of JDK 1.2 is newer
(and bigger - 32K 01Dec98) than that supplied with the
JDeveloper Beta 2.0 (22K 05Nov98)
I'm a bit lost with this problem since nothing happens after
pressing help on the error dialog, and I'm not sure where to
look for log files etc. to further debug the problem. Any help
would be gratefully received!
nullThe error indicates that the bridge is making a call to the
driver which it cannot handle -- either because the call is
invalid/unreasonable or because the driver doesn't implement the
functionality requested. An ODBC trace will determine which of
the two is true. If the first, you need to contact the bridge
provider to get a fix. If the second -- the ODBC driver
provider.
null -
I have a MS Access database which I want to connect to dynamicly using JDBC-ODBC bridge and without having to create a new record for the database in the DSN.
Usually the code looks like this
// Load the JDBC-ODBC bridge driver
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
// ODBC data source name
String dsn = "jdbc:odbc:AccessTest";
String user = "admin";
String password = "";
con = DriverManager.getConnection(dsn, user, password);
...But since the position or name of the database is always changing I would like have it something like this
String pathToDatabase = "c:\temp\database.mdb";
// Load the JDBC-ODBC bridge driver
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
// ODBC data source name
String dsn = "jdbc:odbc:" + pathToDatabase;
String user = "admin";
String password = "";
con = DriverManager.getConnection(dsn, user, password);
...I hope you know where I'm going with this and if you know the answer to.
Thxsearch for "dynamic dsn" in this forum.
-
I have the following error when i try to run my program(I have used JFrame instead of JApplet ) :
[Microsoft] [ODBC Driver Manager] Invalid cursor state
I'm using VJ# and i read on oreilly's site that JDBC-ODBC bridge doesn't work with it, so how should i resolve the problem?
could somebody suggest a better and easy-to-use Type 1 driver(which is free)Closing the statements defeats the purpose of prepared statements with my design. The whole point is to load them at startup and reuse them.
Another driver is an option however where does one get one and are they free?
I have implemented a temporary solution that I found in the archives. I have used a while statement to make sure that I have got to the end of the result set, however a nested if only looks for the first result. I am only retrieving one row from the database so only need the first. Logic says to me that rs.next() must have to evaluate to false. It is a bit messy but it works . . . so far.
L -
Setting up and checking JDBC-ODBC bridge
I'm supporting an application that does not use general JDBC drivers but relies on the JDBC-ODBC bridge. Can't currently get a connection to my 10.2 database, and it looks like the problem is that the JDBC-ODBC bridge isn't set up. Any hints on how to do this?
(I originally posted this on the database forum but was told to try here. Odd since my app is HTML and XHTML, and was not developed using JDev).
Regards
SimonWhy do you use the JDBC-ODBC bridge; if the database is Oracle 10? You should connect from Java to Oracle with the API driver or even better with the Oracle JDBC driver.
If the client is not Java there should be no reason the use the bridge.
The Sun JDBC-ODBC bridge is not intented for production.
You can find configuration information in this document:
http://java.sun.com/j2se/1.3/docs/guide/jdbc/getstart/bridge.doc.html
Regards Flemming -
To run a report from command line, when using jdbc-odbc bridge
Hi,
How to run a report from command line, when using jdbc-odbc bridge?
Usually with tns, we do by "rwrun module=<> userid=<user>/<passwd>@tns".
with odbc, we do by "rwrun module=<> userid=<user>/<passwd>@odbc:DSN"
Please specify, what is command line arguments for jdbc-odbc bridge driver?
Environment : Oracle 9i Report Builder on WinNT
Database : Sybase
Regards,
RamananHello Ramanan,
Report Builder : connect JDBC Query in Report Builder is to through Connection Dialog in JDBC Query Editor. User can use a Sign on parameter (can use, default : P_JDBCPDS or can create new) to connect to JDBC Data Source. Connection once made will be mentioned and will be reused through out Reports Builder.
JDBC PDS allows user to connect one or more same or different kind of databases.
While running report through runtime or Server, user can pass the sign on parameter(connection string) value, like any other user parameter.
Syntax for connection string : <username>/<password>@databaseURL . The syntax of database part of connection string depend on the type of JDBC Driver used to connect to Data Source while designing the JDBC Query. databaseURL refer to the location of the database and its format depend on the JDBCPDS river selected in design time while creating the JDBC Query.
rwrun eg :
rwrun report=jdbc_odbc.rdf destype=file desname=output.html desformat=html P_JDBCPDS=scott/tiger@database
Server eg :
http://server.com:8888/servlet/RWServlet?server=MyReportServer+report=jdbc_odbc.rdf+destype=cache+desformat=html+P_JDBCPDS=scott/tiger@database
http :
Please see ORACLE_HOME/reports/conf/jdbcpds.conf for more information.
With Regards
Reports Team -
Oracle RDB Driver fails with JDBC/ODBC Bridge
Has anyone experienced problems using the latest Oracle RDB
Driver (3.0.2.0) with the JDBC/ODBC Bridge.
We have been using the Oracle ODBC Driver for RDB (2.10.17)
successfully on NT, but it is not supported on W2K. The new
drivers work fine for Access etc., but fail with the bridge.
Specifically, you can step thru a result set, but getObject()
returns null for all fields.
Any suggestions?
JoeThis forum is for general suggestions and feedback about the OTN
site. For technical question about an Oracle product, you can
select the appropriate discussion forum in our 'Discussions'
section at: http://forums.oracle.com/forums/homepage.jsp
Best regards, OTN Team -
Hello,
I'm using JDK1.5 and have a working connection to MySQL using JDBC. I now need to connect to Interbase database using ODBC and that's where I'm completely lost.
Could somebody please tell me if I have to download a JDBC-ODBC bridge or if it's already in the package? Can JDBC-ODBC communicate with InterBase?
Please help.
Thank you,
Victor.Uf you want the password stored in the ODBC DSN, you'll need to go through the back door. This isn't something Oracle makes easy because it has horrible security implications-- the password will be stroed in the registry in plain text.
If you add a key "Password" with the value of your password to the registry where your DSN is, the ODBC driver will use that value to connect to the database. I don't recall the exact heirarchchy riht now, but a registry search for the name of your DSN ought to find it pretty quickly. As always, playing with your registry isn't recommended and may cause problems if you don't do it correctly.
Justin -
JDBC-ODBC Bridge to SPSS data files - Result Set Type is not supported
Hello,
As mentioned in the subject I am trying to read SPSS data files using the SPSS 32-Bit data driver, ODBC and the JDBC-ODBC Bridge.
Using this SPSS Driver I manged to read the data directly into an MS-SQL Server using:
SELECT [...] FROM
OPENROWSET(''MSDASQL.1'',''DRIVER={SPSS 32-BIT Data Driver (*.sav)};DBQ=' SomePathWhereTheFilesAre';SERVER=NotTheServer'', ''SELECT 'SomeSPSSColumn' FROM "'SomeSPSSFileNameWithoutExt'"'') AS a
This works fine!
Using Access and an ODBC System DNS works for IMPORTING but NOT for LINKING.
It is even possible to read the data using the very slow SPSS API.
However, when it comes to JDBC-ODBC the below code does only work in part. The driver is loaded successfully, but when it comes to transferring data into the resultset object the error
SQLState: null
Result Set Type is not supported
Vendor: 0
occurs.
The official answer from SPSS is to use .Net or to use their implementation with Python in their new version 14.0. But this is obviously not an option when you want to use only Java.
Does anybody have experience with SPSS and JDBC-ODBC??? I have tried the possible ResultSet Types, which I took from:
http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/ad/rjvdsprp.htm
and none of them worked.
Thank you in advance for your ideas and input & stay happy!
Here the code without all the rest of the class arround it:
// Module: SimpleSelect.java
// Description: Test program for ODBC API interface. This java application
// will connect to a JDBC driver, issue a select statement
// and display all result columns and rows
// Product: JDBC to ODBC Bridge
// Author: Karl Moss
// Date: February, 1996
// Copyright: 1990-1996 INTERSOLV, Inc.
// This software contains confidential and proprietary
// information of INTERSOLV, Inc.
public static void main1() {
String url = "jdbc:odbc:SomeSystemDNS";
String query = "SELECT SomeSPSSColumn FROM 'SomeSPSSFileName'";
try {
// Load the jdbc-odbc bridge driver
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
DriverManager.setLogStream(System.out);
// Attempt to connect to a driver. Each one
// of the registered drivers will be loaded until
// one is found that can process this URL
Connection con = DriverManager.getConnection (url);
// If we were unable to connect, an exception
// would have been thrown. So, if we get here,
// we are successfully connected to the URL
// Check for, and display and warnings generated
// by the connect.
checkForWarning (con.getWarnings ());
// Get the DatabaseMetaData object and display
// some information about the connection
DatabaseMetaData dma = con.getMetaData ();
System.out.println("\nConnected to " + dma.getURL());
System.out.println("Driver " +
dma.getDriverName());
System.out.println("Version " +
dma.getDriverVersion());
System.out.println("");
// Create a Statement object so we can submit
// SQL statements to the driver
Statement stmt = con.createStatement(ResultSet.TYPE_FORWARD_ONLY ,ResultSet.CONCUR_READ_ONLY);
// Submit a query, creating a ResultSet object
ResultSet rs = stmt.executeQuery (query);
// Display all columns and rows from the result set
dispResultSet (rs);
// Close the result set
rs.close();
// Close the statement
stmt.close();
// Close the connection
con.close();
}Thank you for your reply StuDerby!
Actually the above script was before, as you suggested, leaving the ResultSetTeype default. This did not work...
I am getting gray hair with SPSS - in terms of connectivity and "integratebility" none of their solutions offered is sufficient from my point of view.
Variable definitions can only be read by the slow API, data can only be read by Python or Microsoft Products... and if you want to combine both you are in big trouble. I can only assume that this is a company strategy to sell their Dimensions Platform to companies versus having companies developping their applications according to business needs.
Thanks again for any furthur suggestions and I hope, that some SPSS Developper will see this post!
Cheers!! -
Problem using Jdbc-Odbc Bridge
Hi,
I am using Java 2 SDK and I am trying to access MS Access database on my machine using Jdbc-Odbc bridge. I have set up the DSN in ODBC. But I get the following error when I run my program -
'No Suitable Driver'
Here's my code snippet-
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
String dsn = "jdbc:odbc:DriverInfoDB";
Connection con = DriverManager.getConnection(dsn,"","");
con.setAutoCommit(false);
Statement stmt;
String query = null; // SQL select string
ResultSet rs; // SQL query results
stmt = con.createStatement();
.....etc etc...
Where is the error in this code??
Help Needed!!
Thanks
Vivek.try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection(dsn,"guest","guest");
OR DriverManager.getConnection(dsn);
System.out.println("Conection's opened");
catch(ClassNotFoundException cnfe)
System.err.println(cnfe);
catch(SQLException sqle)
System.err.println(sqle);
try that code and double check you DSN Name . it's a good practice to greate a system DSN.
i hope that helps.
FEEL FREE TO ASK. WON'T BITE U
ABDUL -
How to create db conn for JDBC-ODBC Bridge for MS Access in ADF APP?
Sir,
How to create db conn for JDBC-ODBC Bridge for MS Access in ADF APP?
RegardsHello Every Body!
I succeeded in getting connect to the ms access database in adf application in jdeveloper as below:
First in control panel to to admin tools and go to data source(odbc) and create system dsn as bellow pic
Then go to jdeveloper resources ide conn and then database and new database conn and then select jdbc-odbc briddge and then give custom jdbc url as bellow pic
Cheers
tanvir -
JDBC-ODBC Bridge Performance To MS Access
Hey all, I'm running a Java app that extracts an entire table (set of tables) from Oracle and copies them into Access. The easiest implementation has been to use a DSN-less Type 1 JDBC-ODBC bridge connection to Access, but unfortunately the inserts are taking too long.
I have tried both Statement and PreparedStatement approaches, with both single row and batch updates. Some of the performance times, relative to the computer I am on (PIII 1 gHz with 256 RAM), are as follows:
Via Batch, about 8min, 15 seconds per 10,000 rows.
Via Single Row updates/inserts, about 52 minutes for 45,000 rows.
I've tried alot of varieties with batch, but 10,000 seemed to be the best. The largest table is only 45,000 rows (right now), but has the potential to grow much larger (obviously). This application needs to backup 4 databases, each with N tables (current N=7, but will expand). I'm trying to knock down the times and increase performance, but am not sure what is "reasonable" for Type 1 connections with JDBC. I've seen third party drivers, Type 3, for Access...but don't want to run the middle tier server for filtering request through. I'd rather use Type 4, but can't seem to find any for Access.
Any suggestions? Recommendations? Let me know! Thanks all! :)Hi,
If its a backup/batch process why are you worrying about performance, its only an offline process :) even if has to be triggered during an OLTP run this task asynchronously.
I dont know why you have chosen java to do this ??? any way prepared statements with non scrollable resultsets will increase you performance better tha scrollable normal statements.
Rajesh -
I'm developing an application using EJBs in a development environment with Sun Application Server, Sql Server and NetBeans IDE 4.1. I'm using entity beans and session beans in my application. But, when I try to connect to database using a Servlet or JSP with the session beans, the connection with database could not be established. This is my problem!!!
First, you probably shouldn't use the JDBC/ODBC bridge. Any serious and many non-serious databases have real drivers. Is there anything but Access that really needs the bridge...? Use the jTds driver (google for it). Or just last week Microsoft beta'ed a new JDBC driver for MSSQL; no idea how good it is. Some smalltalk on that: http://www.theserverside.com/news/thread.tss?thread_id=35063
Second, what error do you get?
If it is "connection refused", here is my standard first aid check list:
- Check host name in connect string.
- Check port number in connect string.
- Try numeric IP address of server host in connect string, in case name server is hosed.
- Are there any firewalls between client and server blocking the port.
- Check that the db server is running.
- Check that the db server is listening to the port. On the server, try: "telnet localhost the-port-number". Or "netstat -an", there should be a listening entry for the port.
- Try "telnet serverhost the-port-number" from the client, to see if firewalls are blocking it.
- If "telnet" fails: try it with the numeric ip address.
- If "telnet" fails: does it fail immediately or after an obvious timeout? How long is the timeout?
- Does the server respond to "ping serverhost" or "telnet serverhost" or "ssh serverhost"? -
Null Pointer Exception using JDBC-ODBC bridge on Linux
Wonder if anyone can help me with this one?
I am attempting to use the JDBC-ODBC bridge on Fedora with J2SDK 1.4.2_04, however I am getting a NullPointerException whenever I get the connection. I can get the JDBC connection to work but it is a requirement that ODBC be used.
The code is as simple as it can get.
import java.sql.*;
public class TestClass
public static void doConnection()
try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection cn = DriverManager.getConnection("jdbc:odbc:DB");
catch (Exception e)
e.printStackTrace();
public static void main(String[] args)
doConnection();
}Running this program using java -verbose TestClass I get the following output.
[Loaded sun.jdbc.odbc.JdbcOdbc from /usr/java/j2sdk1.4.2_04/jre/lib/rt.jar]
[Loaded java.lang.UnsatisfiedLinkError from /usr/java/j2sdk1.4.2_04/jre/lib/rt.jar]
[Loaded java.sql.SQLException from /usr/java/j2sdk1.4.2_04/jre/lib/rt.jar]
[Loaded java.sql.SQLWarning from /usr/java/j2sdk1.4.2_04/jre/lib/rt.jar]
java.lang.NullPointerException
[Loaded java.lang.StackTraceElement from /usr/java/j2sdk1.4.2_04/jre/lib/rt.jar]
at sun.jdbc.odbc.JdbcOdbcDriver.initialize(JdbcOdbcDriver.java:436)
at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:153)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:193)
at TestClass.doConnection(TestClass.java:13)
at TestClass.main(TestClass.java:96)
[Loaded java.lang.Shutdown from /usr/java/j2sdk1.4.2_04/jre/lib/rt.jar]
[Loaded java.lang.Shutdown$Lock from /usr/java/j2sdk1.4.2_04/jre/lib/rt.jar]
The UnsatisfiedLinkError suggests to me that a library cannot be found, but I don't know what library.
As far as I know I have configured ODBC correctly. I can achieve connectivity to my database using other tools and I still get this same error irrespective of whether the DSN is valid or not.
I have installed the unixODBC rpm.
Any help/insite would be greatly appreciated.This is the output of ldd. Everything appears to be resolved.
linux-gate.so.1 => (0x00cf5000)
libodbcinst.so => /usr/sybase/lib/libodbcinst.so (0x001d5000)
libjava.so => libjava.so (0x008af000)
libjvm.so => /usr/java/j2sdk1.4.2_04/jre/lib/i386/client/libjvm.so (0x002a7000)
libc.so.6 => /lib/i686/libc.so.6 (0x00d77000)
libdbtasks7.so => /usr/sybase/lib/libdbtasks7.so (0x00eb2000)
libdl.so.2 => /lib/libdl.so.2 (0x00111000)
libstdc++-libc6.2-2.so.3 => /usr/lib/libstdc++-libc6.2-2.so.3 (0x00115000)
libm.so.6 => /lib/i686/libm.so.6 (0x008fb000)
libverify.so => libverify.so (0x0016e000)
libnsl.so.1 => /lib/libnsl.so.1 (0x00180000)
libpthread.so.0 => /lib/i686/libpthread.so.0 (0x006d0000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00157000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00b75000)
The ODBC is a Sybase driver and is loaded from elsewhere. I will check for any known compatibility issues.
Maybe you are looking for
-
After IOS 8 update I cannot access wifi
My ipad mini says I have wifi connected, but it doesn't work. no apps, no safari, nothing. Happened immediately after IOS 8 upgrade. Any ideas??
-
Standard and Non-standard exports and queries issue
Hi, We have created a few STANDARD books with standard exports in them. The standard exports use standard queries. The ISSUE is that in the Verifications/Filters tab, where we have put in a lot of queries - ONLY the STANDARD queries show up. We would
-
How to clean the printheads on a C209a all in one
I have just replaced all my ink cartridges, but can't get anything to print. I re-installed the printer, ran the 'clean printhead' command in the 'tools' menu and still nothing. Can someone please help me with how to clean the actual printheads manu
-
Safari and Windows Media Plug-in
Can someone explain how I might get this radio station to play? When I try I get the error: "Cannot open the file. Verify the path and file name are correct and try again." CBC Radio Victoria Streaming Windows Media: http://www.cbc.ca/listen/streams/
-
I cant buy any thing