Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

how java interact with the Excplicit Cursor?

Thread view: 
Garg - 10 Mar 2007 04:15 GMT
Hi All,

I am facing a small and i am not able to find the direction in which i
should move.

I am using IntraSystem Cache as a DataBase and  declaired Explicit
cursor there.
I tried with the simple database connection as followes

           String url = "jdbc:Cache://127.0.0.1:" + port + "/User/
log.txt";
           String user = "_SYSTEM";
           String password = "SYS";
           String stQueryP = "{call ABC.XYZ_ByPQR}";

           Class.forName ("com.intersys.jdbc.CacheDriver");
           Connection dbconnection =
DriverManager.getConnection(url,user,password);
           CallableStatement cstmt =
dbconnection.prepareCall(stQueryP);
           int j = 0;
           while (rs.next())
           {
               System.out.print(j);
               System.out.println("  " + rs.getString(1) + "  " +
rs.getString(2));
               j++;
           }

I am getting unlimited records and all are null only.

Can anyone please suggest me how should i move forward.

Should i need to declare cursor in java also.

Thanks
Tarun Garg
Joshua Cranmer - 10 Mar 2007 18:51 GMT
> Hi All,
>
[quoted text clipped - 33 lines]
> Thanks
> Tarun Garg

While I cannot answer your database question, I can answer your question
at the end: look around java.awt.Cursor to handle cursors.

As another note, *please* try to follow basic punctuation,
capitalization, spelling, and grammar. It makes answering questions easier.
Daniel Pitts - 12 Mar 2007 03:45 GMT
On Mar 10, 11:51 am, Joshua Cranmer <Pidgeo...@epenguin.zzn.com>
wrote:
> > Hi All,
>
[quoted text clipped - 39 lines]
> As another note, *please* try to follow basic punctuation,
> capitalization, spelling, and grammar. It makes answering questions easier.

Somehow I doubt that the concept of a Database Cursor and an Abstract
Windowing Toolkit Cursor are at all similar.
Garg - 13 Mar 2007 13:12 GMT
so their is not way to get this thing done.

tarun
Ian Wilson - 14 Mar 2007 11:07 GMT
> so their is not way to get this thing done.
>
> tarun

I wouldn't draw that conclusion from what Daniel wrote!

You might get better help if you

1) Quote (the relevant parts of) what you are replying to.

2) Provide a complete compilable and runnable example program.

3) Explain String stQueryP = "{call ABC.XYZ_ByPQR}";
   what exactly does "ABC.XYZ_ByPQR" do?

4) Explain why you haven't assigned rs
   (e.g. ResultSet rs = cstmt.executeQuery();)
   prior to using rs.next().
Garg - 15 Mar 2007 05:36 GMT
> 3) Explain String stQueryP = "{call ABC.XYZ_ByPQR}";
>     what exactly does "ABC.XYZ_ByPQR" do?

ABC.XYZ_ByPQR is a stored procedure in Cache DataBase(interSystems).
In this stored procedure i had declared the explicit cursor. But I am
not geting any record in the result set.

> 4) Explain why you haven't assigned rs
>     (e.g. ResultSet rs = cstmt.executeQuery();)
>     prior to using rs.next().

It's my fault i forget to paste that line.

           String url = "jdbc:Cache://127.0.0.1:" + port + "/User/
log.txt";
           String user = "_SYSTEM";
           String password = "SYS";
           String stQueryP = "{call ABC.XYZ_ByPQR}";

           Class.forName ("com.intersys.jdbc.CacheDriver");
           Connection dbconnection =
DriverManager.getConnection(url,user,password);
           CallableStatement cstmt =
dbconnection.prepareCall(stQueryP);
           cstmt.execute();
           ResultSet rs = cstmt.getResultSet();
           int j = 0;
           while (rs.next())
           {
               System.out.print(j);
               System.out.println("  " + rs.getString(1) + "  " +
rs.getString(2));
               j++;
           }


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.