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



Home Answers Viewqa JSP-Servlet Extracting table from Access Database to Servlet
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Saakshi Dikshit
Extracting table from Access Database to Servlet
0 Answer(s)      a year and 9 months ago
Posted in : JSP-Servlet


Sir, I have a table with 4 field deptid, headid, normalexpend and projectexpend. Now I have to display a consolidated data where sum of normal_expend under particular head for all depts need to be displayed. For ex. dept d1 has spend 400 under head h1. dept d2 has spend 500 under h1. So the output under Head h1 on result page should show 900. I have written the query as : Select sum(h1) from expend where head_id="h1". The problem is that I have 20 heads and 10 depts which means I'll have to write this query around 30 times.

'Statement stat=con.createStatement(); ResultSet res=stat.executeQuery("select SUM(ne) from expenditure1 where headid=H1"); while(res.next()) { A_n = res.getInt(1); }'

I'm querying the data like this so does this mean i have to write the set of statements given above for all 20 heads. What is the correct method of doing this please somebody explain me.


Advertisement
View Answers

Related Tutorials/Questions & Answers:
Extracting table from Access Database to Servlet
Extracting table from Access Database to Servlet  Sir, I have a table with 4 field deptid, headid, normalexpend and projectexpend. Now I have... show 900. I have written the query as : Select sum(h1) from expend where head_id
display data from a table in Access Database in a HTML page
display data from a table in Access Database in a HTML page  how to display data from a table in Access Database in a HTML page in a Java Program
Advertisements
how to display a table from database using servlet
how to display a table from database using servlet  how to display a table with values from servletpage   Hi Friend, Please go through the following link: http://roseindia.net/jsp/servlet-jsp-data-list.shtml Thanks
to get picture from ms access database by jsp-servlet....
to get picture from ms access database by jsp-servlet....  I have inserted a picture in ms access data base,,,how we can retrieve that picture by using jsp
How to Open Picture From M.S. Access Database using Java Servlet ?
How to Open Picture From M.S. Access Database using Java Servlet ?  Hi all my Friends I have below code which insert a picture into M.S. Access Database But i m still not able to open this picture through Java using M.S. Access
ACCESS DATABASE FROM HTML
ACCESS DATABASE FROM HTML  I want to access sql 2008 database in html page without help of ADODB connection.. because if access through ADODB means there is a security problem. so, Access database in html page(client side
Extracting variable from jsp
Extracting variable from jsp  how to Write a java program which will be extracting the variables and putting them in an excel format?   The given code allow the user to enter some fields and using the POI API
use data from database table as hyperlink value - JSP-Servlet
use data from database table as hyperlink value  I'm creating a web page that allows user to search my database. The page will display partial results of my database, then the first column of the resultset was converted
applet connected to table in MS Access database
applet connected to table in MS Access database   i have connected my java code with the MS access database and this is my code, can anyone tell me...()); } } //retrieve data from table COFFEES static void retrieveData() { try
Extracting equation from any document
Extracting equation from any document  how can i extract equation from any word document?   Hello Friend, If you want to extract data from the word file, then visit the following link: Extract data from word document
How to access (MySQL)database from J2ME?
How to access (MySQL)database from J2ME?  I am new to J2ME. I am using NetBeans. Can anyone help me? How to access (MySQL)database from J2ME? ( I search a lot I found that there is need to access database through servlet
code for insert the value from jsp to access database
code for insert the value from jsp to access database  code for insert the value from jsp to access database
how i conditional access the data from database using combo box. - JSP-Servlet
how i conditional access the data from database using combo box.   i... access the data from database when i select class 11 0r 12. Here is JSP file...="+cla+"&&from_year="+y1+"&&to_year="+y2+"&&school="+sch); alert(sch+" "+cla+ " "+y1
Upload csv or .xlsx file from JSP form to Database Table using servlet
Upload csv or .xlsx file from JSP form to Database Table using servlet  dear sir, i need the Servlet code that reads the .xlsx or CSV excel file and stores it into the oracle database table. Sir Its very Urgent I have
jfreechart display from access database data.
jfreechart display from access database data.  I have made a database... to retrieve the data from the access database using prepared statement and then display... is to be done in a servlet.. Note that it is a access made database. How can I
data insertion from xml file to database table
data insertion from xml file to database table  Hi all, I have data in the XML file. I need to insert it into table in the database using servlet. so please reply me . ThankYou
jfreechart displaying chart from access database
jfreechart displaying chart from access database  I have these 2 codes. array.java----in which i retrieve the values from the database . import... javax.servlet.http.HttpServletResponse; /** * * @author AARUSHI */ class database { int roll; String
Extracting position of a particular string from a PDF
Extracting position of a particular string from a PDF  I have a pdf form. I want to knw the exact position(location) of a particular string of that form. Using iText I have extracted all the string from the PDF form, but nt able
Retrieving the Image from a database Table
Retrieving the Image from a database Table Consider a case where we want... to retrieve the image from the database table. You can do it very easily after... from the database table our java program need to make a connection
retreiving data from microsoft access database
retreiving data from microsoft access database  How can i retrieve data from microsoft access when i have select the vaules in combo box and text box. When i select these values... i want to retrieve the corresponding columns
Access all the fields from table through JSP
Access all the fields from table through JSP...;/head> <body> <h2>Data from the table 'stu_info' of database... data from the specified table. Before running this java code you need
How To Insert A New Record to MS Access table database in GUI
How To Insert A New Record to MS Access table database in GUI  Hello... that involves inserting a record into a 6-column table in my MS Access database table. I'm..._UPDATABLE); String sql = "select * from DonorTable"; rs
how to use String tokenizer on table that is retrieved from database using jsp servlet
how to use String tokenizer on table that is retrieved from database using jsp servlet  Query:Table---- mysql> select pid,medicinename,dose,day,qty from medicinedetails2 where pid=15
Deleting a Table from Database
Deleting a Table from Database   .... In this section we are describing, how to delete a table from database using java methods. Java provides the facility for deleting a specific table from a given database
retrive the data from access database to drop down list box in jsp
retrive the data from access database to drop down list box in jsp  hai, im new to jsp now im using the jsp along with access database.in table i load all the data's i need to retrive the data from database to dropdown list box
Retrieve image from database using Servlet
Retrieve image from database using Servlet     ... that connects to the MySQL database and retrieves the image from the table. After... applications that retrieves the image from database. You can use this type
Delete a Column from a Database Table
Delete a Column from a Database Table   ... to delete a column from a database table. We are not going to create a new table... a column from a database table then we have been provided with the  database
Retrieve multiple data from database into Table.....
Retrieve multiple data from database into Table.....   hi........... I want to Retrieve multiple data from database into Table but i am not able... database i have attributes pH, phosphate, ....... month, year......... so its
Fetch user records from a table in database
Fetch user records from a table in database  Hi. I have a field in database named stages. its datatype is varchar(60). It contains values chennai,trichy,kanchipuram for a single record. I have to retrieve these data from
Retrieving value from multiple table in database
Retrieving value from multiple table in database  Hi fnds, I want to maintain the financial database of 20 users for 1 year and update the details... created 12 tables with table name - month1,month2,....,upto month12.. each table
Select data from Table in Database
Select data from Table in Database   ... the selected data from table in database. The select query in the database retrieve...; in simple select statement is given below select column name from table
Advertisements
 

 

 

DMCA.com