retrieve message contents

retrieve message contents

View Answers

January 13, 2009 at 5:17 AM

Hi friend,


<html>
<title>Content Application</title>
<head>
<script type="text/javaScript">

function validateForm(theForm){



if(theForm.name.value==""){

//Please enter username

alert("Please enter user Name!");

theForm.name.focus();

return false;

}
if(theForm.content.value==""){
//please enter content
alert("Please enter discription!");
theForm.content.focus();
return false;
}
return true;
}
</script>
</head>
<body>
<center>
<table border="1" width="50%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%">
<form method="POST" action="insertAction.jsp" onsubmit="return validateForm(this);">
<table border="1" width="100%" cellpadding="0" cellspacing="0">
<h1>Content Page Application</h1>
<tr>
<td width="50%"><b>Name:</b></td>
<td width="50%"><input type="text" name="name" size="30"></td>
</tr>
<tr>
<td width="50%"><b>Description:</b></td>
<td width="50%">
<textarea name="content" type="text" cols="40" rows="15" size=100>
</textarea>
</td>
</tr>
<tr>
<td><p><input type="submit" value="Sumbit" name="sumbit"></td>
<td><p><input type="reset" value="Clear" name="reset"></td>
</tr>
</table>
</p>
</form>
</td>
</tr>
</table>
</center>
</body>
</html>
------------------------------------

January 13, 2009 at 5:18 AM

data insert action file:

<%@ page language="java" import="java.sql.*" %>

<%
Connection con = null;
String url = "jdbc:mysql://192.168.10.211:3306/";;
String db = "amar";
String driver = "com.mysql.jdbc.Driver";
String userName ="amar";
String password="amar123";

try{
Class.forName(driver);
con = DriverManager.getConnection(url+db,userName,password);
try{
Statement st = con.createStatement();
String name=request.getParameter("name");
String content = request.getParameter("content");

int val = st.executeUpdate("insert contentDetail values('"+name+"','"+content+"')");

con.close();
out.println("successfully insert data into database!");

}
catch (SQLException ex){
System.out.println("SQL statement is not executed!");
}
}
catch (Exception e){
e.printStackTrace();
}

%>

--------------------------

January 13, 2009 at 5:19 AM

display content code:

<%@ page language="java" import="java.io.*, java.sql.*" %>

<html>

<head>

<title>display data</title>

</head>

<body>

<center>

<H1>Display Record From Database<H1>

<br>

<table border="1" cellpadding="0" cellspacing="0" width="500px" height="69">

<tr>

<td></td>

</tr>

<tr>

<td><b>Id<b></td>

<td><b>Name<b></td>

<td><b>Discription No<b></td>

</tr>



<%

Connection con = null;
String url = "jdbc:mysql://192.168.10.211:3306/";;
String db = "amar";
String driver = "com.mysql.jdbc.Driver";
String userName ="amar";
String password="amar123";



try{

Class.forName(driver);
con = DriverManager.getConnection(url+db,userName,password);

try{

Statement st = con.createStatement();

String sqlQuery = "Select * from contentDetail";
System.out.println("sqlQuery>>>>>>>" + sqlQuery);

ResultSet rs = st.executeQuery(sqlQuery);

int sno = 0;

while(rs.next()){

sno++;

%>



<tr style="background-color:#CCFFFF;">

<td><%=sno%></td>

<td><%=rs.getString("name")%></td>

<td><%=rs.getString("content")%></td>

</tr>



<%



}



rs.close();

con.close();

st.close();

}

catch(SQLException ex){

System.out.println("SQL satatment not found");

}

}

catch(Exception e){

e.printStackTrace();

}

%>



</table>

<a href="contentPage.html">Home Page</a>

</center>

</body>

</html>

------------------------------------
visit for more information:

http://www.roseindia.net/jsp/

Thanks.

Amardeep









