CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: JDBC Trouble

  1. #1
    Join Date
    May 1999
    Location
    Bangalore,India
    Posts
    18

    JDBC Trouble

    Hi,

    We are using Oracle 8.0 and JDK 1.2.

    While retrieving data through JDBC, from a table, a cryptic General error message is coming.

    The table structure is :

    Student_Name varchar2(10)
    Student_id varchar2(5)
    Books_issued Books

    where Books is a nested table created from the Object Books_Type which has the following structure:

    Books_id varchar2(5)
    Author varchar2(10)
    Title varchar2(10)
    Issue_Date Date
    Return_Date Date


    The query :

    select * from student;

    works in SQL but not in JDBC.

    But, queries like
    select books_issued the(select books_issued from student )
    or
    select student_id from student

    is working through JDBC.

    The code in our java program is given below :

    import java.sql.*;
    import genins.dbconnect.*;

    public class ORDMS
    {
    public static void main(String ar[])
    {

    ResultSet res ;
    MDBConnect st = new MDBConnect();
    try
    {
    res = st.executeQuery("select * from student ");
    while(res.next())
    {
    System.out.println("inside next..");
    System.out.println("Integer"+res.getString(1));
    System.out.println(" "+res.getString(2));
    System.out.println(" "+res.getString(3));
    System.out.println(" "+res.getString(4));
    System.out.println(" "+res.getString(5));
    }
    }
    catch(SQLException e)
    {
    System.out.println("Exception ERROR"+e);
    }
    }
    }


    The Connectivity to the database is done through a java program in the package dbconnect.

    After executing the above piece of code, only this particular SQL query is not executing and gives the cryptic message : General Error.

    Please tell us whether it is possible to retrieve all the fields through a single SQL Query and how...

    Regards,

    JavaTeam.

    Kishore Kumar D
    Bangalore.
    India.

  2. #2
    Join Date
    Sep 1999
    Posts
    2

    Re: JDBC Trouble

    There are some known Oracle jdbc bugs that generate 'weird' error messages. I've got similar but different problems with some code that I am creating here. Oracle tell me that the latest version of their jdbc drivers fixes these, and can be gotten from the download section of technet.oracle.com - note that I've not tried it yet so cannot say how well it works.

    Rick



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured