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



Home Answers Viewqa JSP-Servlet jsp code for dynamic time table generation
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


raghavendra
jsp code for dynamic time table generation
1 Answer(s)      4 years and 6 months ago
Posted in : JSP-Servlet


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...

Advertisement
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
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
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
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 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
report generation using jsp
report generation using jsp  report generation coding using 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
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 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
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
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
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
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
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
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
Dynamic include jsp
Dynamic include jsp  I need dynamic include jsp page with an example
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
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: 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
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 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
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
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.
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
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 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
 

 

 

DMCA.com