• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JdbcOdbcDriver/Stored procedures. Please help

 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear all,
I'm using Personal Oracle 7 with jdbc-odbc bridge and JDK 1.3 on
Win98. Everything works fine but not able to call Oracle stored procedures from within Java.
Does not sun.jdbc.odbc.JdbcOdbcDriver support calls to stored procedures?
Many thanks
Ambrose Tati
 
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ambrose!!
what U use to fetch the Oracle Stored Procedure in Java.Let see U'r code.
chandran..
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi chandran,
I have a Oracle stored procedure with the following prototype:
procedure get_message(msg out varchar2)
In my Java program after successfull connection to my Personal Oracle7 I do:
...
try {
CallableStatement cs = con.prepareCall("{call message(?)}");
cs.registerOutParameter(1, Types.VARCHAR);
cs.executeUpdate();
String msg = cs.getString(1);
} catch (Exception ex) {
System.out.println(ex.getMessage());
}
...
What am I doing wrong?
Thanks
Ambrose
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Basically it would be helpful if u also give ur stored procedure.
try this...
instead of ur calling ur stored procedure as
"{call message(?)}"
call it as
"{?=call message()}"
if u are returning a variable from ur stored procedure. Might work..but still depends on how u have written ur stored procedure.
Reply as to whether this was helpful.
Regards,
Ganp.
 
Raajesh Chandran
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ambrose!!
U'r codings are correct.No problem.Only Version is Problem.I think U R using Oracle7.It doesn't support JDK1.3.I mean U can't retrive OUT parameter by using Oracle7 or Oracle8.
Try with this by using Oracle8i.Surely it will work fine.I got it.
BestWishes.,
chandran
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
dear all,
i have one doubt in the query retreiving process.
...
Statement stmt;
Resultset rs;
....
rs=stmt.executeQuery("select distinct(some_field) from some_table");
while(rs.next())
{
...
}
what is the ResultSet value if there is a redundant row in the table?
can u tell with an example code.
many thanks
sunil
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic