- import java.awt.*;
-
import java.awt.event.*;
-
import java.sql.*;
-
class frame1 extends Frame implements ActionListener
-
{
-
Button bnext;
-
TextField txtsid;
-
TextField txtsname;
-
TextField txtstream;
-
TextField txtgrade;
-
TextField txtage;
-
frame1()
-
{
-
setLayout(new FlowLayout());
-
bnext =new Button("Next");
-
txtsid=new TextField(20);;
-
txtsname=new TextField(20);
-
txtstream=new TextField(20);
-
txtgrade=new TextField(20);
-
txtage=new TextField(20);
-
bnext.setBounds(80,80,50,20);
-
txtsid.setBounds(200,200,20,20);
-
txtsname.setBounds(200,200,20,20);
-
txtstream.setBounds(200,200,20,20);
-
txtgrade.setBounds(200,200,20,20);
-
txtage.setBounds(200,200,20,20);
-
add(bnext);
-
add(txtsid);
-
add(txtsname);
-
add(txtstream);
-
add(txtgrade);
-
add(txtage);
-
setBackground(Color.gray);
-
addWindowListener(new windowhandler());
-
bnext.addActionListener(this);
-
}
-
public void actionPerformed(ActionEvent e)
-
{
-
try
-
{
-
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
-
Connection con=DriverManager.getConnection("jdbc:odbc:lath","scott","ritika");
-
Statement st=con.createStatement();
-
ResultSet.TYPE_FORWARD_ONLY rs=st.executeQuery("select * from profile");
-
while(rs.next())
-
{
-
rs.relative(1);
-
String s=rs.getString("sname");
-
String sid=rs.getString("sid");
-
String stream=rs.getString("stream");
-
int age=rs.getInt("age");
-
int grade=rs.getInt("grade");
-
txtsid.setText(sid);
-
txtsname.setText(s);
-
txtstream.setText(stream);
-
}
-
//txtgrade.setText(grade);
-
//txtage.setText(age);
-
}
-
catch(Exception ex)
-
{
-
txtsname.setText(ex.getMessage());
-
}
-
}
-
-
public static void main(String args[])
-
{
-
frame1 f1=new frame1();
-
f1.setVisible(true);
-
f1.setSize(400,300);
-
f1.addWindowListener(new windowhandler());
-
}
-
}
-
-
class windowhandler extends WindowAdapter
-
{
-
public void windowClosing(WindowEvent e)
-
{
-
System.exit(0);
-
}
-
}
-
Also how can i display the data one by one in the textboxes
it shows only the last record
2 1700
could you post the whole generated Stacktrace? ( about the error )
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
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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: ....
|
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...
|
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...
|
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...
|
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;...
|
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);
|
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...
|
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...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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...
|
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...
|
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...
|
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,...
|
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...
| |