Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners REPORT WITH JTABLE

Have Programming Question? Ask it here!
 
 
 


Golla Tejesh Yadav
REPORT WITH JTABLE
1 Answer(s)      3 years and 7 months ago
Posted in : Java Beginners


i have data in backend(oracle10g,spl+).i want the data into front end(java jdk) with the help of jtables thnx in advance


Advertisement
View Answers

January 10, 2011 at 10:59 AM


Hi Friend,

We have used MySQL database.Try this:

import java.io.*;
import java.awt.*;
import java.sql.*;
import java.util.*;
import javax.swing.*;

class JTableDatabase extends JFrame{
    ResultSet rs;
    JTableDatabase(){
    final Vector columnNames = new Vector();
        final Vector data = new Vector();
      JPanel panel=new JPanel();
      try{
    Class.forName("com.mysql.jdbc.Driver");
     Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "root");
        Statement st = con.createStatement();
        ResultSet rs= st.executeQuery("Select * from employee");
    ResultSetMetaData md = rs.getMetaData();
int columns = md.getColumnCount();
for (int i = 1; i <= columns; i++) {
columnNames.addElement( md.getColumnName(i) );
}
while (rs.next()) {
Vector row = new Vector(columns);
for (int i = 1; i <= columns; i++) {
row.addElement( rs.getObject(i) );
}
data.addElement( row );
}
}
catch(Exception e){}
JTable table = new JTable(data, columnNames);
JScrollPane scrollPane = new JScrollPane(table);
panel.add(scrollPane);
add(panel);
}
 public static void main(String arg[])
  {
    try
    {
    JTableDatabase frame=new JTableDatabase();
    frame.setSize(550,200);
    frame.setVisible(true);
    }
  catch(Exception e)
    {}
  }
}

Thanks



