gnl

java 学习
随笔 - 17, 文章 - 0, 评论 - 2, 引用 - 0
数据加载中……

2013年5月19日

个人常用工具记录


一、Firefox
1、屏蔽广告插件 Adblock Plus
2、取色工具 ColorZilla
3、调试工具  Firebug
4、另一款web调试工具  Web Developer
5、网页存储为图片 Pearl Crescent
6、另一款网页切图工具 
7、火狐主页
8、火狐附加组件
9、Image-Show-Hide(待试用)


10、解压版Firefox下载
11、Firefox帮助



二、图片在线编辑工具
1、ps工具
2、ps工具



三、常用软件下载地址
1、常用软件下载网站

2、(1)gvim下载地址
    (2)gvim下载地址
    (3)gvim下载地址
    (4)gvim下载地址
   
四、网站使用工具
1、网站使用工具
2、网络知识
五、Windows 帮助使用资料
1、windows xp 帮助



??一个可以使用的帮助网站
六、求职网站记录
1、拉勾网




posted @ 2015-02-11 15:12 一江 阅读(3524) | 评论 (0)编辑 收藏

JDBC----------建立数据库连接


1、什么是JDBC
        Java 数据库连接,(Java Database Connectivity,简称JDBC)是Java语言中用来规范客户端程序如何来访问数据库的应用程序接口,提供了诸如查询和更新数据库中数据的方法。JDBC也是Sun Microsystems的商标。它JDBC是面向关系型数据库的(来源:维基百科   )。JDBC是我们通过外部程序操作数据库的一个工具。
                                                                                                                                                                                                                                               
2、编写JDBC的步骤
    (1)加载驱动
    (2)传递参数获得连接
    (3)获取数据库连接  

    我在这里用了一个properties的配置文件来(database.properties)设置我的我的配置参数

        #mysqluse
        driver=com.mysql.jdbc.Driver
        url=jdbc:mysql://127.0.0.1:3306/dotestuse
        username=root
        password=
程序代码         
  1.             import java.io.IOException;
  2.             import java.io.InputStream;
  3.             import java.sql.Connection;
  4.             import java.sql.DriverManager;
  5.             import java.sql.SQLException;
  6.             import java.util.Properties;
  7.             
  8.             public class GetConnectionT {
  9.             
  10.                 public static void main(String[] args) {
  11.             
  12.                     try {
  13.             
  14.                         //读取配置文件参数
  15.                         InputStream in = GetConnectionT.class.getClassLoader().getResourceAsStream("propert.properties");
  16.                         Properties pr = new Properties();
  17.                         pr.load(in);
  18.                         Class.forName(pr.getProperty("driver"));
  19.                         //通过驱动管理器获得数据库连接        
  20.                         Connection con = DriverManager.getConnection(pr.getProperty("url"),    pr.getProperty("username"), pr.getProperty("password"));
  21.                         System.out.println(con);
  22.                         con.close();
  23.             
  24.                     } catch (ClassNotFoundException e) {
  25.             
  26.                         System.err.println("加载驱动失败"+e.getLocalizedMessage());
  27.                     } catch (IOException e) {
  28.                         System.err.println("加载配置文件失败"+e.getLocalizedMessage());
  29.                     } catch (SQLException e) {
  30.                         System.err.println("建立数据库连接失败"+e.getLocalizedMessage());
  31.                     }
  32.                 }
  33.             }

这里只是一个简单的获得JDBC的例子,在实际工作中我们最好用单例模式来获得数据库连接

posted @ 2013-07-05 11:48 一江 阅读(266) | 评论 (0)编辑 收藏

mybatis 学习记录

在mybatis 中无法插入记录

显示信息如下:

