if(e.getSource()==b5) { ta.setText(str); try { con=d.getConnect(); PreparedStatement pst=con.prepareStatement("select * from test"); ResultSet rs=pst.executeQuery(); while(rs.next()) { int n1=rs.getInt(1); String n2=rs.getString(2); String n=rs.getString(3); double n3=rs.getDouble(4); String n4=rs.getString(5); /*append all values to the text area by ta.append()*/ ta.append(""+n1+"\t"+n2+"\t"+n+"\t"+n3+"\t"+n4+"\n"); //JOptionPane.showMessageDialog(null,n1+"\n"+n2+"\n"+n3+"\n"+n4); l5.setText("View test Table Data"); } }catch(Exception ae){ ae.printStackTrace(); } }//Button b5 if if(e.getSource()==b2) { ta.setText(str); int sno=Integer.parseInt(t1.getText()); try { con=d.getConnect(); PreparedStatement pst=con.prepareStatement("delete from test where Empnumber="+sno); int i=pst.executeUpdate(); if(i>0) l5.setText("Deletion Operation Performed"); else l5.setText("Deletion Operation Failed"); pst.clearParameters(); t1.setText(""); t2.setText(""); t.setText(""); t3.setText(""); t4.setText(""); }catch(Exception ae){ ae.printStackTrace(); } }//Button b2 if if(e.getSource()==b3) { ta.setText(str); int sno=Integer.parseInt(t1.getText()); String sname=t2.getText(); String spwd=t.getText(); double sal=Double.parseDouble(t3.getText()); String address=t4.getText(); try { con=d.getConnect(); //PreparedStatement pst=con.prepareStatement("update test set sname=?,spwd=?,sal=?,address=? where sno=?"); PreparedStatement pst=con.prepareStatement("update test set Empname=?,Emppassword=?,Empsal=?,Empadd=? where Empnumber=?"); pst.setString(1,sname); pst.setString(2,spwd); pst.setDouble(3,sal); pst.setString(4,address); pst.setInt(5,sno); int i=pst.executeUpdate(); if(i>0) l5.setText("Update Operation Performed"); else l5.setText("Update Operation Failed"); pst.clearParameters(); t1.setText(""); t2.setText(""); t.setText(""); t3.setText(""); t4.setText(""); }catch(Exception ae){ ae.printStackTrace(); } }//button b3 if if(e.getSource()==b4) { ta.setText(str); int sno=Integer.parseInt(t1.getText()); try { con=d.getConnect(); PreparedStatement pst=con.prepareStatement("select * from test where Empnumber="+sno); ResultSet rs=pst.executeQuery(); if(rs.next()) { t1.setText(""+rs.getInt(1)); t2.setText(rs.getString(2)); t.setText(rs.getString(3)); t3.setText(""+rs.getDouble(4)); t4.setText(rs.getString(5)); ta.append(t1.getText()+"\n"+t2.getText()+"\n"+t.getText()+"\n"+t3.getText()+"\n"+t4.getText()); l5.setText("Record Avilable with Serial Number : "+sno); } else { l5.setText("No Record Avilable with Serial Number : "+sno); pst.clearParameters(); t1.setText(""); t2.setText(""); t.setText(""); t3.setText(""); t4.setText(""); } }catch(Exception ae){ ae.printStackTrace(); } }//Button b5 if if(e.getSource()==exit) System.exit(0);
} } class Database { public static void main(String[] args) { D1 d=new D1(); }
}
in this code the o/p is coming properly. My problem is when we click on "reports" button the seprate frame(window) is coming , but the window is size is very very small . I want that a medium screen and the mattter inside the frame is middle the new window
pls help me.
View Answers
July 23, 2010 at 11:19 AM
Hi Friend,
Try the following code:
if(e.getSource()==b){ int sno=Integer.parseInt(t1.getText()); try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:access"); PreparedStatement pst=con.prepareStatement("select * from test where Empnumber="+sno); ResultSet rs=pst.executeQuery(); JFrame f=new JFrame(); f.getContentPane().setLayout(null); int n1=0,n3=0; String n="",n2="",n4="";
Reading big file in Java
Reading big file in Java How to read a big text file in Java program?
Hi,
Read the complete tutorial at How to read big file line by line in java?
Thanks
The Big Competition - Java Beginners
The Big Competition Let the Machine understand you
-----------------------------
Each team is asked to implement an application that can execute at least 3 commands ? depend on the operating system that you are working
The Big Competition - Java Beginners
The Big Competition Let the Machine understand you
-----------------------------
Each team is asked to implement an application that can execute at least 3 commands ? depend on the operating system that you are working
The Big Competition - Java Beginners
The Big Competition Let the Machine understand you
-----------------------------
Each team is asked to implement an application that can execute at least 3 commands ? depend on the operating system that you are working
The Big Competition - Java Beginners
The Big Competition Let the Machine understand you
-----------------------------
Each team is asked to implement an application that can execute at least 3 commands ? depend on the operating system that you are working
java Big - Java Beginners java Big Hi
pls observe the following coed:
import mysql.DataAcc;
// import package class for getting database connection
import java.sql.*;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
class
java program_big digits multiplication.. java program_big digits multiplication.. i want program about big digits multiplication program using java..plz tel me answer
Big Blob Structure Java Notes
Big Blob Structure
A common style of programming is to put all processing in the GUI.
This works Ok as long at the "model", the logic, is so small that it isn't
worth putting into a separate
Java Big Problem - Java Beginners JavaBig Problem Input the current meter reading and the previous meter reading and calculate the electic bill with the following conditions(all... on Java visit to :
http://www.roseindia.net/java/
Thanks
Vineet
Very Big Problem - Java Beginners
Very Big Problem Write a 'for' loop to input the current meter reading and the previous meter reading and calculate the electic bill with the following conditions(all must be fulfilled in one class only):
(i)if unit(current
Add two big numbers
Add two big numbers
In this section, you will learn how to add two big
numbers. For adding two numbers implement two big decimal numbers then apply the Sum() method
How to read big file line by line in java?
Learn how to write a program in java for reading big text file line by line... to
read the big file in your java program. For example you have to process some... is very useful in reading big file line by line in
Java.
In this tutorial we
My big doubt on java prgmn.. need solution asap
My big doubt on java prgmn.. need solution asap How do you write prgrm 4 dis : 3% discount is given if payment is made within 30days of purchase. date of purchase and payment entered by user
Prepared Statement Set Big Decimal
Prepared Statement Set Big Decimal
 ...
the big decimal and how can be set it in the database table by using the PreparedStatement
interface of java.sql package. But here arises a question, what is
big
Algorithms: Big-Oh Notation Java NotesAlgorithms: Big-Oh Notation
How time and space grow as the amount... you aware of potential problems.
Dominant Term
Big-Oh (the "O" stands for "order... to these multipliers
in determining the performance,
but for the first round of analysis using Big
JavaScript method big()
JavaScript method big()
This section illustrates you the use of JavaScript method big(). The big()
method allows you to display the specified string in a big font. You can see
The Open Source World is a Big Part of PHP
of different forms of technology. The big reason for this comes from how PHP is an open... with others. The big benefit of this is that it is free to use.... It can also work with other types of client side scripts like the Java script
What is Big Data?
By many Big Data represents the last envisaged frontier of present... represents the present IT scene, then Big Data is certainly going to be the next big leap. Let us now have a look at the definition of this term before
Java Developers Desk-EJB 3.0 Java Developers Desk-EJB 3.0
Migrating to EJB 3.0 is a big step towards simplifying the process of developing EJBs, which reduces lots of complexities, time and cost
JUnit and Test-Driven Development Java NotesJUnit and Test-Driven Development
Test-Driven Development
One of the big changes in software engineering, and part of the agile
methodology... facto, tool for Java is JUnit (www.junit.org).
JUnit is hugely popular with support
Custom Java Software Application Development Solutions
Custom Java Software Application Development
Java Application Programming Services
The utility of Java based custom software application development has received a big boost with increase in global computer technologies
Java
Java I have a big problem i have to convert excel file into data base through java?? so please suggest me java code.
Please visit the following links:
http://www.roseindia.net/tutorial/java/poi
Java
Java I have a big problem i have to convert excel file into data base through java?? so please suggest me java code.
Please visit the following links:
http://www.roseindia.net/tutorial/java/poi
What is Struts - Struts Architecturec
small and big software projects.
Struts is an open source framework used... pattern. It uses
and extends the Java Servlet API to encourage developers to ...
the Java Server Pages (JSP) for the view presentation. To extend the capability
Android Application Development
;
Android is the newest big-ticket entrant in the crowded... Eclipse IDE required for Java based programming on the Android. Finally, install... for great Java application development. If you need a resourceful library
JAVA - Java Interview Questions
);
int big = Integer.MIN_VALUE;
System.out.println("Enter 5 numbers...();
if (number > big) {
big = number;
}
}
System.out.println("Largest Number= " + big
Eclipse Plugings
Eclipse IDE is extensively used to for developing small and big...;
Java Eclipse Shortcuts
In this section, I have presented you the very useful
and commonly used Java Eclipse Shortcuts. After learning
java - Java Beginners
(String[] args) {
Scanner input = new Scanner(System.in);
int big...) {
small = number;
}
if (number > big) {
big = number;
}
}
System.out.println("Largest Number
graphics - Java Beginners
graphics In java-graphics..
I want to draw a rectangle and resize that rectangle(small,big) ..by using mouse cursors
Need to create a java applet
Need to create a java applet Hi people i need to create a java applet for which there will be 2 buttons to indicate small and big. I need to make a circle. When i click small the circle should be small and when i click big
Ada Books
Ada Books
The Big Online Book of Linux Ada Programming
Ada 95 is arguably... to Java and execution speeds similar to and sometimes exceeding C. gnat
Reading files in Java
file in Java. What is the best way to read the file in Java as its big file.
Please provide me the example code for reading big text file in Java. What do you suggest for Reading files in Java?
Thanks
Java - Java Interview Questions
if it is as big as a virtual machine, so that programs written in Java langauge...Java What are the Disadvantages of Java ? Hi friend,
Java has the following disadvantages.
1. Because programs written in Java
NexentaOS Alpha 2 has been released
; Java Runtime Environment; more audio drivers; OpenSolaris build #30, non-DEBUG... run them in [WWW] VMware or [WWW] QEMU. But before you do so - here's a BIG
java (jquery) - Java Beginners java (jquery) i want to combine to things to create a photo gallery.
http://spaceforaname.com/galleryview
eg: http://spaceforaname.com.... to put a big preview to the image flow which is at bottom as thumbnails
Java is case sensitive Java is case sensitive hello,
Why Java is case sensitive?
hii,
Java is Platform Independent Language, so its used widely in very big... that huge no of variables,Java is Case Sensitive
java - Java Interview Questions
.... to tell about java completely it takes too much time....
Java is a big...java what is java? hi ,
java is a programming....
java is similar to c++ syntax(not exactly equal to c++ syntax),using
Eclipse update proxy settings
Eclipse update proxy settings
Eclipse IDE is extensively used to for developing small and big applications.
There are many plugins available for eclipse IDE
Java programming Java programming Hello! Is anybody able to do this task: I need to find the percentage of words distribution between parts of speech. I have to mark... the sentence "The house is big", after marking it is "The houseD isV bigB
Introduction to Java
website development to big enterprises.
Java...
Introduction to Java
What is Java?
Java is a high-level object-oriented programming
task 2 - Java Beginners
task 2 Write a time server that follows the time protocol outlined in RFC 868.
When a client connects, the server sends a 4-byte, big-endian, unsigned integer specifying the number of seconds that have passed since 12:00 A.M.
Free Java stuffs
as very big
applications for big organization using Java technologies.
The Java... around the world.
Free Javabig applications such as CRM, ERP, E-commerce solutions...Free Java
The Java or JDK is free for development and deployment
FileNotFound exception - Java Beginners
FileNotFound exception sir,
I m in a big problem pls help me
i want to load an XML file in my java code(struts2 framework)
How to get the absolute path of XML file Hi friend,
/pages/login.jsp
/pages
Java Specialists - Java Tutorials Java Specialists
2003-05-02 The Java Specialists' Newsletter [Issue 069b... such an obvious bit of information
in an advanced Java newsletter. They were....
That comes to only 15.53% of Java Specialists knowing about
this. Imagine how
java - Java Beginners big. Retires are needed because otherwise the queue won?t move.
Complete... the list.
Technicalities
1. Use Java 1.4
Real Estate WebsiteTemplates
as well as big builders are trying to create their own Real Estate Websites... templates for big infrastructures, Builders, Properties dealers to ease them out from... estate web design are as per professional guidelines. We focus on each small and big
Java Program big numbers, then go through the following link:
Java Convert Numbers to Words...Java Program for accepting numbers from 1 - 999 and printing them in form... in form of words
Java Convert Number to Words
The given code accept
about java swing - Java Beginners
about java swing How to upload the pictures and photo on the panel in java swing ,plz help
thank a lot. Hi Friend,
Try..._INT_RGB);
Graphics big = bi2.getGraphics();
big.drawImage(bi, 0