Related Tutorials/Questions & Answers:
retrieve message contents - Java Beginners
retrieve message contents   hi , dbfile system to store message headsers in mysql database and message contents in file system . how to retrieve message contents. thanks bala..   Hi friend, Content
to retrieve message body - Java Beginners
to retrieve message body  hi, Using dbfile system to store message using mysql. dbfile system is to store headers in database and message body in file system . i retrieved message contents like from :, to :, delivered
Advertisements
ModuleNotFoundError: No module named 'contents'
ModuleNotFoundError: No module named 'contents'  Hi, My Python... 'contents' How to remove the ModuleNotFoundError: No module named 'contents... to install padas library. You can install contents python with following
ModuleNotFoundError: No module named 'contents'
ModuleNotFoundError: No module named 'contents'  Hi, My Python... 'contents' How to remove the ModuleNotFoundError: No module named 'contents... to install padas library. You can install contents python with following
Web Contents
Web Contents       If coding is the body of the website, web contents are the soul. Without web contents, a website is not more than a dead body. To be an average website, web
difference between $message and $$message
difference between $message and $$message  What is the difference between $message and $$message?   Hi friends, $message is a simple variable whereas $$message is a reference variable. Example: $name = 'Bharat
What is the difference between $message and $$message?
What is the difference between $message and $$message?  What is the difference between $message and $$message
message passing
message passing  how message is passed using jade technology
Read the file Contents
Read the file Contents  Ravi Raj,Vijay45Shankar,234 Guna,345,Meet me,654,Cow Read file contents and Print the no.of words and Numbers./p> Thanks, Dinesh Ram   The given code read the file content and print
message box
message box  How to show the message "invalid username and password" after redirecting the page to the login form
Image retrieve
Image retrieve  HI.. store image path/data Java Coding. ... It's supposed to take the image, store it in a directory as well as pass the image path to mysql database... Now I want to retrieve the data from directory using path
ModuleNotFoundError: No module named 'consul-contents'
ModuleNotFoundError: No module named 'consul-contents'  Hi, My... named 'consul-contents' How to remove the ModuleNotFoundError: No module named 'consul-contents' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'consul-contents'
ModuleNotFoundError: No module named 'consul-contents'  Hi, My... named 'consul-contents' How to remove the ModuleNotFoundError: No module named 'consul-contents' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'github-contents'
ModuleNotFoundError: No module named 'github-contents'  Hi, My... named 'github-contents' How to remove the ModuleNotFoundError: No module named 'github-contents' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'consul-contents'
ModuleNotFoundError: No module named 'consul-contents'  Hi, My... named 'consul-contents' How to remove the ModuleNotFoundError: No module named 'consul-contents' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'github-contents'
ModuleNotFoundError: No module named 'github-contents'  Hi, My... named 'github-contents' How to remove the ModuleNotFoundError: No module named 'github-contents' error? Thanks   Hi, In your python
PHP file_get_contents() Function
PHP file_get_contents() Function  Hi, How do i read the content of file using PHP program? So kindly provide any example or online help reference for filegetcontents() Function in PHP. Please feel free to suggest. Thanks
Storage medium that loses its contents
Storage medium that loses its contents  A Storage medium that loses its contents in the events of power failure is called? 1. Volatile storage 2. Non volatile storage 3. Permanent storage 4. All of the above 5. None
ModuleNotFoundError: No module named 'retrieve'
ModuleNotFoundError: No module named 'retrieve'  Hi, My Python... 'retrieve' How to remove the ModuleNotFoundError: No module named 'retrieve... to install padas library. You can install retrieve python with following
Java Message Services - JMS
Java Message Services  What is Java Message Services
image retrieve - Java Beginners
Image Retrieve  How to retrieve the image from mysql field using java
PHP list contents of directory
Contents of a directory or a folder can be displayed one by one. readdir() function returns the directory as well as file name. readdir() takes input as opendir() handle.On success returns the String Example of PHP List
Objective C Message Passing
Objective C Message Passing  What exactly a message passing means in Objective C? and how can i pass a message to a method
Message Resource Bundle work.
Message Resource Bundle work.  How does Value replacement in Message Resource Bundle work
Message Context in AXIS
Message Context in AXIS  Is there any method in Axis classes to het the size of IN and OUT Message Conetext
Javascript alert message
Javascript alert message   How to send an alert message to a user in JavaScript
Retrieve data by clicking a link
Retrieve data by clicking a link  In a page there are 5 links.Every link has a hidden value. According to that hidden value data should be retrieved from the database and data should be displayed in a new page.How to do it?Please
ModuleNotFoundError: No module named 'message'
ModuleNotFoundError: No module named 'message'  Hi, My Python... 'message' How to remove the ModuleNotFoundError: No module named 'message... to install padas library. You can install message python with following command
Sql row retrieve - SQL
Sql row retrieve  Sir What are the sql statements so that I can retrieve rows from a table by specifying the row numbers such as row no.5 to 10...; Sir What are the sql statements so that I can retrieve rows from a table
store and retrieve data
store and retrieve data  sir,i want to store the entering data in a word file and retrieve it when i need.i am try to develop a video portal.in which user can watch video and write comments.the comments are stored in a file
retrieve in xml file in struts2
retrieve in xml file in struts2  i am using struts2 and trying to populate the text box for the corresponding number entered by retrieving it from... inside the bean class and based on the number entered i retrieve the name. now how
retrieve record from table
retrieve record from table  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 the field table. Actually
How to print contents of a web page in jsp?
How to print contents of a web page in jsp?  I have generated a pay slip using jsp.How do I print the contents of the slip
javascript dom error-message
javascript dom error-message  javascript dom error-message
how to send message
how to send message  how to send message for mobile in server
ModuleNotFoundError: No module named 'pdf-contents-extractor'
ModuleNotFoundError: No module named 'pdf-contents-extractor'  Hi...: No module named 'pdf-contents-extractor' How to remove the ModuleNotFoundError: No module named 'pdf-contents-extractor' error? Thanks   Hi
ModuleNotFoundError: No module named 'pdf-contents-extractor'
ModuleNotFoundError: No module named 'pdf-contents-extractor'  Hi...: No module named 'pdf-contents-extractor' How to remove the ModuleNotFoundError: No module named 'pdf-contents-extractor' error? Thanks   Hi
ModuleNotFoundError: No module named 'sceptre-file-contents-resolver'
ModuleNotFoundError: No module named 'sceptre-file-contents-resolver' ...: No module named 'sceptre-file-contents-resolver' How to remove the ModuleNotFoundError: No module named 'sceptre-file-contents-resolver' error
ModuleNotFoundError: No module named 'check-wheel-contents'
ModuleNotFoundError: No module named 'check-wheel-contents'  Hi...: No module named 'check-wheel-contents' How to remove the ModuleNotFoundError: No module named 'check-wheel-contents' error? Thanks   Hi
ModuleNotFoundError: No module named 'django-fluent-contents'
ModuleNotFoundError: No module named 'django-fluent-contents'  Hi...: No module named 'django-fluent-contents' How to remove the ModuleNotFoundError: No module named 'django-fluent-contents' error? Thanks   Hi
websphere message broker - WebSevices
websphere message broker  how can i find the heapsize of the execution group in the message broker using command console syntax
how to retrieve data from database ?????/
how to retrieve data from database ?????/  how to retrieve data from database
how to retrieve link - JSP-Servlet
how to retrieve link  how to retrieve link of a web page and use it as input in the program
how to retrieve data from database ?????/
how to retrieve data from database ?????/  how to retrieve data from database
how to retrieve data from database ?????/
how to retrieve data from database ?????/  how to retrieve data from database
how to retrieve data from database ?????/
how to retrieve data from database ?????/  how to retrieve data from database
how to retrieve a checkbox value(retrieve from DB)
how to retrieve a checkbox value(retrieve from DB)   I facing a problem with checkbox value that already exists inside the database. so how can I retrieve those value from another database table? the table subject and service
The PHP file_get_contents() function , file_get_contents php
The PHP file_get_contents() Function Function reads the content of the whole file to a string. This function is the best way to read the contents... is supported by the servers. So, the use of file_get_contents() will make your program
Struts insert & retrieve
Struts insert & retrieve  Give a struts prg to insert and retrieve data from mysql db using the struts tags(no jsp scriplets and expressions) following mvc arch. i.e. model containing db connectivity, form containing get &
retrieve multiple attribute values
XML retrieve multiple attribute values  Hello All Am a beginner. Would like some help with this. The following is part of my XML file: <...; What I would like is to retrieve both the attribute values of process

Ads