选择显示字体大小

jsp编程进度条设计实例(3)

二、启动任务 start.jsp是web.xml部署描述符中声明的欢迎页面,web.xml的内容是:<?xml version="1.0" encoding="gb2312"?><!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> <welcome-file-list> <welcome-file>start.jsp</welcome-file> </welcome-file-list></web-app> start.jsp启动一个专用的线程来运行“繁重的任务”,然后把http请求传递给status.jsp。 start.jsp页...

http://www.sosof.com/detail/327/7133272619278.html -by - 丰搜 缓存页面


jsp编程进度条设计实例(2)

如果任务已经启动,isstarted()方法将返回true:public synchronized boolean isstarted() { return started;} 如果任务已经完成,iscompleted()方法将返回true:public synchronized boolean iscompleted() { return counter == 100;} 如果任务正在运行,isrunning()方法将返回true:public synchronized boolean isrunning() { return running;} setrunning()方法由start.jsp或stop.jsp调用,当running参数是true时。setrunning()方法还要将任务标记为“已经启动”。调用setrunning(false)表示要求run()方法停止执行。pub...

http://www.sosof.com/detail/327/7163272621404.html -by - 丰搜 缓存页面


jsp编程进度条设计实例(1)

许多web应用、企业应用涉及到长时间的操作,例如复杂的数据库查询或繁重的xml处理等,虽然这些任务主要由数据库系统或中间件完成,但任务执行的结果仍旧要借助jsp才能发送给用户。本文介绍了一种通过改进前端表现层来改善用户感觉、减轻服务器负载的办法。 当jsp调用一个必须长时间运行的操作,且该操作的结果不能(在服务器端)缓冲,用户每次请求该页面时都必须长时间等待。很多时候,用户会失去耐心,接着尝试点击浏览器的刷新按钮,最终失望地离开。 本文介绍的技术是把繁重的计算任务分离开来,由一个独立的线程运行,从而解决上述问题。当用户调用jsp页面时,jsp页面会立即返回,并提示用户任务已经启动且正在执行;jsp页面自动刷新自己,报告在独立线程中运行的繁重计算任务的当前进度,直至任务完成。一、模拟任务 首先我们设计一个taskbean类,它实现java.lang.runnable 接口,其run()方法在...

http://www.sosof.com/detail/327/9383272622446.html -by - 丰搜 缓存页面


jsp连接各类数据库大全(7)

七、jsp连接postgresql数据库 testmysql.jsp如下: <%@ page contenttype="text/html;charset=gb2312"%> <%@ page import="java.sql.*"%> <html> <body> <%class.forname("org.postgresql.driver").newinstance(); string url ="jdbc:postgresql://localhost/soft" //soft为你的数据库名 string user="myuser"; string password="mypassword"; connection conn= drivermanager.getconnection(url,user,password); statement stmt=con...

http://www.sosof.com/detail/327/2003272624338.html -by - 丰搜 缓存页面


jsp连接各类数据库大全(6)

六、jsp连接mysql数据库 testmysql.jsp如下: <%@ page contenttype="text/html;charset=gb2312"%> <%@ page import="java.sql.*"%> <html> <body> <%class.forname("org.gjt.mm.mysql.driver").newinstance(); string url ="jdbc:mysql://localhost/softforum?user=soft&password=soft1234&useunicode=true&characterencoding=8859_1" //testdb为你的数据库名 connection conn= drivermanager.getconnection(url); statement stmt=c...

http://www.sosof.com/detail/327/4223272625610.html -by - 丰搜 缓存页面


jsp连接各类数据库大全(5)

五、jsp连接sybase数据库 testmysql.jsp如下: <%@ page contenttype="text/html;charset=gb2312"%> <%@ page import="java.sql.*"%> <html> <body> <%class.forname("com.sybase.jdbc.sybdriver").newinstance(); string url =" jdbc:sybase:tds:localhost:5007/tsdata"; //tsdata为你的数据库名 properties sysprops = system.getproperties(); sysprops.put("user","userid"); sysprops.put("password","user_password"); connect...

http://www.sosof.com/detail/327/6533272626249.html -by - 丰搜 缓存页面


jsp连接各类数据库大全(4)

