大雀软件园

首页 软件下载 安卓市场 苹果市场 电脑游戏 安卓游戏 文章资讯 驱动下载
技术开发 网页设计 图形图象 数据库 网络媒体 网络安全 站长CLUB 操作系统 媒体动画 安卓相关
当前位置: 首页 -> 技术开发 -> JSP专区 -> 用JSP编写通用信息发布程序 

用JSP编写通用信息发布程序 

时间: 2021-07-31 作者:daque

消息颁布界面 供给颁布消息的交互界面,挪用 recordmessage.jsp步调。  saymessage.jsp  <html> <head> <title> 消息颁布</title>  <meta content = "text/html; charset=gb2312" http-equiv = content-type> <link href ="css_01.css" rel = stylesheet> <meta content = "mshtml 5.00.3103.1000" name =generator> </head> <body> <% @ page contenttype=“ text/html; charset=gb2312”% >  <% @ page language=“ java” import=“ java .sql .*”% >  <jsp: usebean id ="rencommend" scope="page" class="ymbean.opdb"/> <form action =recordmessage.jsp method =post name=sign> <input name=dtkey type=hidden value=ta_routes> <table bgcolor=#d5e8fd border=0 cellspacing=1 width="97%"> <tbody> <tr> <td nowrap width="45%" height="185"> <div align=left> <table bgcolor=#d5e8fd border=0 cellspacing=1 width="100%"> <tbody> <tr> <td nowrap width="100%" >线路称呼: <input maxlength=100 name = routename size=36> </td> </tr> <tr><td nowrap width="100%">表露序号: <input maxlength=3 name=routeno size=36> </td></tr> <tr> <td width="100%" >参观实质。笔墨超一条龙时 ,请您敲 enter键换行</td> </tr> <tr><td width="100%" height="162"> <textarea cols=55 name =c04 rows=9> </textarea> </td> </tr></tbody></table></div></td></tr> <tr><td align=middle colspan=2 nowrap> <input name=cmdcommit type=submit value="提交"> </td></tr></tbody></table> </form></center> <div></div></body></html>  贯穿数据库 经过挪用 java bean贯穿 oracle数据库。  opdb.java  package ymbean; // java包  import java.sql.* ;  public class opdb {  public opdb() { }  public resultset executequery(string sql)  {  resultset rs = null;  statement lstmt = null;  try { lstmt = connectdb();  rs = lstmt.executequery(sql);  system.out.println(“ executequery:”+ sql);  } catch(sqlexception ex) { return(null); }  return rs;  }  public string executeupdate(string sql)  {  resultset rs = null;  statement lstmt = null;  try {  lstmt = connectdb();  lstmt.executeupdate(sql);  system.out.println(“ executeupdate:”+ sql);  lstmt.executeupdate(“ commit” );  }catch(sqlexception ex) {}  return(“ executeupdate ok” );  }  //贯穿数据库  public statement connectdb()  { statement lstmt=null;  connection conn=null;  final string connect_string=“ jdbc:oracle:thin:scott/tiger@192.168.0.1:1521:test” ;  final string driver_string=“ oracle.jdbc.driver.  oracledriver” ;  connection lconn;  try { class.forname(driverstr);  lconn=drivermanager.getconnection(connectstr);  lstmt=lconn.createstatement();  } catch (exception e) { return(null);}  return lstmt;  }  }//end opdb.java

热门阅览

最新排行

Copyright © 2019-2021 大雀软件园(www.daque.cn) All Rights Reserved.