SLF4J: This version of SLF4J requires log4j version 1.2.12 or later. See also http://www.slf4j.org/codes.html#log4j_version
0    DEBUG [main]  org.apache.ibatis.logging.LogFactory     - Logging initialized using 'class org.apache.ibatis.logging.slf4j.Slf4jImpl' adapter.
31   DEBUG [main] org.apache.ibatis.datasource.pooled.PooledDataSource     - PooledDataSource forcefully closed/removed all connections.
31   DEBUG [main] org.apache.ibatis.datasource.pooled.PooledDataSource     - PooledDataSource forcefully closed/removed all connections.
31   DEBUG [main] org.apache.ibatis.datasource.pooled.PooledDataSource     - PooledDataSource forcefully closed/removed all connections.
31   DEBUG [main] org.apache.ibatis.datasource.pooled.PooledDataSource     - PooledDataSource forcefully closed/removed all connections.
140  DEBUG [main] org.apache.ibatis.transaction.jdbc.JdbcTransaction     - Opening JDBC Connection
483  DEBUG [main] org.apache.ibatis.datasource.pooled.PooledDataSource     - Created connection 6259058.
483  DEBUG [main] com.te.mybatis.persitence.ifance.PersonDao.insertperson     - ooo Using Connection [com.mysql.jdbc.JDBC4Connection@5f8172]
483  DEBUG [main] com.te.mybatis.persitence.ifance.PersonDao.insertperson     - ==>  Preparing: insert into person(username) values('tomcat23')
530  DEBUG [main] com.te.mybatis.persitence.ifance.PersonDao.insertperson     - ==> Parameters:
530  DEBUG [main] org.apache.ibatis.transaction.jdbc.JdbcTransaction     - Rolling back JDBC Connection [com.mysql.jdbc.JDBC4Connection@5f8172]
561  DEBUG [main] org.apache.ibatis.transaction.jdbc.JdbcTransaction     - Resetting autocommit to true on JDBC Connection [com.mysql.jdbc.JDBC4Connection@5f8172]
561  DEBUG [main] org.apache.ibatis.transaction.jdbc.JdbcTransaction     - Closing JDBC Connection [com.mysql.jdbc.JDBC4Connection@5f8172]
561  DEBUG [main] org.apache.ibatis.datasource.pooled.PooledDataSource     - Returned connection 6259058 to pool.

运行插入语句始终不能成功,但是一直没有注意这个语句
530  DEBUG [main] org.apache.ibatis.transaction.jdbc.JdbcTransaction     - Rolling back JDBC Connection [com.mysql.jdbc.JDBC4Connection@5f8172]
想一想在insert里面也没有用到事务啊,不知道是什么原因?

在执行语句出添加事务提交 就可以插入成功 ,

        SqlSession sqlsesstion = sc.openSession();

        sqlsesstion.insert("insertperson", person);
        sqlsesstion.commit();  //还不知道是什么原因要提交事务才可以插入数据成功,但是每一次似乎都对数据库产生了影响
        sqlsesstion.close();



有一点乱 !!!





posted @ 2013-07-04 12:10 一江 阅读(3092) | 评论 (1)编辑 收藏

火狐浏览器使用记录

1、配置多个用户
    在火狐关闭的的情况下 在命令行窗口 输入firefox -p  调出 配置文件管理项 详细操作参考 管理用户配置文件

2、设置可以启动多个账户
     打开自己的firefox 启动快捷键=》目标。在目标里面加上配置文件即可 如  D:\officeprograme\internettool\Firefox\firefox.exe --no-remote -p usephp      --no-remote -p usephp 指定用户配置 参考  火狐常见启动参数介绍



     



posted @ 2013-05-20 22:53 一江 阅读(207) | 评论 (0)编辑 收藏

ibatis 中使用select 查询 数据库中存在查询项是null 是报错

在使用ibatis 进行查询数据库是报错
错误如下:

查询失败  
--- The error occurred in com/sqlmap/person.xml.  
--- The error occurred while applying a result map.  
--- Check the lisper-AutoResultMap.  
--- The error happened while setting a property on the result object.  
--- Cause: com.ibatis.common.exception.NestedRuntimeException: Error setting properties of '230kims                00'.  Cause: java.lang.IllegalArgumentException
Caused by: java.lang.IllegalArgumentException
com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred in com/sqlmap/person.xml.  
--- The error occurred while applying a result map.  
--- Check the lisper-AutoResultMap.  
--- The error happened while setting a property on the result object.  
--- Cause: com.ibatis.common.exception.NestedRuntimeException: Error setting properties of '230kims                00'.  Cause: java.lang.IllegalArgumentException
Caused by: java.lang.IllegalArgumentException
Caused by: com.ibatis.common.exception.NestedRuntimeException: Error setting properties of '230kims                00'.  Cause: java.lang.IllegalArgumentException
Caused by: java.lang.IllegalArgumentException
    at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:188)
    at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList(GeneralStatement.java:123)
    at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:610)
    at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:584)
    at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:101)
    at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:78)
    at com.bean.persondaoim.PersonDaoIm.lsper(PersonDaoIm.java:43)
    at com.bean.persondaoim.PersonDaoIm.main(PersonDaoIm.java:67)
Caused by: com.ibatis.common.exception.NestedRuntimeException: Error setting properties of '230kims                00'.  Cause: java.lang.IllegalArgumentException
Caused by: java.lang.IllegalArgumentException
    at com.ibatis.sqlmap.engine.accessplan.PropertyAccessPlan.setProperties(PropertyAccessPlan.java:51)
    at com.ibatis.sqlmap.engine.exchange.JavaBeanDataExchange.setData(JavaBeanDataExchange.java:112)
    at com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.setResultObjectValues(BasicResultMap.java:333)
    at com.ibatis.sqlmap.engine.mapping.statement.RowHandlerCallback.handleResultObject(RowHandlerCallback.java:63)
    at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor.java:391)
    at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:184)
    at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery(GeneralStatement.java:205)
    at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:173)
    ... 7 more
Caused by: java.lang.IllegalArgumentException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.ibatis.sqlmap.engine.accessplan.PropertyAccessPlan.setProperties(PropertyAccessPlan.java:45)
    ... 14 more

Caused by:
com.ibatis.common.exception.NestedRuntimeException: Error setting properties of '230kims                00'.  Cause: java.lang.IllegalArgumentException
Caused by: java.lang.IllegalArgumentException
    at com.ibatis.sqlmap.engine.accessplan.PropertyAccessPlan.setProperties(PropertyAccessPlan.java:51)
    at com.ibatis.sqlmap.engine.exchange.JavaBeanDataExchange.setData(JavaBeanDataExchange.java:112)
    at com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.setResultObjectValues(BasicResultMap.java:333)
    at com.ibatis.sqlmap.engine.mapping.statement.RowHandlerCallback.handleResultObject(RowHandlerCallback.java:63)
    at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor.java:391)
    at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:184)
    at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery(GeneralStatement.java:205)
    at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:173)
    at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList(GeneralStatement.java:123)
    at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:610)
    at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:584)
    at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:101)
    at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:78)
    at com.bean.persondaoim.PersonDaoIm.lsper(PersonDaoIm.java:43)
    at com.bean.persondaoim.PersonDaoIm.main(PersonDaoIm.java:67)
Caused by: java.lang.IllegalArgumentException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.ibatis.sqlmap.engine.accessplan.PropertyAccessPlan.setProperties(PropertyAccessPlan.java:45)
    ... 14 more

Caused by:
java.lang.IllegalArgumentException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.ibatis.sqlmap.engine.accessplan.PropertyAccessPlan.setProperties(PropertyAccessPlan.java:45)
    at com.ibatis.sqlmap.engine.exchange.JavaBeanDataExchange.setData(JavaBeanDataExchange.java:112)
    at com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.setResultObjectValues(BasicResultMap.java:333)
    at com.ibatis.sqlmap.engine.mapping.statement.RowHandlerCallback.handleResultObject(RowHandlerCallback.java:63)
    at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor.java:391)
    at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:184)
    at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery(GeneralStatement.java:205)
    at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:173)
    at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList(GeneralStatement.java:123)
    at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:610)
    at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:584)
    at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:101)
    at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:78)
    at com.bean.persondaoim.PersonDaoIm.lsper(PersonDaoIm.java:43)
    at com.bean.persondaoim.PersonDaoIm.main(PersonDaoIm.java:67)

