Share on Google+Share on Google+

Harshu
Prog Error
0 Answer(s)      7 years ago
Posted in : JSP-Servlet
<%@ page language="java" import="java.sql.*" %>
<%@ page import="java.lang.String.*" %>
<%
Connection con=null;
//ResultSet state=null;
Statement stmt=null;
String st;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:Advdsn");
stmt=con.createStatement();

}
catch(SQLException se)
{
out.println("Database Error:"+se.getMessage());
}
catch(Exception e)
{
e.toString();
}

%>
<HTML>
<HEAD>
<TITLE> Place Ad </TITLE>
<script type="text/javascript">
function Browse()
{

</script>
</HEAD>

<BODY BGCOLOR="lightblue">
<marquee behavior="alternate" scrollamount=5 scrolldelay=10><h1><font size=4 face="Stroustroup" color="#993355">Advertisement Management System</h1></font></marquee><br>
<p align=center><b> <font color="669933" size=4>Create Ad </font></b></p><br>
<form method=post action="http://localhost:8080/ProjectAd/Preview">
State: <select name="State" size=1>
<%
ResultSet state=stmt.executeQuery("Select * from PlaceAd");

while(state.next())
{
%>
<option>
<% out.println(state.getString(1)); %>
</option>
<%}%>
</select><br>

City: <select name="City" size=1>
<%
ResultSet city=stmt.executeQuery("Select * from PlaceAd");
while(city.next())
{
%>
<option>
<% out.println(city.getString("City")); %>
</option>
<%}%>
</select><br>
Main Category: <select name="mainCat" size=1>
<%
ResultSet mainC=stmt.executeQuery("Select * from PlaceAd");
while(mainC.next())
{
%>
<option>
<% out.println(mainC.getString("Main Category")); %>
</option>
<%}%>
</select><br>
Sub Category:<select name="subCat" size=1>
<%
ResultSet subC=stmt.executeQuery("Select * from PlaceAd");
while(subC.next())
{
%>
<option>
<% out.println(subC.getString("Sub Category")); %>
</option>
<%}%>
</select><br>
Title: <input type=text name="Title" size=25><br>

<p>Draft Your Ad Here:<textarea name="DraftAd" rows=3 cols=25 size=25 id="DraftAd"></textarea>
<%
for(int i=0;i<=DraftAd.length;i++)
out.println(i);
%>
Count:<input type=text name="count" size=5 id="count" disabled="disabled" value="<%=i%>"></p>


<p>Image:<input type=text name="Image1" size=25>
<input type=submit name=SubmitBrowse value="Browse" onSubmitBrowse="return Browse();" ></p>
Add another Image<br>
Email:<input type=text name="Email" size=25><br>
Phone No:<input type=text name="PhoneNo" size=25><br>
Select Newspaper:<select name="NewsPaper" size=1>
<%
ResultSet newspaper=stmt.executeQuery("Select * from PlaceAd");
while(newspaper.next())
{
%>
<option>
<% out.println(newspaper.getString("NewsPaper")); %>
</option>
<%}%>
</select><br>
Select Your Date:<select name="Date" size=1>
<%
for (int date=1;date<=31;date++)
{
%>
<option>
<%
out.println(--- Please Select ---);
out.println(date);
%>
</option>
<%}%>
</select>Month:<select name="Month" size=1>
<%
for (int month=1;month<=12;month++)
{
%>
<option>
<%
out.println(--- Please Select ---);
out.pritnln(month);
%>
</option>
<%}%>
</select>Year:<select name="Year" size=1>
<%
for (int year=1960;year<=2010;year++)
{
%>
<option>
<%
out.println(--- Please Select ---);
out.println(year);
%>
</option>
<%}%>
</select><br>
Select Number of Days:<input type=text name="Days" size=5><br>
<p>Confirm:<input type=checkbox name=confirm ><input type=submit name=SubmitSave value=Save><br>
<p><input type=submit name=submit value=Submit><br>

</form>
</BODY>
</HTML>


Database fields are:
State
City
Main Category
Sub category
Title
DraftAd
Count
Image
Email
PhoneNo
Newspaper and edition
Date
Month
Year
no of .Days

Here in Main Ctegory eg: Matrimonial is selected
in sub category user can select groom
in no.od days says for how many days you ad should get displayed. if 2 then it will get displayed for 2 dayeform date of ad.

In draft ad when characters are typed then it shold get converted in words and should get displayed in count box.

In image ,there is a browse button if user clicks it he should get a folder of images from where it can select it and it should get saved in database when clicked on save button and should get displayed on next page when clicked on submit.

Ads

View Answers









Related Tutorials/Questions & Answers:
Prog Error - JSP-Servlet
Prog Error   Place Ad function Browse() { Advertisement Management System Create Ad State: City: Main Category: Sub Category: Title
NEED A PROG
NEED A PROG   whats the program to add,delete, display elements of an object using collecions. without using linked list   Hi Friend, Try the following code: import java.util.*; class CollectionExample { public
Advertisements
turbo C prog.
turbo C prog.  Is is possible print ASCII value of a alphabets using turbo C prog
resolution for prog
error as Current.java:6: cannot find symbol symbol : method CurrentThread...(); ^ 1 error pls tell me the reolution
Java entry prog.
Java entry prog.  Dear sir I will enter the dept code, dept name and insert into dept_mast and save. Pl. Dept_mast Dept_code Char(2...){ System.out.println("Error! Your dept code is not valid
java prog que
java prog que  create a class that returns the reverse of each word in the given string. For example if we give "who are u?" as input, it should return "ohw era u
PKG_PROG_PKG_CONFIG: command not found
PKG_PROG_PKG_CONFIG: command not found  Hi, How to solve PKGPROGPKG_CONFIG: command not found error This error is coming while executing the configure script. Thanks
PKG_PROG_PKG_CONFIG: command not found
PKG_PROG_PKG_CONFIG: command not found  Hi, How to solve PKGPROGPKG_CONFIG: command not found error This error is coming while executing the configure script. Thanks
PKG_PROG_PKG_CONFIG: command not found
PKG_PROG_PKG_CONFIG: command not found  Hi, How to solve PKGPROGPKG_CONFIG: command not found error This error is coming while executing the configure script. Thanks
PKG_PROG_PKG_CONFIG: command not found
PKG_PROG_PKG_CONFIG: command not found  Hi, How to solve PKGPROGPKG_CONFIG: command not found error This error is coming while executing the configure script. Thanks
PKG_PROG_PKG_CONFIG: command not found
PKG_PROG_PKG_CONFIG: command not found  Hi, How to solve PKGPROGPKG_CONFIG: command not found error This error is coming while executing the configure script. Thanks
question "writing prog"
question "writing prog"  Hello I want helping for this question, please Write a program that reads some friendsā?? names, stores them in an array, and then prints out on the screen all friends who start by a particular letter
please help me in these prog
please help me in these prog   create 2 jdbc programs including awt create 2 jdbc programs including swing create 2 jdbc programs including command line argument create 2 jdbc programs including io class 4 jdbc prog using
Solution to C prog
Solution to C prog   Hi, Pls any body help, why the following prog crashing while running. #include<stdio.h> #include<conio.h> int main(){ int n,*fact(int *n); printf("Enter the number:"); scanf
servlet prog - Java Interview Questions
servlet prog  how to forward or redirect the client request from servlet to jsp? how a thread or request pass from one servlet prog to one jsp prog? is it possible of communicating from servlet to jsp prog? please explain briefly
make a prog for this query
make a prog for this query  write a program implementing interface for personal data n salary details. interface must contain abstract methods. steps for the program are 1) store the data in text file 2)display salary when emp id
turbo C prog.
turbo C prog.  Is it possible to print ASCII value A to Z with out using scan ? also give to simple example of binary search ...   #include<stdio.h> #include<conio.h> void main() { for(char c='A';c<
turbo C prog. Q3
turbo C prog. Q3  What is the difference between if and ladder if ? Describe ladder if with example. What is the purpose of the parameter passing ? please Describe with example.   if statement is used to write
(ForPro) turbo C prog. Q4
(ForPro) turbo C prog. Q4  I need to learn some easy foxpro program.. for example sum,interchange, loop etc
Spring Hello World prog - Spring
Spring Hello World prog  I used running the helloworld prog code mentioned in http://www.vaannila.com/spring/spring-mvc-tutorial-1.html I'm getting null pointer exception. as shown below. I added all the jars and my
prog. using radio buttons for simple calculator
prog. using radio buttons for simple calculator  import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; class Calculator extends JFrame { private final Font BIGGER_FONT = new Font
prog. using radio buttons for simple calculator
prog. using radio buttons for simple calculator  import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; class Calculator extends JFrame { private final Font BIGGER_FONT = new Font
error
error  while iam compiling iam getting expected error
Error-
Error-   Hello, I would like to know about XSD file. I try to print XML file but I am getting error SAXException-- says Content is not allowed in prolog. Please help me
error
error  i have 404 error in my program plz tell me yhe solution about
error
error  i have 404 error in my program plz tell me yhe solution about
error
/ServletUserEnquiryForm.shtml getting an error given below SQLException caught: [Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error please suggest
Error
Error  I have created ajax with php for state and city. When I change state then city will not come in dropdown list and it give me error as 'Unknown Runtime Error'. This error come only in IE browser, but in other brower
Tutorials   
Java Spring Hibernate Struts Training fat image from db fat image from db fat image from db fat image from db unable to get value returned from javascript variable in page How to change image size before adding to mysql using jsp Design a registration.jsp page with input for user registration details Cart Quantity jsp servlet coding issue servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? image pdf marking pdf marking Multiple image upload using JSP Read code from excel sheet and upload into database using JSP Student java about search engine Convert BLOB to PDF and save it to a location how to copy files from remote to local machine using SFTP SSL in java? Like Team viewer Socket and Servert -Jsp how to copy files from remote location to local using java? How To Store Multilple Images In MySQL database dynamically with image uploader and then retrieve them in image gallery using java how to create SOAP based web service in java? how to fetch data from mysql database table and draw a bar chart on that data using in jsp how to create users in LDAP using java? how to authenticate user using TIVOLI api in java? how to create users using IBM Tivoi API in jsp/servelet? Java/J2ee Please explain this code as many packages and classes are unknown to me .! how to download the uploaded folder files using jsp Login Query image is display from path of mysql database please reply the code to store dynamic fields in database? Reloading issue in jsp How to get Button Id ? calling one jap page from another jsp page login login Problem to get connection from DAO class to JDBC Page Loading Time Fix table's column's name row(1st row of the table) so that it does not move up when the table is scrolled up to view more rows below Sending hidden values

Ads

 
Advertisement null

Ads