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



Home Answers Viewqa Java-Beginners Problem in populating tableview with database data using javafx MVC architecture.

Have Programming Question? Ask it here!
 
 
 


Monika Boriwar
Problem in populating tableview with database data using javafx MVC architecture.
0 Answer(s)      a month and 13 days ago
Posted in : Java Beginners


This code is working in simple javafx appliction without MVC architecture. Here i want to populate tableview as it is with database table data. Here the problem is i am getting all elelments of every row in each column of tableview.

Controller:

 @FXML private void handleButtonAction(ActionEvent event) throws Exception
    {
       ObservableList tl = tmd.t_model();
       ObservableList<ObservableList> rl = tmd.t_row();

       for (Object val : tl) 
            {
                TableColumn col = new TableColumn(String.valueOf(val));
                System.out.println("FXMLColumn j[" + (String.valueOf(tl)));

                System.out.println("Column col[" + (String) tl.get(0) + "] ");
                col.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<ObservableList, String>, ObservableValue<String>>()
                {
                    public ObservableValue<String> call(TableColumn.CellDataFeatures<ObservableList, String> param)
                    {
                        return new SimpleStringProperty(param.getValue().toString());
                    }

                });
                tableview.getColumns().addAll(col);
            }
         tableview.setItems(rl);
    }    

model;

 public ObservableList t_model() throws Exception
   {
       Connection c ;
            data = FXCollections.observableArrayList();
        try{
                c = Dao.getCon();
                String SQL = "SELECT * from Mem_bill";
                ResultSet rs = c.createStatement().executeQuery(SQL);    

                    for(int i=0 ; i<rs.getMetaData().getColumnCount(); i++)
                    {
                        data.add(rs.getMetaData().getColumnName(i+1));

                    }
                }
            catch(Exception e)
            {
               System.out.println("problem in t_model"+e.getMessage());
            }
                  return data;
   } 
   public ObservableList t_row() throws Exception
   {
       Connection c ;
       ObservableList data1 = FXCollections.observableArrayList();
       c = Dao.getCon();
            String SQL = "SELECT * from Mem_bill";
            ResultSet rs = c.createStatement().executeQuery(SQL);
             while(rs.next())
            {
                ObservableList<String> row = FXCollections.observableArrayList();
                for(int i=1 ; i<=rs.getMetaData().getColumnCount(); i++)
                {
                   String rw=rs.getString(i);
                   row.add(rw);
                   //data1.add(row);
                   System.out.println("ROW BREAK :"+rw);
                   System.out.println("VAL I:"+i);

                }

                data1.add(row);
             }
             return data1;
   }`print("code sample");`

Advertisement
View Answers

