jsp code for dynamic time table generation

jsp code for dynamic time table generation

hi
I am doing my academic project college automation.
I want to generate time table dynamically for each btech and mca,mba branches.Pls provide a solution how to process this requirement.

pls...
View Answers

June 5, 2010 at 1:18 PM

Hi Friend,

Try the following code:

<%@page import="java.sql.*"%>
<%String course=request.getParameter("course");%>
<html>
<script>
function get(course){
var val =course.options[course.selectedIndex].text;
window.location.replace("timetable.jsp?course="+val);
}
</script>
<form name="form">
<select name="course" onchange="get(this);">
<option >Select</option>
<option value="BTech">BTech</option>
<option value="MBA">MBA</option>
<option value="MCA">MCA</option>

</select>
</form>
<%
if(course!=null){
%>
<h2>TIMETABLE</h2>
<h4><font color="red"><%=course%></font></h4>
<table border="1">
<tr bgcolor="red"><th>Days</th><th>I</th><th>II</th><th>III</th><th>IV</th><th>V</th><th>VI</th><th>VII</th><th>VIII</th></tr>
<%
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/mysql","root";, "root");
Statement st=connection.createStatement();
ResultSet rs=st.executeQuery("select * from "+course);
while(rs.next()){
%>
<tr><th bgcolor="red"><%=rs.getString("days")%></th><td><%=rs.getString("1")%></td><td><%=rs.getString("2")%></td><td><%=rs.getString("3")%></td><td><%=rs.getString("4")%></td><td><%=rs.getString("5")%></td><td><%=rs.getString("6")%></td><td><%=rs.getString("7")%></td><td><%=rs.getString("8")%></td></tr>
<%
}
}
catch(Exception e){}
%>
</table>
<%
}
%>


For the above code, we have created three database tables

1)btech:

CREATE TABLE `btech` (
`days` varchar(255) default NULL,
`1` varchar(255) default NULL,
`2` varchar(255) default NULL,
`3` varchar(255) default NULL,
`4` varchar(255) default NULL,
`5` varchar(255) default NULL,
`6` varchar(255) default NULL,
`7` varchar(255) default NULL,
`8` varchar(255) default NULL
)
2)mba:

CREATE TABLE `mba` (
`days` varchar(255) default NULL,
`1` varchar(255) default NULL,
`2` varchar(255) default NULL,
`3` varchar(255) default NULL,
`4` varchar(255) default NULL,
`5` varchar(255) default NULL,
`6` varchar(255) default NULL,
`7` varchar(255) default NULL,
`8` varchar(255) default NULL
)

3)mca:

CREATE TABLE `btech` (
`days` varchar(255) default NULL,
`1` varchar(255) default NULL,
`2` varchar(255) default NULL,
`3` varchar(255) default NULL,
`4` varchar(255) default NULL,
`5` varchar(255) default NULL,
`6` varchar(255) default NULL,
`7` varchar(255) default NULL,
`8` varchar(255) default NULL
)

Thanks









