当前位置: 首页 > news >正文

单位做网站需要多少钱用nas做网站

单位做网站需要多少钱,用nas做网站,百度seo流量,广州整合营销该问题#xff0c;我百度了下#xff0c;根本没发现什么有价值的文章#xff1b;还是看源代码#xff08;详见最后附录#xff09;中的注释#xff0c;最有效了#xff01;insert#xff0c;返回值是#xff1a;新插入行的主键#xff08;primary key#xff09;我百度了下根本没发现什么有价值的文章还是看源代码详见最后附录中的注释最有效了insert返回值是新插入行的主键primary key需要包含selectKey语句才会返回主键否则返回值为null。update/delete返回值是更新或删除的行数无需指明resultClass但如果有约束异常而删除失败只能去捕捉异常。queryForObject返回的是一个实例对象或null需要包含select语句并且指明resultMapqueryForList返回的是实例对象的列表需要包含select语句并且指明resultMap 我的配置文件如下desktop_common_sqlMap.xml typeAlias aliasUnlockTagInfo typecom.desktop.common.bean.UnlockTagInfo /resultMap classUnlockTagInfo idUnlockTagInfoResultresult columnid propertyid jdbcTypeINTEGER /result columnname propertyname jdbcTypeVARCHAR /result columndescription propertydescription jdbcTypeVARCHAR /result columnpriority propertypriority jdbcTypeINTEGER //resultMapinsert idinsertUnlockTagInfo parameterClassmapselectKey resultClassint keyPropertyidselectnextval(desktop_unlock_tag_id_seq) as id/selectKeyinsert intodesktop_unlock_tag(id,name,description,priority)values(#id:INTEGER#,#name:VARCHAR#,#description:VARCHAR#,#priority:INTEGER#)/insertupdate idupdateUnlockTagInfo parameterClassmapupdatedesktop_unlock_tagset modify_timenow(),priority#priority:INTEGER#,name#name:VARCHAR#,description#description:VARCHAR#whereid#id:INTEGER#/updatedelete iddeleteUnlockTagInfo parameterClassintdelete fromdesktop_unlock_tagwhere id#value:INTEGER#/deleteselect idcountUnlockTagInfo resultClassintselect count(*)fromdesktop_unlock_tag/selectsql idselectUnlockTagInfoselectid,name,description,priorityfromdesktop_unlock_tag/sqlselect idfindUnlockTagInfoById parameterClassintresultMapUnlockTagInfoResultinclude refidselectUnlockTagInfo /where id#id:INTEGER#/selectselect idlistUnlockTagInfo parameterClassmapresultMapUnlockTagInfoResultinclude refidselectUnlockTagInfo /order bymodify_time desc limit #size:INTEGER#offset #start:INTEGER#/select 我的DAO源码如下 public class UnlockTagDaoImpl extends SqlMapClientDaoSupport implementsUnlockTagDao {Overridepublic Integer addItem(String name, String desc, Integer priority) {SqlMapClientTemplate template this.getSqlMapClientTemplate();MapString, Object args new HashMapString, Object();args.put(name, name);args.put(description, desc);args.put(priority, priority);Object key template.insert(DesktopCommon.insertUnlockTagInfo, args);return (Integer) key;}Overridepublic boolean updateItem(Integer id, String name, String description,Integer priority) {SqlMapClientTemplate template this.getSqlMapClientTemplate();MapString, Object args new HashMapString, Object();args.put(id, id);args.put(name, name);args.put(description, description);args.put(priority, priority);try {int c template.update(DesktopCommon.updateUnlockTagInfo, args);if (c 0) {return true;}return false;} catch (Exception e) {return false;}}Overridepublic boolean deleteItem(Integer id) {SqlMapClientTemplate template this.getSqlMapClientTemplate();try {int c template.delete(DesktopCommon.deleteUnlockTagInfo, id);if (c 0) {return true;}return false;} catch (Exception e) {return false;}}Overridepublic UnlockTagInfo findItemById(Integer id) {SqlMapClientTemplate template this.getSqlMapClientTemplate();UnlockTagInfo item (UnlockTagInfo) template.queryForObject(DesktopCommon.findUnlockTagInfoById, id);return item;}Overridepublic PagedListUnlockTagInfo listAll(Integer nStart, Integer nSize,boolean bCountTotal) {SqlMapClientTemplate template this.getSqlMapClientTemplate();PagedListUnlockTagInfo result new PagedListUnlockTagInfo();if (bCountTotal) {int total (Integer) template.queryForObject(DesktopCommon.countUnlockTagInfo);result.setTotal(total);}MapString, Integer args new HashMapString, Integer();args.put(start, nStart);args.put(size, nSize);SuppressWarnings(unchecked)ListUnlockTagInfo items template.queryForList(DesktopCommon.listUnlockTagInfo, args);result.setData(items);return result;} }   关于ibatis的接口参见其源码com\ibatis\sqlmap\client\SqlMapExecutor.java: /** Copyright 2004 Clinton Begin** Licensed under the Apache License, Version 2.0 (the License);* you may not use this file except in compliance with the License.* You may obtain a copy of the License at** http://www.apache.org/licenses/LICENSE-2.0** Unless required by applicable law or agreed to in writing, software* distributed under the License is distributed on an AS IS BASIS,* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.*/ package com.ibatis.sqlmap.client;import com.ibatis.common.util.PaginatedList; import com.ibatis.sqlmap.client.event.RowHandler; import com.ibatis.sqlmap.engine.execution.BatchException;import java.sql.SQLException; import java.util.List; import java.util.Map;/*** This interface declares all methods involved with executing statements* and batches for an SQL Map.** see SqlMapSession* see SqlMapClient*/ public interface SqlMapExecutor {/*** Executes a mapped SQL INSERT statement.* Insert is a bit different from other update methods, as it* provides facilities for returning the primary key of the* newly inserted row (rather than the effected rows). This* functionality is of course optional.* p/* The parameter object is generally used to supply the input* data for the INSERT values.** param id The name of the statement to execute.* param parameterObject The parameter object (e.g. JavaBean, Map, XML etc.).* return The primary key of the newly inserted row. This might be automatically* generated by the RDBMS, or selected from a sequence table or other source.* throws java.sql.SQLException If an error occurs.*/Object insert(String id, Object parameterObject) throws SQLException;/*** Executes a mapped SQL INSERT statement.* Insert is a bit different from other update methods, as it* provides facilities for returning the primary key of the* newly inserted row (rather than the effected rows). This* functionality is of course optional.* p/* This overload assumes no parameter is needed.** param id The name of the statement to execute.* return The primary key of the newly inserted row. This might be automatically* generated by the RDBMS, or selected from a sequence table or other source.* throws java.sql.SQLException If an error occurs.*/Object insert(String id) throws SQLException;/*** Executes a mapped SQL UPDATE statement.* Update can also be used for any other update statement type,* such as inserts and deletes. Update returns the number of* rows effected.* p/* The parameter object is generally used to supply the input* data for the UPDATE values as well as the WHERE clause parameter(s).** param id The name of the statement to execute.* param parameterObject The parameter object (e.g. JavaBean, Map, XML etc.).* return The number of rows effected.* throws java.sql.SQLException If an error occurs.*/int update(String id, Object parameterObject) throws SQLException;/*** Executes a mapped SQL UPDATE statement.* Update can also be used for any other update statement type,* such as inserts and deletes. Update returns the number of* rows effected.* p/* This overload assumes no parameter is needed.** param id The name of the statement to execute.* return The number of rows effected.* throws java.sql.SQLException If an error occurs.*/int update(String id) throws SQLException;/*** Executes a mapped SQL DELETE statement.* Delete returns the number of rows effected.* p/* The parameter object is generally used to supply the input* data for the WHERE clause parameter(s) of the DELETE statement.** param id The name of the statement to execute.* param parameterObject The parameter object (e.g. JavaBean, Map, XML etc.).* return The number of rows effected.* throws java.sql.SQLException If an error occurs.*/int delete(String id, Object parameterObject) throws SQLException;/*** Executes a mapped SQL DELETE statement.* Delete returns the number of rows effected.* p/* This overload assumes no parameter is needed.** param id The name of the statement to execute.* return The number of rows effected.* throws java.sql.SQLException If an error occurs.*/int delete(String id) throws SQLException;/*** Executes a mapped SQL SELECT statement that returns data to populate* a single object instance.* p/* The parameter object is generally used to supply the input* data for the WHERE clause parameter(s) of the SELECT statement.** param id The name of the statement to execute.* param parameterObject The parameter object (e.g. JavaBean, Map, XML etc.).* return The single result object populated with the result set data,* or null if no result was found* throws java.sql.SQLException If more than one result was found, or if any other error occurs.*/Object queryForObject(String id, Object parameterObject) throws SQLException;/*** Executes a mapped SQL SELECT statement that returns data to populate* a single object instance.* p/* This overload assumes no parameter is needed.** param id The name of the statement to execute.* return The single result object populated with the result set data,* or null if no result was found* throws java.sql.SQLException If more than one result was found, or if any other error occurs.*/Object queryForObject(String id) throws SQLException;/*** Executes a mapped SQL SELECT statement that returns data to populate* the supplied result object.* p/* The parameter object is generally used to supply the input* data for the WHERE clause parameter(s) of the SELECT statement.** param id The name of the statement to execute.* param parameterObject The parameter object (e.g. JavaBean, Map, XML etc.).* param resultObject The result object instance that should be populated with result data.* return The single result object as supplied by the resultObject parameter, populated with the result set data,* or null if no result was found* throws java.sql.SQLException If more than one result was found, or if any other error occurs.*/Object queryForObject(String id, Object parameterObject, Object resultObject) throws SQLException;/*** Executes a mapped SQL SELECT statement that returns data to populate* a number of result objects.* p/* The parameter object is generally used to supply the input* data for the WHERE clause parameter(s) of the SELECT statement.** param id The name of the statement to execute.* param parameterObject The parameter object (e.g. JavaBean, Map, XML etc.).* return A List of result objects.* throws java.sql.SQLException If an error occurs.*/List queryForList(String id, Object parameterObject) throws SQLException;/*** Executes a mapped SQL SELECT statement that returns data to populate* a number of result objects.* p/* This overload assumes no parameter is needed.** param id The name of the statement to execute.* return A List of result objects.* throws java.sql.SQLException If an error occurs.*/List queryForList(String id) throws SQLException;/*** Executes a mapped SQL SELECT statement that returns data to populate* a number of result objects within a certain range.* p/* The parameter object is generally used to supply the input* data for the WHERE clause parameter(s) of the SELECT statement.** param id The name of the statement to execute.* param parameterObject The parameter object (e.g. JavaBean, Map, XML etc.).* param skip The number of results to ignore.* param max The maximum number of results to return.* return A List of result objects.* throws java.sql.SQLException If an error occurs.*/List queryForList(String id, Object parameterObject, int skip, int max) throws SQLException;/*** Executes a mapped SQL SELECT statement that returns data to populate* a number of result objects within a certain range.* p/* This overload assumes no parameter is needed.** param id The name of the statement to execute.* param skip The number of results to ignore.* param max The maximum number of results to return.* return A List of result objects.* throws java.sql.SQLException If an error occurs.*/List queryForList(String id, int skip, int max) throws SQLException;/*** Executes a mapped SQL SELECT statement that returns a number of* result objects that will be handled one at a time by a* RowHandler.* p/* This is generally a good approach to take when dealing with large sets* of records (i.e. hundreds, thousands...) that need to be processed without* eating up all of the system resources.* p/* The parameter object is generally used to supply the input* data for the WHERE clause parameter(s) of the SELECT statement.** param id The name of the statement to execute.* param parameterObject The parameter object (e.g. JavaBean, Map, XML etc.).* param rowHandler A RowHandler instance* throws java.sql.SQLException If an error occurs.*/void queryWithRowHandler(String id, Object parameterObject, RowHandler rowHandler) throws SQLException;/*** Executes a mapped SQL SELECT statement that returns a number of* result objects that will be handled one at a time by a* RowHandler.* p/* This is generally a good approach to take when dealing with large sets* of records (i.e. hundreds, thousands...) that need to be processed without* eating up all of the system resources.* p/* This overload assumes no parameter is needed.** param id The name of the statement to execute.* param rowHandler A RowHandler instance* throws java.sql.SQLException If an error occurs.*/void queryWithRowHandler(String id, RowHandler rowHandler) throws SQLException;/*** Executes a mapped SQL SELECT statement that returns data to populate* a number of result objects a page at a time.* p/* The parameter object is generally used to supply the input* data for the WHERE clause parameter(s) of the SELECT statement.** param id The name of the statement to execute.* param parameterObject The parameter object (e.g. JavaBean, Map, XML etc.).* param pageSize The maximum number of result objects each page can hold.* return A PaginatedList of result objects.* throws java.sql.SQLException If an error occurs.* deprecated All paginated list features have been deprecated*/PaginatedList queryForPaginatedList(String id, Object parameterObject, int pageSize) throws SQLException;/*** Executes a mapped SQL SELECT statement that returns data to populate* a number of result objects a page at a time.* p/* This overload assumes no parameter is needed.** param id The name of the statement to execute.* param pageSize The maximum number of result objects each page can hold.* return A PaginatedList of result objects.* throws java.sql.SQLException If an error occurs.* deprecated All paginated list features have been deprecated*/PaginatedList queryForPaginatedList(String id, int pageSize) throws SQLException;/*** Executes a mapped SQL SELECT statement that returns data to populate* a number of result objects that will be keyed into a Map.* p/* The parameter object is generally used to supply the input* data for the WHERE clause parameter(s) of the SELECT statement.** param id The name of the statement to execute.* param parameterObject The parameter object (e.g. JavaBean, Map, XML etc.).* param keyProp The property to be used as the key in the Map.* return A Map keyed by keyProp with values being the result object instance.* throws java.sql.SQLException If an error occurs.*/Map queryForMap(String id, Object parameterObject, String keyProp) throws SQLException;/*** Executes a mapped SQL SELECT statement that returns data to populate* a number of result objects from which one property will be keyed into a Map.* p/* The parameter object is generally used to supply the input* data for the WHERE clause parameter(s) of the SELECT statement.** param id The name of the statement to execute.* param parameterObject The parameter object (e.g. JavaBean, Map, XML etc.).* param keyProp The property to be used as the key in the Map.* param valueProp The property to be used as the value in the Map.* return A Map keyed by keyProp with values of valueProp.* throws java.sql.SQLException If an error occurs.*/Map queryForMap(String id, Object parameterObject, String keyProp, String valueProp) throws SQLException;/*** Starts a batch in which update statements will be cached before being sent to* the database all at once. This can improve overall performance of updates update* when dealing with numerous updates (e.g. inserting 1:M related data).** throws java.sql.SQLException If the batch could not be started.*/void startBatch() throws SQLException;/*** Executes (flushes) all statements currently batched.** return the number of rows updated in the batch* throws java.sql.SQLException If the batch could not be executed or if any of the statements* fails.*/int executeBatch() throws SQLException;/*** Executes (flushes) all statements currently batched.** return a List of BatchResult objects. There will be one element in the* list for each sub-batch executed. A sub-batch is created by adding a statement* to the batch that does not equal the prior statement. * throws SQLException if a database access error occurs, or the drive* does not support batch statements* throws BatchException if the driver throws BatchUpdateException* see com.ibatis.sqlmap.engine.execution.BatchException*/List executeBatchDetailed() throws SQLException, BatchException; }     转载自http://blog.csdn.net/gaojinshan/article/details/24308313  转载于:https://www.cnblogs.com/gmq-sh/p/4386598.html
http://www.sadfv.cn/news/416312/