Related Tutorials/Questions & Answers:
Problem in populating tableview with database data using javafx MVC architecture.
Problem in populating tableview with database data using javafx MVC architecture.  This code is working in simple javafx appliction without MVC architecture. Here i want to populate tableview as it is with database table data
Problem in populating tableview with database data using javafx MVC architecture.
Problem in populating tableview with database data using javafx MVC architecture.  This code is working in simple javafx appliction without MVC architecture. Here i want to populate tableview as it is with database table data
Advertisements
How to display data from database in a TableView
How to display data from database in a TableView  I need to populate a TableView (JavaFx) with database items. I designed the TableView in JavaFx... at this. The classes: This is the Class that creates the database data object: import
How to display data from database in a TableView via Hibernate
How to display data from database in a TableView via Hibernate  I need to populate a TableView (JavaFx) with database items. I designed the TableView in JavaFx Scene Builder. So far the TableView does not change at all and only
using jsp and servlets andin Mvc architecture
using jsp and servlets andin Mvc architecture  how to insert a form data in different tables, that means education details in education table, address details in address table,like that and finally if we fetch all must come
populating textbox value from the database using onchange function,
populating textbox value from the database using onchange function,  hi, Everyone I have a problem regarding poulatinng the value in textbox after... dynamically from the database(mysql). after selecting the value from the dropd
online book store by using MVC architecture
online book store by using MVC architecture  Tarzan book store decided to go online to increase itsā?? revenues and provide itsā?? customers a way... and complaint with MVC architecture
MVC Architecture
MVC Architecture      ...: By using the MVC design pattern our application becomes more expressive. 1). ... as data access is usually done using Custom tag or through java bean call
mvc architecture - Java Beginners
mvc architecture  i am asking you give me an example for the object oriented programming using MVC architecture then my problem is railway tickect... to that arraylist. for this one i have to do code in MVC architecture
mvc architecture - Java Beginners
mvc architecture  can u please provide a example program with code using mvc architecture mine problem is adding routes for the railwaystation... on the MVC architecture please send me the link for knowing the implementation code
Query for generating Stock Report Using MVC architecture in j2ee
Query for generating Stock Report Using MVC architecture in j2ee  ... some data (current stock=(summation of)watch Quantity in WATCHMASTER... tables with data is: WATCHMASTER { watchid varchar(30), watchname varchar(20
MVC Architecture In Java
2 (MVC) Architecture : Applications are developed using MVC (Model-View.... These are as : Using the MVC architecture we can make our application loosely...MVC Architecture In Java In this section we will discuss about the MVC
Problem insert data into database using servlet n javabean - Java Beginners
Problem insert data into database using servlet n javabean  I created a servlet for registration proses I got a problem compiling my servlet.. (incompatible type: int and required: java.lang.ResultSet) can anyone help me
Problem in accessing data from Database
Problem in accessing data from Database  hi..... i'm making a project on servlet and jsp with ms access 2007 at the backend. One field in my database... in currency column and then try to retrieve data using my servlet coding
MVC architecture example - Java Beginners
MVC architecture example  hi.. I would like to ask the example on Login authentication using MVC model. I really don't understand how it work. Can...+Database related to MVC model.. Really need your help.. Please.. ASAP.. 
Spring MVC and Hibernate with DWR 3 -- Configuration Using MySQL Database
Spring MVC and Hibernate with DWR 3 -- Configuration Using MySQL Database  How to configure Spring MVC and Hibernate with DWR 3, Simple example -- reading a table, editing-deleting and adding new rows
How to insert and retreive an image in mysql database using spring mvc framework???
How to insert and retreive an image in mysql database using spring mvc framework???  I ve solved this problem based on the Product Search Application. Those who need this concept and code segment kindly copy it. Thanks and All
populating text box using jsp code
populating text box using jsp code  Sir, How to populate related values in a text box after selecting value from drop down list using JSP and mysql. I tried using Ajax from your example. But for some browser it does not support
About MVC 2 architecture and jsp - JSP-Servlet
About MVC 2 architecture and jsp  Sir, I want to know about MVC 2 architecture and can we bring all functionalities of servlets in jsp.What is the need of servlets when jsp can perform all functionalities .  Hi
save multiple records into database using jsp/servlet mvc
save multiple records into database using jsp/servlet mvc  hai... it to database in single hit user.jsp <form action="UserServlet" method="post... set to bean and pass bean to dao insert() and insert into database thank u
Upload Image and save in database using jsp-servlet mvc
Upload Image and save in database using jsp-servlet mvc  Here is my code.. In jsp ... <form name=frm method="post" action="Device"> <table> <tr><TD ><B>Upload Image</B><
Upload Image and save in database using jsp-servlet mvc
Upload Image and save in database using jsp-servlet mvc  Here is my code.. In jsp ... <form name=frm method="post" action="Device"> <table> <tr><TD ><B>Upload Image</B><
insert data in the database using checkbox
insert data in the database using checkbox  i am fetching data from the database using servlet on the jsp page and there is checkbox corresponding each row but the problem is that i am not fetching data in any textboxes so how
populating one dropdown box depending on the value of other using jsp
populating one dropdown box depending on the value of other using jsp  HI i have scenario i need to populating one dropdown box depending on the value of other using the below table country name state and city name should load
How to save database data into excelsheet using hibernate
How to save database data into excelsheet using hibernate  How to save database data into excelsheet using hibernate
a complete project on spring web mvc using oracle database in netbeans ide 7.0
a complete project on spring web mvc using oracle database in netbeans ide 7.0  dear sir , i want a complete tutorial on the title matter.please sir help me . any full developped project based on shopping cart can
retrieve data from database using jsf
retrieve data from database using jsf  Hello I want an example of source code to retrieve data from database i have a database (oracle) name as db1 it's contain table 'author' composed of three columns idauthor(primary key
Jsp using mvc - JSP-Servlet
Jsp using mvc  hi I have written using mvc2 architecture, i have... the data that need to be displayed. It is model who is aware about all the operations that can be applied to transform that object. It only represents the data
how to insert data into database using jsp & retrive
how to insert data into database using jsp & retrive  Hello, I have created 1 html page which contain username, password & submit button. in my oracle10G database already contain table name admin which has name, password
how to insert data in database using html+jsp
how to insert data in database using html+jsp  anyone know what... and database name. Here machine name id localhost and database name..."; // declare a connection by using Connection interface
problem from registering a data in database with servlet - JSP-Servlet
problem from registering a data in database with servlet  Hi Rose, i created a servlet to validates ten user details in the database, if present... the user's details and submit into database. but it'll first insert the details
Populate a combo box using data from a database
Populate a combo box using data from a database  Hi Guys, In need... to populate the first one, and then how to send the data off to a servlet and preform a search on the database for the values I want, but then how do I pass that back
retrive data from database using jsp in struts?
retrive data from database using jsp in struts?   *search.jsp* <%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%> <%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
JSF Architecture
also uses the MVC pattern. ?JSF Architecture? article in roseindia.net explains the architecture of a JSF application. Read about the topic at JSF...MVC is one of the most widely used design pattern for developing applications
spring mvc configuration with mysql using jdbc
spring mvc configuration with mysql using jdbc  hai I want to configure web mvc with mysql using jdbc template. when I submit values using registration form it will reflect on database which i was created earlier. send me code
problem in database
problem in database   thanks for web site. I want change this code to insert data into PostgreSql database using jsp,servlets. but i getting output "Record has been inserted", 1.no data in the table(sample) public
How to get the data from the database using Servlet or JSP program
the problem   Get data from database using servlet Retrieve data from database using JSP Get data from database using JSP...How to get the data from the database using Servlet or JSP program  
populating the combo box - Struts
populating the combo box  Hi I am having problem populating...; } ========================================================================== My problem is populating the combobox table with the database table. What is the connection string that i am suppose to write
sending data to google chart api from mysql database using java
sending data to google chart api from mysql database using java  how to send data from mysql database to google chart api using java
Read data from excel file and update database using jsp
Read data from excel file and update database using jsp  read data from excel file and update database using jsp Hi, I am using a MySQL database... upload excel file and update database using JSP ? Thanks in Advance
i need program to insert data in database using javascript
i need program to insert data in database using javascript  please help me
mvc
mvc   can any one tell me how to save the data in the data base sql and after saving the data how to retrieve the data according to some condition and show it in another form... iam using eclipse hibernate and java ... iam using
database problem
database problem  I did connect my jsp page to database and it showed the result on another jsp page but i want to show the data of that field on which i click to mouse from the jsp page where all the data field has been showed
database problem
database problem  I did connect my jsp page to database and it showed the result on another jsp page but i want to show the data of that field on which i click to mouse from the jsp page where all the data field has been showed
Autocomplete textbox with database in jsp and follow the MVC model
Autocomplete textbox with database in jsp and follow the MVC model  i have one problem in my project i try to generate the autocomplete textbox with database mysql follow MVC Model but it not perform. So please Help me sir
view data from database using drop down list
view data from database using drop down list  hi i want to view the data from database by selecting a value in a drop down list. for an example drop down list have picture element.when click it select pictures from the database
problem in inserting data in databases created in netbeans using jsp..
problem in inserting data in databases created in netbeans using jsp..  i am trying to make a virtual classroom website in jsp using netbeans.i...+")"); out.println("Data is successfully inserted!"); } catch(Exception e
place data in text fields from database using jdbc
place data in text fields from database using jdbc  i want get the data from database and place the records in the respective textfields using jdbc and swing like eno,ename,loc from emp table
problem in inserting data in databases created in ecplise using jsp
problem in inserting data in databases created in ecplise using jsp  <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ page import="java.sql.*" %> JS Soft
problem in inserting data in databases created in ecplise using jsp
problem in inserting data in databases created in ecplise using jsp  <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ page import="java.sql.*" %> JS Soft
Advertisements
 

 

 

DMCA.com