使用poi3.7读取word文件的页数
package readword;
import java.io.FileInputStream;
import org.apache.poi.POIXMLDocument;
import org.apache.poi.hwpf.extractor.WordExtractor;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
public class Readword {
加载中…
加载中…
加载中…使用poi3.7读取word文件的页数
package readword;
import java.io.FileInputStream;
import org.apache.poi.POIXMLDocument;
import org.apache.poi.hwpf.extractor.WordExtractor;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
public class Readword {
把文件读出来,用流的方式放到response中,返回给前端。
String agent = request.getHeader('USER-AGENT');
修改了root用户的host,把localhost修改为了%,结果远程是可以访问了,本地访问却报:
mysql error 1045 (28000) access denied for user root @
没办法,修改root密码:
先在my.ini文件中加上:skip-grant-tables。
然后
update user set password = password('123456') where user='root';
flush privileges;
再把my.ini中的skip-grant-tables去掉,这是本地可以访问了,但远程又不能访问了。
把my.ini中又加上skip-grant-tables。
这时都能访问,但这样明显不可行。
问题待解决。
方法一:在mysql下查看默认空闲时间
方法二:在my.ini中设置
interactive_timeout=31536000
wait_timeout=31536000
摘自:http://livenzhao.spaces.live.com/blog/cns!6E368BE9F6DDD872!595.entry
在使用PL/SQL Developer时,为了工作方便希望PL/SQL Developer记住登录Oracle的用户名和密码;
设置方法:PL/SQL Developer 7.1.2 ->tools->Preferences->Oracle->Logon History , 'Store history'是默认勾选的,勾上'Store with password' 即可,重新登录在输入一次密码则记住了。
在使用PL/SQL Developer的SQL Window时,按F8键,PL/SQL Developer默认是执行该窗口的所有SQL语句,需要设置为鼠标所在的那条SQL语句,即执行当前SQL语句;
设置方法:PL/SQL Developer 7.1.2 -->tools->Preferences-->Window types ,勾上'AutoSelect Statement' 即可。
在使用PL/SQL Developer的SQL Window时,有时候输入的SQL语句太长或太乱,希望能用比较通用的写法格式话一下,这样看起来会好看些,也好分析;
使用方法:选中
使用P/L SQL建表时,如果使用了关键字作为字段名,如:uid,type,date等,会提示出错无效的标识符(invalid identifier)。在一些情况不得不使用关键字作为字段名时,就像一些系统升级时,从其它数据库改为oracle时,该什么办呢。经验证, 解决办法是使用双引号'如'type';
create table test(id number, 'date' date,'type' number)
select a.owner ,a.table_name ,b.column_name ,C.OWNER
,c.table_name ,d.column_name from user_constraints a
left join user_cons_columns b
on a.constraint_name=b.constraint_name
left join user_constraints C
ON C.R_CONSTRAINT_NAME=a.constraint_name
left join user_cons_columns d
on c.constraint_name=d.constraint_name
where a.constraint_type='P'
and a.table_name='STOCK' --需要查看主外键关系的表
order by a.table_name
要注意一点,表名必须要大写,小写的会查不到。
在oracle中truncate一张表时,会报unique/primary keys in table referenced by enabled foreign keys的错误,提示说存在外键约束指向本表的主键。
在网上查了下,在truncate表之前需要把存在其他表中的执行本表主键的外键约束disable掉,再truncate,然后再把这些外键enable。
如下:
alter table testorder disable constraint FK499161FCAA1018AC
alter table testorder enable
查询表关联的约束: