473,403 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

When i run this code it says that resultset object type_forward_only not indentified

Expand|Select|Wrap|Line Numbers
  1. import java.awt.*;
  2. import java.awt.event.*;
  3. import java.sql.*;
  4. class frame1 extends Frame implements ActionListener
  5. {
  6.     Button bnext;
  7.         TextField txtsid;
  8.         TextField txtsname;
  9.         TextField txtstream;
  10.         TextField txtgrade;
  11.         TextField txtage;
  12.         frame1()
  13.     {
  14.         setLayout(new FlowLayout());
  15.         bnext =new Button("Next");
  16.         txtsid=new TextField(20);;
  17.         txtsname=new TextField(20);
  18.         txtstream=new TextField(20);
  19.         txtgrade=new TextField(20);
  20.         txtage=new TextField(20);
  21.         bnext.setBounds(80,80,50,20);
  22.         txtsid.setBounds(200,200,20,20);
  23.         txtsname.setBounds(200,200,20,20);
  24.         txtstream.setBounds(200,200,20,20);
  25.         txtgrade.setBounds(200,200,20,20);
  26.         txtage.setBounds(200,200,20,20);
  27.         add(bnext);
  28.         add(txtsid);
  29.         add(txtsname);
  30.         add(txtstream);
  31.         add(txtgrade);
  32.         add(txtage);
  33.         setBackground(Color.gray);
  34.         addWindowListener(new windowhandler());    
  35.         bnext.addActionListener(this);
  36.     }
  37.     public void actionPerformed(ActionEvent e)
  38.     {
  39.         try
  40.             {
  41.             Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
  42.             Connection con=DriverManager.getConnection("jdbc:odbc:lath","scott","ritika");
  43.             Statement st=con.createStatement();
  44.             ResultSet.TYPE_FORWARD_ONLY rs=st.executeQuery("select * from profile");
  45.             while(rs.next())
  46.             {
  47.                 rs.relative(1);
  48.             String s=rs.getString("sname");
  49.             String sid=rs.getString("sid");
  50.             String stream=rs.getString("stream");
  51.             int age=rs.getInt("age");
  52.             int grade=rs.getInt("grade");
  53.             txtsid.setText(sid);
  54.             txtsname.setText(s);
  55.             txtstream.setText(stream);
  56.             }
  57.                 //txtgrade.setText(grade);
  58.                 //txtage.setText(age);
  59.             }
  60.             catch(Exception ex)
  61.             {
  62.                 txtsname.setText(ex.getMessage());
  63.             }
  64.     }
  65.  
  66.     public static void main(String args[])
  67.     {
  68.         frame1 f1=new frame1();
  69.         f1.setVisible(true);
  70.         f1.setSize(400,300);
  71.         f1.addWindowListener(new windowhandler());
  72.         }
  73. }
  74.  
  75.     class windowhandler extends WindowAdapter    
  76.         {
  77.         public void windowClosing(WindowEvent e)
  78.         {
  79.         System.exit(0);
  80.         }
  81.         }
  82.  
Also how can i display the data one by one in the textboxes
it shows only the last record
Dec 31 '09 #1
2 1700
sukatoa
539 512MB
could you post the whole generated Stacktrace? ( about the error )
Jan 1 '10 #2
RedSon
5,000 Expert 4TB
Please enclose your posted code in [code] tags (See How to Ask a Question).

This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

Please use [code] tags in future.

MODERATOR
Jan 5 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Iain Downie | last post by:
Anyone out there know of an easy way to fill a Java ArrayList in a JSP from an array of strings held in a external JavaScript file? We need to load up a large number of strings into the page and...
3
by: Koen | last post by:
Hi, first of all, the machine setup server 1: - UDB2 7.2.5; COUNTRY=1, location = US, IBM1250 codepage - Locale: US English; Regional Settings: English; Keyboard: Dutch; decimal separator: ....
2
by: Vinitha | last post by:
I have been trying to display a resultset in atable format using the table object from the code behind page. Can anyone suggest whether i am in the right direction or do we have any other approach...
4
by: _link98 | last post by:
Problem: java ResultSet cursor from SQL/PL stored-procedure is FORWARD_ONLY. Is it possible to have ResultSet cursors from SQL/PL procedures to scroll forward and backwards? Perhaps I am missing...
18
by: cj | last post by:
members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe. I'm under the impression before you can use a class you have to make an...
0
by: David Linsin | last post by:
I created a simple test case to reproduce the problem (also check Bug #15500): import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement;...
5
by: Fir5tSight | last post by:
Hi All, I have a C#.NET code as follows: private void ScanInput_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) { try { Row lRow = this.Connection.InsertScannedFile(ID);
1
by: 276q | last post by:
I'm kind of new to asp.net from classic asp, I need to get records/ fields from a resultset to display on aspx page (no datalist, repeater, or datagrid): <script runat="server"> Sub...
3
by: webandwe | last post by:
Hi, the following coding is and the whole of the admin, it uploads images you select to the folder called images: But the problem is is sets the images permissions to 600 and I need them to be 644...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.