Updating A Database Using The Sql Update Tag |
|
| |
| |
This JSP source code is about Updating a database using the sql:update tag |
| |
|
| |
//web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems,Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<resource-ref>
<res-ref-name>jdbc/address</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>
<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<html>
<head>
<title>Updating a database using the sql:update tag</title>
<sql:setDataSource
var="conn"
dataSource="jdbc/address"
/>
</head>
<body>
<h1>Modify Address List</h1>
<sql:update dataSource="${conn}" var="addresses">
INSERT INTO AddressList (name,street,city,country,telephone) VALUES (?,?,?,?,?)
<sql:param value='${param["name"]}'/>
<sql:param value='${param["street"]}'/>
<sql:param value='${param["city"]}'/>
<sql:param value='${param["country"]}'/>
<sql:param value='${param["tel"]}'/>
</sql:update>
</body>
</html>
|
|
| |
|
|
| |
Date entered :
24th Jan 2007
Rating : No Rating
Accessed :
1558
Submitted by :
javabill |
|
|
| |
|
|
| |
| |
|
Click each image to add this page to each site. |
|
|
| |
| |
|
| |
|
|
No comment available at the moment.Be the first one to make a comment
|
|
|
| |
|
|
Database error: Invalid SQL: select FLOOR( AVG(b.rating)) as avg_rating,a.sourcecode_id sourcecode_id ,title,description,author,category_id,skill_level,reference,reference_mail,reference_url,a.user_id user_id,date_entered,source,accessed,dev_id,file_url,total_comments,instruction,registered,authorised,fld_deletemark,fld_code_version,fld_searchkeyword,fld_code_status,category_id from tbl_sourcecode a LEFT JOIN tbl_sourcecodecomment b ON a.sourcecode_id = b.sourcecode_id LEFT JOIN tbl_codecategory c ON a.category_id = c.fld_categoryID where a.fld_deletemark = 'N' AND a.fld_enable_disable= 'Y' AND a.authorised='Y' AND c.fld_groupIDFK='4' AND a.sourcecode_id!='854' GROUP BY a.sourcecode_id order by a.sourcecode_id DESC limit 0, 5
MySQL Error: 1030 (Got error 122 from storage engine)
Session halted.
Warning: Unknown(): write failed: Disk quota exceeded (122) in Unknown on line 0
Warning: Unknown(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0
| |