Caused by:
com.ibatis.common.exception.NestedRuntimeException: Error setting properties of '230kims                00'.  Cause: java.lang.IllegalArgumentException
Caused by: java.lang.IllegalArgumentException
    at com.ibatis.sqlmap.engine.accessplan.PropertyAccessPlan.setProperties(PropertyAccessPlan.java:51)
    at com.ibatis.sqlmap.engine.exchange.JavaBeanDataExchange.setData(JavaBeanDataExchange.java:112)
    at com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.setResultObjectValues(BasicResultMap.java:333)
    at com.ibatis.sqlmap.engine.mapping.statement.RowHandlerCallback.handleResultObject(RowHandlerCallback.java:63)
    at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor.java:391)
    at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:184)
    at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery(GeneralStatement.java:205)
    at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:173)
    at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList(GeneralStatement.java:123)
    at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:610)
    at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:584)
    at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:101)
    at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:78)
    at com.bean.persondaoim.PersonDaoIm.lsper(PersonDaoIm.java:43)
    at com.bean.persondaoim.PersonDaoIm.main(PersonDaoIm.java:67)
Caused by: java.lang.IllegalArgumentException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.ibatis.sqlmap.engine.accessplan.PropertyAccessPlan.setProperties(PropertyAccessPlan.java:45)
    ... 14 more

Caused by:
java.lang.IllegalArgumentException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.ibatis.sqlmap.engine.accessplan.PropertyAccessPlan.setProperties(PropertyAccessPlan.java:45)
    at com.ibatis.sqlmap.engine.exchange.JavaBeanDataExchange.setData(JavaBeanDataExchange.java:112)
    at com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.setResultObjectValues(BasicResultMap.java:333)
    at com.ibatis.sqlmap.engine.mapping.statement.RowHandlerCallback.handleResultObject(RowHandlerCallback.java:63)
    at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor.java:391)
    at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:184)
    at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery(GeneralStatement.java:205)
    at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:173)
    at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList(GeneralStatement.java:123)
    at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:610)
    at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:584)
    at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:101)
    at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:78)
    at com.bean.persondaoim.PersonDaoIm.lsper(PersonDaoIm.java:43)
    at com.bean.persondaoim.PersonDaoIm.main(PersonDaoIm.java:67)

Caused by:
java.lang.IllegalArgumentException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.ibatis.sqlmap.engine.accessplan.PropertyAccessPlan.setProperties(PropertyAccessPlan.java:45)
    at com.ibatis.sqlmap.engine.exchange.JavaBeanDataExchange.setData(JavaBeanDataExchange.java:112)
    at com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.setResultObjectValues(BasicResultMap.java:333)
    at com.ibatis.sqlmap.engine.mapping.statement.RowHandlerCallback.handleResultObject(RowHandlerCallback.java:63)
    at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor.java:391)
    at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:184)
    at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery(GeneralStatement.java:205)
    at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:173)
    at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList(GeneralStatement.java:123)
    at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:610)
    at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:584)
    at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:101)
    at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:78)
    at com.bean.persondaoim.PersonDaoIm.lsper(PersonDaoIm.java:43)
    at com.bean.persondaoim.PersonDaoIm.main(PersonDaoIm.java:67)
Exception in thread "main" java.lang.NullPointerException
    at com.bean.persondaoim.PersonDaoIm.main(PersonDaoIm.java:70)


posted @ 2013-05-19 21:31 一江 阅读(619) | 评论 (1)编辑 收藏