Two Laptop Bag*
The moose likes JDBC and the fly likes Oracle ODBC Driver Problems. Please help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Oracle ODBC Driver Problems. Please help" Watch "Oracle ODBC Driver Problems. Please help" New topic
Author

Oracle ODBC Driver Problems. Please help

Ambrose R Tati
Greenhorn

Joined: Nov 06, 2000
Posts: 21
Dear all,
I've recently downloaded Oracle73 Version 2.05.0301 ODBC driver.
Installed ok and runs ok, but I get runtime exceptions when calling PL/SQL stored procedures with parameters. Also can't use any new features in the JDBC 2.0 API. Doesn't this Oracle ODBC driver version support what I'm trying to do? Can anybody please help?
I'm using Java 1.3/Personal Oracle 7/Windows98
Thanks
Ambrose
KASI VISHWANATH
Ranch Hand

Joined: Aug 06, 2000
Posts: 60
Can u explain what errors are u getting in detail
------------------
I.K.VISHWANATH


I.K.VISHWANATH
Ambrose Tati
Ranch Hand

Joined: Oct 03, 2000
Posts: 55
Originally posted by KASI VISHWANATH:
Can u explain what errors are u getting in detail

Dear Kasi,
I've recently downloaded Oracle73 Version 2.05.0301 ODBC driver.
Installed ok and runs ok, but I get runtime exceptions when calling PL/SQL
stored procedures with parameters. Also can't use any new
features in the JDBC 2.0 API. Doesn't this Oracle ODBC driver version support what I'm trying to do? Can anybody please help?
I'm using Java 1.3/Personal Oracle 7/Windows98
For example this call to my stored procedure add_address, which takes two IN parameters
...
CallableStatement storedProc =
con.prepareCall("{call add_address(?,?)}");
storedProc.setString(1,"AAAA");
storedProc.setString(2,"BBBB");
storedProc.execute();
...
Throws the following exception:
java.Sql.SQLException:[Oracle][ODBC Oracle Driver][Oracle OCI] ORA-00900: Invalid SQL statement.
Thanks
Ambrose
KASI VISHWANATH
Ranch Hand

Joined: Aug 06, 2000
Posts: 60
There is a problem in the oracle procedure .Try to use some dummy values in sql and check if it works fine there or not . Then integrate it with java . Here is a brief explanation about ora900 error
The statement is not recognized as a valid SQL statement. This error can occur if the Procedural Option is not installed and a SQL statement is issued that requires this option (for example, a CREATE PROCEDURE statement). You can determine if the Procedural Option is installed by starting SQL*Plus. If the PL/SQL banner is not displayed, then the option is not installed.

------------------
I.K.VISHWANATH
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
If you are accesing Oracle from JDBC, you should not really be using the JDBC-ODBC bridge. There are several much better direct JDBC to Oracle drivers available which perform better, support Oracle data types better and support newer JDBC features than the JDBC-ODBC driver. Check out the JDBC drivers on the Oracle web site.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Ambrose Tati
Ranch Hand

Joined: Oct 03, 2000
Posts: 55
Dear Frank,
I did check out the JDBC drivers on the Oracle web site, but did not find any JDBC drivers for my platform which is:
jdk1.3/Personal Oracle7/Windows98.
Any suggestions?
Thanks in advance
Ambrose Tati
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
I use JDK1.3, Win 98 and access the full Oracle 7.3 using the generic Oracle 7 drivers. Is Personal Oracle much different? It's probably worth giving the generic Oracle 7 drivers a try, they are pure Java and definately work on JDK1.3
Ambrose Tati
Ranch Hand

Joined: Oct 03, 2000
Posts: 55
Hi Frank,
I'm a bit confused. What do you mean by generic Oracle 7 (JDBC) drivers? Are they drivers for all platforms? Can you give, a concrete example please?
Thanks in advance.
Ambrose
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
The Oracle "thin" drivers are pure Java, and work on any system. (you must have Java already, or you wouldn't be interested in JDBC). All the Oracle databases which I have used (various flavours of 7 and 8) work well with these "thin" drivers.
Look for a file called "classes111.zip" or "classes12_01.zip"; get one and stick it in your classpath. You may even have one already.
Ambrose R Tati
Greenhorn

Joined: Nov 06, 2000
Posts: 21
Dear Frank
I've just downloaded classes111.zip I've saved the classes111.zip in my D:\JdbcDrivers directory.
I set the CLASSPATH to point to D:\JdbcDrivers.
But when I try to compile a simple java file the following error:
Can not access class oracle.jdbc.driver.OracleDriver
Please help.
Thanks
Ambrose
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
With zip files and jar files you need to put the actual name of the file in your classpath, not just the directory it lives in. Or if you are using Java 2, you can put it into the jre/lib/ext directory, where it should be picked up automatically.
Ambrose Tati
Ranch Hand

Joined: Oct 03, 2000
Posts: 55
Hi Frank,
Thanks a lot for your advice. To make things easy for myself I just copied into the downloaded "classes111.zip" file into my jre/lib/ext directory as you suggested and it seems fine now.
Once again, thanks a lot.
Ambrose Tati
Ambrose Tati
Ranch Hand

Joined: Oct 03, 2000
Posts: 55
Hi Frank,
I'm trying to set up a connection string to call
DriverManager.getConnection() with, along with "Demo" as user
and "Demo" as the password on my Personal Oracle7/Windows98 as
in the following:
...
Class.forName("oracle.jdbc.driver.OracleDriver");
String connString = ...;
Connection conn =
DriverManager.getConnection(connString,pin,pin);
...
Should it be something like: "jdbc racle:thin:@" ...
Can you please help me out?
Thanks
Ambrose
senay baykut
Greenhorn

Joined: Jan 31, 2003
Posts: 1
hi,
im a user oracle odbc for windows 7.01 i have some problems about odbc driver how i provide odbc driver for oracle 7.01 pleas help me!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Oracle ODBC Driver Problems. Please help
 
Similar Threads
How to add oracle thin driver in NetBeans 5.0
Odbc problem help me
jdbc odbc driver download
Establishing Connections to a Data base on a different machine
UnsupportedOperationException and ODBC-driver