Related Tutorials/Questions & Answers:
REPORT WITH JTABLE
REPORT WITH JTABLE  i have data in backend(oracle10g,spl+).i want the data into front end(java jdk) with the help of jtables thnx in advance  ...(Exception e){} JTable table = new JTable(data, columnNames); JScrollPane scrollPane
report
report  how to take input from number of classes like order, bill,customer to another class say report to make a report on all these things
Advertisements
JTable
JTable  Values to be displayed in JTextfield when Clicked on JTable Cells
JTable
JTable   how to select a definite cell which containing a similar text containg to the one which the user entering from a jtable at runtime in java
JTable
JTable  i want to delete record from JTable using a MenuItem DELETE. and values of JTable are fetched from database....please reply soon
JTable
JTable  need to add values to a JTable having 4 coloumns ,2 of them are comboboxes
JTable
JTable  Hello, i cannot display data from my table in the database to the cells of my JTable. please help me
jtable
jtable  how to get the values from database into jtable and also add a checkbox into it and then when selected the checkbox it should again insert into database the selected chewckbox.plzz help
jtable
jtable  hi Sir i am working netbeans IDE,I have a jtable when i insert values in jtable then i am unable to print all inserted values,For eg if i insert 1,2,3,4,5,6,7,8 values then , i am getting output
jtable
jtable  hey i have build a form and i m also able to add data from database to jtable along with checkbox.the only problem is that if i select multiple checkboxes the data doesnt get inserted into new database and if only one
JTable
JTable  Hi I have problems in setting values to a cell in Jtable which is in a jFrame which implements TableModelListener which has a abstract method tableChanged(TableModelEvent e) . I'll be loading values from data base when
JTable
"}; JTable table=new JTable(data,labels); JScrollPane pane=new JScrollPane
jasper report - Java Beginners
jasper report  please tell me how to get report in jasperreport from jtable using netbeens
Report Genrating
Report Genrating  How can i genrate the report on java by using jdbc records in our application
report generation
report generation  i need to show the report between two dates in jsp is it possible
Report - JDBC
JSP Page show report on specific time interval  I want to display the report at the specific time from the data base in my JSP page
Opentap Report
Opentap Report  how to run in build report in oepntaps how to make analytics data base in opentaps
dynamic report
dynamic report  i need complete code for generating dynamic report in jsp
jasper report
jasper report  Sir, I have created report using ireport3 in netbeans but i am not able to show the report in jsp and also want to show the dynamicaly generated reports and aslo show in pdf and excel Please help Thanks
report generation
report generation  hi i need a code to generate reports in bar graph and pie charts.i found these codes in roseindia.in unfortunately its not working................. plz help me
report generation
report generation  hi i need a code to generate reports in bar graph and pie charts.i found these codes in roseindia.in unfortunately its not working................. plz help me
report problem
report problem  I have made a project that displays charts using jfreechart library from the student marks stored in a database. what all can i... such project report,then do soon,..Its urgent.   Please visit the following
report generation
report generation  hi i found some source codes related to barchart and pie chart .when i try to run thise code its showing me the error as :- java.lang.NoSuchMethodError: org.jfree.text.TextBlock.setLineAlignment(Lorg/jfree/ui
generate report
generate report  hai, im learning php so pls help me .... what is a coding for generate report by month using php... wat is a code php for create calender and listing from database... pls someone help me
generate report
generate report  hai, im learning php so pls help me .... what is a coding for generate report by month using php... wat is a code php for create calender and listing from database... pls someone help me
Birt Report
Birt Report  Help with birt reports in myeclipse. I'm getting an exception when trying to display the report. Can u give me the complete procedure and the code as well. The exception is: Cannot open the connection for the driver
generate report in swing
generate report in swing  generate report in swing
Generating report in java
Generating report in java  How can I generate a report in java
report generation using jsp
report generation using jsp  report generation coding using jsp
report generation - EJB
report generation   how to create the report in java
report making in asp
report making in asp  Hi sir, Please give some example report making code for jsp and mysql
jtable problem
jtable problem  how to make a cell text hypertext
Absence data Report
Absence data Report  Absence data Report - The report will detail the absences for the employee, and will move to a new record after completing all details for the specific employee. Using SQL commands and HRMS Tables  
crystal report plugin for eclipse
crystal report plugin for eclipse  Hi, I want to know whether unicode based crystal reports can be generated using jsp.?Also I need the crystal report plugin for eclipse . Thanks
JTABLE OF JAVA
JTABLE OF JAVA  i have a jtable in java,i have used checkbox in jtable. now i want to add(submit) only those records that i have checked by checkbox how? i want small example with coding
Jtable-Java
Jtable-Java  Hi all,I have a Jtable And i need to clear the data in the table .I only Need to remove the data in the table.not the rows.Please help me
J2ee Crystal report integration
J2ee Crystal report integration  Hai Sir, I am familiar with crystal report and vb6 and sql server 2005.Now i want to integrate crystal report... is very high when making report in jsp(Handling dynamic sql queries,page
sum in JTable
sum in JTable  how to calculate sum from JTable's one field like total
Swings JTable
Swings JTable  add values to JTable with four coloums,two of them are comboboxes
JTABLE Issue
JTABLE Issue  Hi Eveyone, I am developing a small application on Swing-AWT. I have used JTABLE to show data. There is "input field" and "search... on basis of input data provided in input field. For JTABLE is on some other
My jasper Report
My jasper Report  I can now retrieve information from my database to my jasper Report, But as soon as i close the Report form, the entire desktop window will also be close. i want your help please
pdf from i report
pdf from i report  I have a problem again with my report, i use I Report to make pdf file. but when the application running in java, pdf can't view. but in rtf format data can view. or can icon save like this to be dissapear
java jtable
java jtable  Hello Sir, I am developing a desktop application in which i have to display database records in jtable .now I want to read only... that in jtable. plz help me with the code
jtable query
jtable query  I need a syntax...where i could fetch the whole data from the database once i click the cell in jtable...and that must be displayed in the nearby text field which i have set in the same frame
regarding jtable...
regarding jtable...  sir, im working with jtables. i wanted to populate a jtable from the database and when i click any row it should add a container... a container on the jtable. kindly help me sir. thanks in advance regards, rajahari
ABOUT Jtable
ABOUT Jtable  My Project is Exsice Management in java swing Desktop Application. I M Use Netbeans & Mysql . How can retrive Data in Jtable from Mysql Database in Net Beans
Dirty page and Dirty report
Dirty page and Dirty report  hiii, Explain dirty page and dirty report?   hello, Dirty Pages: Data that which is modified and Stored in the buffer cache but has not yet been written in to the secondary storage
Spring Framework with Crystal report
Spring Framework with Crystal report  here is my problem I have spring framework and I want to integrate Crystal report the problem is when Report call the servlet CrystalReportViewerServlet, the spring dispacher don't find
How to add JTable in JPanel
How to add JTable in JPanel  How to add JTable in JPanel
JTable duplicate values in row
JTable duplicate values in row  JTable duplicate values in row
 

 

 

DMCA.com