四、jsp连接informix数据库 testinformix.jsp如下: <%@ page contenttype="text/html;charset=gb2312"%> <%@ page import="java.sql.*"%> <html> <body> <%class.forname("com.informix.jdbc.ifxdriver").newinstance(); string url = "jdbc:informix-sqli://123.45.67.89:1533/testdb:informixserver=myserver; user=testuser;password=testpassword"; //testdb为你的数据库名 connection conn= drivermanager.getconnection(url);...

http://www.sosof.com/detail/327/4933272640161.html -by - 丰搜 缓存页面


jsp连接各类数据库大全(3)

三、jsp连接db2数据库 testdb2.jsp如下: <%@ page contenttype="text/html;charset=gb2312"%> <%@ page import="java.sql.*"%> <html> <body> <%class.forname("com.ibm.db2.jdbc.app.db2driver ").newinstance(); string url="jdbc:db2://localhost:5000/sample"; //sample为你的数据库名 string user="admin"; string password=""; connection conn= drivermanager.getconnection(url,user,password); statement stmt=conn.create...

http://www.sosof.com/detail/327/5933272654484.html -by - 丰搜 缓存页面


jsp连接各类数据库大全(2)

二、jsp连接sql server7.0/2000数据库 testsqlserver.jsp如下: <%@ page contenttype="text/html;charset=gb2312"%> <%@ page import="java.sql.*"%> <html> <body> <%class.forname("com.microsoft.jdbc.sqlserver.sqlserverdriver").newinstance(); string url="jdbc:microsoft:sqlserver://localhost:1433;databasename=pubs"; //pubs为你的数据库的 string user="sa"; string password=""; connection conn= drivermanager.get...

http://www.sosof.com/detail/427/933427267750.html -by - 丰搜 缓存页面


jsp连接各类数据库大全(1)

现在有好多初学jsp的网友经常会问数据库怎么连接啊,怎么老出错啊?所以我集中的在这写篇文章供大家参考,其实这种把数据库逻辑全部放在jsp里未必是好的做法,但是有利于初学者学习,所以我就这样做了,当大家学到一定程度的时候,可以考虑用mvc的模式开发。在练习这些代码的时候,你一定将jdbc的驱动程序放到服务器的类路径里,然后要在数据库里建一个表test,有两个字段比如为test1,test2,可以用下面sql建 create table test(test1 varchar(20),test2 varchar(20)然后向这个表写入一条测试纪录,那么现在开始我们的jsp和数据库之旅吧。 一、jsp连接oracle8/8i/9i数据库(用thin模式) testoracle.jsp如下: <%@ page contenttype="text/html;charset=gb2312"%> &...

http://www.sosof.com/detail/427/6324272621489.html -by - 丰搜 缓存页面


上一页 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 下一页

 


相关 与本文相关文章

分类 所有文章关键字导航

源码编程相关

Java   Asp   PHP   .Net   XML   C/C++   CGI   VB   Jsp   J2ee   J2se   J2me   EJB   Servlet   Tomcat   Resin   Struts   Weblogic   Eclipse   ANT   GUI   JMS   Web servise   IDEA   Webphere   Hibernate   Spring   Jboss   Applet   Swing   Socket   Javamail   Perl   Ajax   P2P   安全   模式   框架   测试   开源   游戏

SQL数据库相关

My-SQL   Ms-SQL   Access   DB2   Oracle   Sybase   SQLserver   索引   存储过程   加密   数据库   分页   视图  

手机无线相关

3G   Wap   CDMA   GRPS   GSM   IVR   彩信   短信   无线   增值业务

网页设计制作相关

HTML   CSS   网页配色   网页特效   Javascript   VBscript   Dreamweaver   Frontpage   JS   Web   网站设计

网站建设推广相关

建站经验   网站优化   网站排名   推广   Alexa

操作系统/服务器相关

Windows XP   Windows 2000   Windows 2003   Windows Me   Windows 9.x   Linux   UNIX   注册表   操作系统   服务器   应用服务器

图形图像多媒体相关

Photoshop   Fireworks   Flash   Coreldraw   Illustrator   Freehand   Photoimpact   多媒体   图形图像

标准 网站致力的规范

Valid CSS!

无不良内容,无不良广告,无恶意代码

Valid XHTML 1.0 Transitional

creativecommons