ITeye博客

sunxuecheng的博客

sunxuecheng · 共 35 篇文章

nio FileChannel

// Buffer 常见方法: // flip(): 写模式转换成读模式 // rewind() :将 position 重置为 0 ,一般用于重复读。 // clear() :清空 buffer ,准备再次被写入 (position 变成 0 , limit 变成 capacity) 。 // compact(): 将未读取的数据拷贝到 buffer 的头部位。 // mark() 、 reset():mark 可以标记一个位置, reset 可以重置到该位置。 // Buffer 常见类型: ByteBuffer 、 MappedByteBuffer 、 CharBuffer 、 Dou…

2011-10-13 15:46 · nio FileChannel · 评论(0)

简单阻塞队列实现2

package com.security.dpi.das.fileprocess; import java.util.LinkedList; import java.util.Queue; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; //简单阻塞队列实现2 public class SimpleBlockingQ { public SimpleBlockingQ() { …

2011-10-12 12:07 · 简单阻塞队列实现2 · 评论(0)

http://zhang-xzhi-xjtu.iteye.com/category/133743

http://zhang-xzhi-xjtu.iteye.com/category/133743

2011-10-10 09:21 · http://zhang-xzhi-xjtu.iteye.com/category/133743 · 评论(0)

oracle sql2

9 查锁 select l.session_id sid,l.locked_mode lockmode,l.oracle_username db_user,l.os_user_name os_user,s.machine,s.schemaname,o.object_name tablename,q.sql_text from v$locked_object l, v$session s, v$sql q, all_objects o where l.session_id = s.sid and s.type = 'USER' and s.sql_address = q.address and…

2011-09-23 15:17 · oracle sql2 · 评论(0)

oracle sql1

su - oracle sqlplus / as sysdba shutdown immediate; // 启动数据库 startup nomount; alter database mount; alter database open; // 查询表空间文件 select file_name,tablespace_name,bytes/(1024*1024) from dba_data_files where tablespace_name = 'TBS_DATA_SIG_USER_RPT1'; // 查询每一个表空间的大小和使用 select a.tablespace_name as …

2011-09-23 15:17 · oracle sql1 · 评论(0)

iputil3

/** * ��������Ƿ�Ϊһ��Ϸ���IP��ַ �±����ֶ��������ַ����������IP�û� 0.* 127.* 255.255.255.255 * 224.*���ϵģ������鲥�����ַ��Ҳ��������IP�û��� * �ۺ�һï…

2011-09-23 14:08 · iputil3 · 评论(0)

iputil2

/** * excludeAType=true ���Թ���A���127��ͷ��IP��ַ�����ⵥ��A06D18683 * @param strIp * @param excludeAType * @return */ public static long ipToLong(String strIp, boolean excludeAType) { if (!ipValid(strIp, excludeAType)) { return 0; } int result = 0; try…

2011-09-23 14:06 · iputil2 · 评论(0)

iputil1

package com.security.dpi.util; import java.net.InetAddress; import java.net.UnknownHostException; import java.nio.ByteBuffer; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; imp…

2011-09-23 14:06 · iputil1 · 评论(0)

sql上报数据6

/** * @return the sqlLoadDirectory */ public String getSqlLoadDirectory() { return sqlLoadDirectory; } /** * @return the passwd */ public String getPasswd() { return passwd; } /** * @return the uName */ public String getUName() { return uName; } /** * @return the needDelLogFile */ public static boo…

2011-09-23 14:03 · sql上报数据6 · 评论(0)

sql上报数据5

/** * 把sqlLoad失败的日志写到DAS日志文件中 * @param logFileName */ private void readSqlLoadErrLog(String logFileName) { BufferedReader reader = null; try { reader = new BufferedReader(new FileReader(new File(logFileName))); StringBuffer logStrBuff = new StringBuffer(); String logStr; while ((logStr = reader.rea…

2011-09-23 14:03 · sql上报数据5 · 评论(0)

sql上报数据4

/** * 获取文件头 * * @param path * @param tabName * @return 返回文件头信息 * @throws IOException */ public String getColumn(String path) throws IOException { BufferedReader brFile = null; File file = null; String line = null; try { file = new File(path); brFile = new BufferedReader(new InputStreamReader( new F…

2011-09-23 14:02 · sql上报数据4 · 评论(0)

sql上报数据3

private boolean ociSqlldr(String path, AbstractSqlLoad sqlload) { // 定义处理状态 boolean result = false; try { sqlload.setDirectoryFile(getSqlLoadDirectory(), fileName, getColumn(path)); // 设置用户名、密码、主机IP等参数 sqlload.setUseId(uName, passwd, getOraNetServerName()); // SQLLOAD 加载 result = sqlload.preform();…

2011-09-23 14:02 · sql上报数据3 · 评论(0)

sql上报数据2

/** * 初始化入库文件的数据库相关信息 * @param fileName * @param dbInfo */ public SqlLoad(String fileName, DBInfo dbInfo, String loadDirectory) { this.fileName = fileName; // 配置数据库相关信息 dbType = dbInfo.getDbType(); host = DasUtil.longToIP(dbInfo.getIp()); db = dbInfo.getSchema(); uName = dbInfo.getUserName(); passw…

2011-09-23 14:01 · sql上报数据2 · 评论(0)

sql上报数据1

/** * SQL LOAD 上报数据类 detailed comment @author Administrator 2008-10-16 @see @since 1.0 / public class SqlLoad implements DebugBean { / * 定义日至对象 */ private static final Log logger = LogFactory.getLog(SqlLoad.class); /** 数据库类型 */ private int dbType; /** 数据库IP */ private String host; /** 数据库名 */ priva…

2011-09-23 14:00 · sql上报数据1 · 评论(0)

sqlloader7

public boolean isTimeOut() { return isTimeOut; } public String toString() { StringBuilder sb = new StringBuilder(); for (int i = 0; i < cmdarray.length; i++) { sb.append(cmdarray*).append(" "); } return sb.toString(); } /** * @see com.security.dpi.basic.debug.DebugBean#processDebugRequest(java.util…

2011-09-23 13:55 · sqlloader7 · 评论(0)