相关文章:

  • 茂名网站建设服务表白网页代码
  • 贵州城乡建设厅城乡建设网站aso优化技巧
  • 大型服装网站建设正邦做网站吗
  • 中小型网站建设行情空间网络
  • 海外网站推广方法策划公司有哪些
  • wcm 可以做网站吗wordpress注册界面修改密码
  • 东莞物流网站设计公司汽油价格92号最新调整时间
  • 公司展示类网站模板免费下载哈尔滨大型网站制作
  • 无极网站网站网站怎么做的防采集
  • 网站建设动态站酷网素材图库免费下载
  • 长治市住房保障和城乡建设管理局网站下列关于网站开发中网页
  • 清华紫光做网站wordpress 简约模板
  • 网站建设shwzzz如何建设网站制作平台
  • 建设工程资质证书二维码扫描网站关键词排名推广方法
  • 专线可以做网站软件开发培训学校排名又简单又紧
  • 网站法人与负责人太原seo网络优化招聘网
  • 手机在网上怎么创建自己的网站世界杯32强排名
  • 微信引流神器手机电影网站怎么做施工企业安全总监职责履行情况
  • 广东建站常见网站开发的语言
  • 网页免费建站html动漫网页设计作品及代码
  • 江西省城乡建设培训网官方网站php和django做网站哪个好
  • 网站降权不收录北京和隆优化科技
  • 婚纱摄影网站优化技巧制作网页的素材图片及文字
  • 百度指数官方网站程序员需要考哪些证书
  • 整站seo优化哪家好郑州做网站哪家好熊掌号
  • 阿里巴巴网站建设的目的全国优秀施工企业查询
  • 无锡制作网站楼市最新消息:2023年房价走势
  • synology做网站服务器盐城哪里帮助公司建网址
  • 镇平县建设局网站微信公众号微网站建设
  • 站酷app广安seo优化