上一页 1 ··· 6 7 8 9 10 11 12 13 14 下一页
摘要: SSH返回JSON格式的数据时,需要用到gson,将gson-1.6.jar添加进Build path以后运行,出错: 后来把gson-1.6.jar复制到WEB-INF/lib/下再运行,就没再出这个错误了。原来即使加入了Build path也还是要复制到WEB-INF/lib/下,但是其他的ja 阅读全文
posted @ 2015-07-21 15:37 MSTK 阅读(5544) 评论(0) 推荐(0)
摘要: 如果要查找一个集合中是否包含了某个对象,那么就需要把这个对象和这个集合中的每个对象依次进行比较和判断,直到找到这个对象为止,或者把所有对象都比较一次为止(如果最后一个对象才是要查找的对象,或者集合中没有包含要查找的对象)。当集合中的对象数量较多时,效率就很低。为了提高效率,提出了Hash算法。Has... 阅读全文
posted @ 2015-07-11 23:03 MSTK 阅读(10976) 评论(1) 推荐(3)
摘要: Java中的堆(Heap)是一个运行时数据区,用来存放类的对象;栈(Stack)主要存放基本的数据类型(int、char、double等8种基本数据类型)和对象句柄。例1 int a=5; int b=5; System.out.println(a==b);... 阅读全文
posted @ 2015-07-02 11:54 MSTK 阅读(1644) 评论(3) 推荐(2)
摘要: 运行结果。 浏览课程: 添加课程: 还有删除课程,这里就不演示了。 阅读全文
posted @ 2015-06-07 16:35 MSTK 阅读(211) 评论(0) 推荐(0)
摘要: 在WebContent文件夹下新建query.jsp和save.jsp文件。 query.jsp: save.jsp: 阅读全文
posted @ 2015-06-07 16:25 MSTK 阅读(465) 评论(0) 推荐(0)
摘要: 在src中新建struts.xml文件: ClasAction.java文件: ClasQueryAction.java文件: 阅读全文
posted @ 2015-06-07 16:21 MSTK 阅读(440) 评论(0) 推荐(0)
摘要: Clas.hbm.xml文件如下: Clas.java文件如下: 阅读全文
posted @ 2015-06-07 16:16 MSTK 阅读(236) 评论(0) 推荐(0)
摘要: src文件夹的结构如下: clasDao文件: ClasDAOImpl文件: clasService文件: ClasServiceImpl文件: 阅读全文
posted @ 2015-05-29 21:34 MSTK 阅读(417) 评论(0) 推荐(0)
摘要: 在WebContent\WEB-INF\下新建两个文件:applicationContext.xml和web.xml。 web.xml: web.xml指定了filter和listener。 applicationContext.xml: applicationContext.xml定义了多个bea 阅读全文
posted @ 2015-05-29 21:00 MSTK 阅读(363) 评论(0) 推荐(0)
摘要: 首先,配置struts.xml文件: 阅读全文
posted @ 2015-04-30 11:11 MSTK 阅读(297) 评论(0) 推荐(0)
摘要: JSON(JavaScript Object Notation) 是一种轻量级的数据交换格式。下载JSON所需要的jar文件并加入工程后,编写如下代码:package com.hzhi.json;import net.sf.json.JSONArray;import net.sf.json.JSON... 阅读全文
posted @ 2015-03-16 11:34 MSTK 阅读(1339) 评论(0) 推荐(0)
摘要: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.这个错误表明缺少Theme.AppCompat.Light这个主题,而这个主题... 阅读全文
posted @ 2015-03-04 14:56 MSTK 阅读(5515) 评论(0) 推荐(0)
摘要: 运行Eclipse,出现了"Failed to create the Java Virtual Machine."错误:解决的办法是在Eclipse的解压目录下找到eclipse.ini文件,修改其中的参数。修改前的eclipse.ini文件:-startupplugins/org.eclipse.... 阅读全文
posted @ 2015-03-03 20:17 MSTK 阅读(1585) 评论(0) 推荐(0)
摘要: 最近导入了一个项目,始终在Loading descriptor ...,很长时间都没有结束。这是Eclipse在从java.sun.com的服务器上下载配置文件,下载速度过慢导致的,其实配置文件不是必须的,没有也可以。解决的办法是修改hosts文件,添加一行:127.0.0.1 java.sun.c... 阅读全文
posted @ 2015-02-27 20:10 MSTK 阅读(361) 评论(0) 推荐(0)
摘要: 在启动Tomcat Server时,经常会出现启动时间过长的错误,如下图所示(为了方便截图,Start Timeout被设置为5秒钟,一般为45秒钟)。 双击Tomcat v7.0 Server at localhost,在弹出的窗体中将Start Timeout被设置为一个较大的值(如1000秒) 阅读全文
posted @ 2015-02-21 14:48 MSTK 阅读(2585) 评论(0) 推荐(0)
摘要: Connection.prepareStatement()函数出错,提示: Type mismatch: cannot convert from java.sql.PreparedStatement to com.mysql.jdbc.PreparedStatement 这是因为引入的包不对头, 引 阅读全文
posted @ 2015-02-09 15:44 MSTK 阅读(15420) 评论(0) 推荐(3)
摘要: 用以下SQL语句向表2中插入数据:insert into 表2select *from 表1结果出现Incorrect string value错误:打开表2一看,里面全是问号:后来才发现,表1的几个字段Collation是gbk,而表2的几个字段Collation是latin,把表2的几个字段Co... 阅读全文
posted @ 2015-02-09 12:42 MSTK 阅读(2116) 评论(0) 推荐(0)
摘要: 一、二进制日志简介MySQL有不同类型的日志,其中二进制文件记录了所有对数据库的修改,如果数据库因为操作不当或其他原因丢失了数据,可以通过二进制文件恢复。在my.ini文件中设置了log-bin,重新启动MySQL后就开启了二进制日志。数据库每次重新启动(或执行flush logs命令)后,都会生成... 阅读全文
posted @ 2015-02-04 21:01 MSTK 阅读(2964) 评论(0) 推荐(0)
摘要: 找到my.ini(Linux下是my.cnf)文件,在文件里加入下面两行:log="F:/mysqllog/mysql.log"log-bin="F:/mysqllog/logbin.log"重新启动MySQL服务,即开启了log和log_bin日志。 阅读全文
posted @ 2015-01-31 15:05 MSTK 阅读(295) 评论(0) 推荐(0)
摘要: 在MySQL Workbench里面使用SQL语句:delete from 表名提示出错:Error Code: 1175.You are using safe update mode and you tried to update a table without a WHERE that uses... 阅读全文
posted @ 2015-01-28 13:59 MSTK 阅读(741) 评论(0) 推荐(0)
摘要: 一般情况下,MySQL安装以后是自动运行的,不知道我这台机器是什么原因,MySQL不能自动运行,每次开机后都要手动运行mysqld.exe,比较麻烦,于是用以下方法将MySQL自动启动:1. 运行cmd,并切换到MySQL的bin目录下;2. 输入mysqld --install命令,回车;3.运行... 阅读全文
posted @ 2015-01-28 10:54 MSTK 阅读(6268) 评论(0) 推荐(0)
摘要: 1. 在MySQL WorkBench的Server Administrator中双击要连接的数据库;2.点击左边的Data Import/Restore;3.Import from Dump Project Folder是从文件夹导入,Import from Self-Contained File... 阅读全文
posted @ 2014-12-30 21:30 MSTK 阅读(21933) 评论(0) 推荐(0)
摘要: 1. 在MySQL WorkBench的Server Administrator中双击要连接的数据库;2. 点击左边的Data Export,在右边的数据库列表中选择要导出的数据库;3. Export to Dump Project Folder是每张表导出一个.sql文件,Export to Se... 阅读全文
posted @ 2014-12-30 21:21 MSTK 阅读(9136) 评论(0) 推荐(0)
摘要: 1. 进入控制面板->管理工具->数据源(ODBC);2. 点击添加,数据源驱动程序选择MySQL ODBC 5.1 Driver;3. 弹出MySQL Connecotor/ODBC对话框,输入数据源名称、描述(可选)、TCP/IP Server(服务器IP)、Port(MySQL端口)、User... 阅读全文
posted @ 2014-12-30 20:07 MSTK 阅读(673) 评论(0) 推荐(0)
摘要: 最近下载一个新版本的adt-bundle,Android API是20。把Plain Text控件往布局上面拖时,发现拖不上去,出现了下面的错误:Exception raised during rendering: java.lang.System.arraycopy([CI[CII)V搞不懂是什么... 阅读全文
posted @ 2014-11-24 17:57 MSTK 阅读(3783) 评论(0) 推荐(0)
摘要: 在Eclipse中开发Android项目时,鼠标停放在想要查看帮助文档的类上面,发现没有显示帮助文档,显示了下面一句话:Note: This element neither has attached source nor attached Javadoc and hence no Javadoc c... 阅读全文
posted @ 2014-11-19 16:27 MSTK 阅读(10807) 评论(0) 推荐(0)
摘要: package file_op;import java.io.File;public class file_list { static int n =0; /** * @param args */ public static void main(String[] args) { Stri... 阅读全文
posted @ 2014-11-11 21:46 MSTK 阅读(552) 评论(0) 推荐(0)
摘要: private static final int NOTIFICATION_ID = 123;public static final int MESSAGE_FAILED_NOTIFICATION_ID = 789;public static final int DOWNLOAD_FAILED_NO... 阅读全文
posted @ 2014-10-29 22:32 MSTK 阅读(558) 评论(0) 推荐(0)
摘要: 客户端连接上服务器并登录以后,可以发送、接收消息。首先需要定义Chat,MessageListener和ChatMessageListener几个变量: private static Chat chat; private static MessageListener ml = new M... 阅读全文
posted @ 2014-09-03 15:31 MSTK 阅读(575) 评论(0) 推荐(0)
摘要: 1. 定义一个MouseListener;2. 在mouseListener中增加mouseClicked事件;3. 由MouseEvent的getSource()获得List对象;4. 由List的getSelectedIndex()事件获得点击项的Index;5. 根据Index,用List的g... 阅读全文
posted @ 2014-09-03 09:37 MSTK 阅读(1280) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 12 13 14 下一页