Related Tutorials/Questions & Answers:
jsp code for dynamic time table generation - JSP-Servlet
jsp code for dynamic time table generation  hi I am doing my academic project college automation. I want to generate time table dynamically... For the above code, we have created three database tables 1)btech: CREATE TABLE
Time table generation
in the time table is there any calculations possible to do this work? The code you...Time table generation  Hi I am 3rd year bca student i want create time table generator for my project.i am going to create it as school time table
Advertisements
Time table generation
Time table generation  Hi I am 3rd year bca student i want create time table generator for my project.i am going to create it as school time table...: Generate TimeTable using JSP
Dynamic table in jsp
Dynamic table in jsp  Hi..... I have a java file to read excel file... to show all values of excel file on jsp page in a table format. All elements are displaying on jsp page but in vertical line. How can i change them in table
jsp code for date generation - JSP-Servlet
jsp code for date generation  hai i am meyis i need a jsp program code for date generation.(mssql-back end) Fields are fromdate and todate both... thanks   Hi friend, For more information on Date in JSP
Dynamic table data to Excel in JSP
Dynamic table data to Excel in JSP   Iam trying to export dynamic...() { document.form1.des.disabled=0; } function view_Table() { } function...;div align="center"><br> <table width="500" height="300
generating time table - JSP-Servlet
..the code should be in jsp/servlet.. so please help me friends...generating time table  hi friends, i want generate examination timetable for examinations of courses like btech(cse,ece,eee..etc),if i give starting
jsp code for storing login and logout time to an account
jsp code for storing login and logout time to an account  I need simple jsp code for extracting and storing login and logout time in a database table...://www.roseindia.net/jsp/loginstatus.shtml
dynamic retrivel of data from mysql database in table format at jsp
dynamic retrivel of data from mysql database in table format at jsp  ... the data from database and display it as table format in jsp... For example, i have... and also details of each member should be displayed in the table format in jsp
Dynamic retrieval od data from database and display it in the table at jsp
Dynamic retrieval od data from database and display it in the table at jsp ... the details of 20 members in a table format at jsp page by dynamically retrieving...; Here is a jsp code that retrieves the data from the database and display
Date Time Problem In Jsp code - Development process
Date Time Problem In Jsp code  Hi Friends, By using this code , am storing date and time into msaccess database. But while retriving i want to get same date and time .send me code for that. SimpleDateFormat
Play framework dynamic form generation
Play framework dynamic form generation  I want to generate dynamic forms using play framework can any one give me some idea about dynamic form generation using play framework
report generation using jsp
report generation using jsp  report generation coding using jsp
Table generation error - EJB
Table generation error  Hi friends I am using EJB3.0 with sun java... an EJB it gives the following exception and doesnt generate any table... "CREATE TABLE BookShop (ID INTEGER NOT NULL, BOOKNAME VARCHAR(255), AUTHOR VARCHAR
Dynamic include jsp
Dynamic include jsp  I need dynamic include jsp page with an example
JSP: Dynamic Linking - JSP-Servlet
inside your result set loop to provide them a dynamic link. JSP Code...JSP: Dynamic Linking  Hi I am fetching data as a search result from database and displaying it in a table(id and name)using while(rs.next()){...}.I
JSP:Dynamic Linking - JSP-Servlet
JSP:Dynamic Linking  Hi This is extension to my previous question... it in a table(id and name)using while(rs.next()){...}.I want to provide hyper link... friend, Code to help in solving the problem : "view1.jsp" All
how to insert value in dynamic table
a dynamic table for every company.but whenever i'm inserting values to the company sql server showing a syntax error. my code is as follows:- PreparedStatement ps1...how to insert value in dynamic table  i am creating a project
Insert value of dynamic generated text box in jsp using javascript
Insert value of dynamic generated text box in jsp using javascript  hello sir , i want to generate dynamic text box at run time and i did that using... dynamically at the same time without reloading the page here is the code that i am
dynamic generation of html:select tag from textbox value
dynamic generation of html:select tag from textbox value  Hi, I am a newbie to java and struts. In my application, I have a requirement like when i... action class? And i have no idea how to implement this. I am using jsp. Any help
Time Table in Java
Time Table in Java  Hi, Deepak i am developing a time table for a school on java,but i am confuse how to start so please give me idea about
dynamic pagination in jsp - JSP-Servlet
dynamic pagination in jsp  i am unable to display the data in multiple pages. I am gettting data from the database from the javaBeans to jsp by vectors... but i am unable to displaying them in jsp 15 records per page
Dynamic link in JSP
Dynamic link in JSP  Hii everyone...I have stuck from last 2 days... selecting One source and multiple Targets, i have to generate one table using... jsp page which contains some checkboxes, so from that checkboxes , i have
dynamic display - JSP-Servlet
dynamic display  hi, i want to display dynamic values in drop drown box in a jsp page.these values are in the form of arraylist's object which... Friend, Try the following code: 1)DataServlet.java: import java.io.
jsp code - JSP-Servlet
jsp code  hi my requirement is generate dynamic drop down lists... the second drop down list is displayed from mysql data base table by using select statement? pls provide code how to get first selected drop down list value
jsp program for bill generation - JSP-Servlet
jsp program for bill generation  hi, i just want to know how i write the jsp program for generation of bill for a gas connectivity systm  Hi Friend, Please provide some information like structure of bill. Thanks
jsp code - JSP-Servlet
jsp code  i want to add below code data in mysql database using jsp... using below code we got data in text box i want to add multiple data in database... Add/Remove dynamic rows in HTML table
How to add dynamic table in java
How to add dynamic table in java  How to add dynamic table in java...(); } catch(Exception e){ System.out.println(e); } JTable table = new JTable(data...); } JScrollPane scrollPane = new JScrollPane( table ); p.add( scrollPane ); JFrame f=new
Dynamic Line draw in JSp
Dynamic Line draw in JSp  In my application. I have one source selected from listbox and multiple targets selected from checkboxes. After submitting... multiple target. And each line should have dynamically link of other jsp page
jsp code - JSP-Servlet
jsp code  in a jsp a table is existed ,in table each row contain one checkbox and name and desription how to delete specific rows in a table .  Hi Friend, Try the following code: 1)form.jsp: Name
jsp code
jsp code  what are the jsp code for view page in online journal
Create Dynamic Table using Hubernate
Create Dynamic Table using Hubernate  Thank's for reading my Post. I...: How to create seperate table for all users they sign up for my web app. i need to create 2 table's 1.User Details - Store user mail address,username
Creating dynamic jsp file in java file to include another jsp file
Creating dynamic jsp file in java file to include another jsp file  I am able to create jsp file in java that includes ; table tr td and img tags..... Need to include jsp file in the same content. The below code doesn't help me
Dynamic row genertion in javascript? - JSP-Servlet
Dynamic row genertion in javascript?  Hi roseindia, I want coding in javascript to add a dynamic row in jsp..This row contain 3 fields(2..., Use the following code: function addRow(tableID){ var table
jsp code - JSP-Servlet
jsp code  in my table there are 3 fields named orderid ,itemname, itemqty. i want code that fetch orderid in dropdown... on select dropdown get table of item details of that orderid... there are multiple items at one orderid
code for image to key generation - JDBC
code for image to key generation  plz help me how cud i convert image into key using sha1 algorithm in java.... plz give me the code to write it... i m doing image based registration
JSP CODE
JSP CODE  what is the code for downloading images from database using JSP?   Please visit the following link: http://www.roseindia.net/jsp/downloadimage.shtml
JSP date example
, now I will show you how to create a simple dynamic JSP page that prints the current date and time. So the following code accomplish... JSP date example      
Pls provide me jsp code to get values in drop down list from another table's field....
Pls provide me jsp code to get values in drop down list from another table's field....  my project has customer registration and company registration........ pls provide me code.. thanx
jsp code
jsp code  hi i am Ruchi can anybody plz tell me the jsp code... visit the following links: http://www.roseindia.net/jsp/user-search.shtml http://www.roseindia.net/servlets/search.shtml www.roseindia.net/jsp/searchbook.shtml
JSP Code - JSP-Servlet
For the above code,we have created a table 'student'. CREATE TABLE `student...JSP Code  Hi, I have a problem in limiting the number of row display in the table. For example, if i have 1000 records in my table & want
How to Extract row from table view using JSP Code - Java Beginners
How to Extract row from table view using JSP Code  Hi Friends...)deleteuser.jsp: For the above code, we have used following database table... problem exist with retrival of row from a table on click of link. Table Structure
jsp code - JSP-Servlet
colum.  Hi Friend, Try the following code: Add/Remove dynamic rows in HTML table var i=0,j=0,sum=0; arr = new Array(); arr1=new...jsp code  i want to add and remove rows dynamically ... in that row 3
jsp code - JSP-Servlet
jsp code  hi i am doing project work i am generating time table for this i have taken form courseyear textbox semistername textbox no of periods... will be allotted to six days. pls send me code for this pls thankyou
dynamic generation of html:select tag from textbox value
dynamic generation of html:select tag from textbox value  Hi, I am a newbie to java and struts. In my application, I have a requirement like when i give some input in a textbox and click on a add link. It should be added
JSP Date & Time - JSP-Servlet
JSP Date & Time  Hi! How to compare a String with System time in JSP.... pls... help me... Thanks in advance
jsp code
jsp code  i want health management system project code using jsp.its urgent
java with jsp and dynamic database retrival for bar charts
java with jsp and dynamic database retrival for bar charts  Hi, I am having a table name tablelogin,it consists of columns userid,logintime... dynamically for the table values logintime and userid from database.. can u please
JSP CODE
JSP CODE  Please help me as soon as possible.Its Urgent. I am working on my college ALUMNI PORTAL. I want to have a ADD FRIEND option in a user's profile. Please send me code
jsp code
jsp code  i want to jsp code which are working as,i have three drop down menu 1st menu for class second menu for subject and third menu as chapter... according to selectde menu,,,,please send me such type code,,,,plz help me

Ads