- 浏览: 224131 次
- 性别:
- 来自: 回龙观
最新评论
-
Java路:
“
q Object execute(Hib ...
使用HbernateTemplate -
hedy1986:
Calendar.getInstance().getTimeI ...
HashMap遍历的两种方式 -
javaAlpha:
刚才遇到个类似存放值的问题。就是一个key对应多个value的 ...
HashMap遍历的两种方式 -
borball:
从HashMap里面取出key对应的value应该没啥开销,所 ...
HashMap遍历的两种方式 -
dearhwj:
楼主整理的不错,我也整理了一个http://hi.baidu. ...
Java.util.Collections类包的学习
文章列表
1.安装JDK时,JDK和JRE要分别安装在不同的目录下,否则会出现文件覆盖及没有某些jar文件的问题(比如说tools.jar),且文件夹名最好取默认的文件夹名,否则在MyEclipse添加JRE时会报"Target is not a JDK root. System library was not found"错误
2.安装JDK1.5时,环境变量配置如下:
JAVA_HOME:G:\Java\jdk
CLASSPATH;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jarPATH:%JAVA_HOME%\bin
方法一:
for(int i = 0; i < loopSize; i++){
执行语句
for(int j = 0; j < loopSize; j++){
执行语句
if(满足退出条件){
break;
}
}
if(满足退出条件){
break;
}
}
方法二:
loop:
for (int i = 0; i < 6; i++) {
for (int j = 0; j < 7; j++) {
System.out.print ...
String value = java.util.ResourceBundle.getBundle("mybuild").getString("build.number");
其中:
mybuild为属性文件名,如mybuild.properties
build.number为键值
SQLSERVER驱动连接异常问题
- 博客分类:
- java基础学习
SQLServer驱动:
JDK1.5时,用sqljdbc.jar包
JDK1.6时,用sqljdbc4.jar包
具体参看文章:http://developer.51cto.com/art/200907/137813.htm
Oracle驱动:
ojdbc14.jar 与 classes12.jar
驱动包classes12.jar用于JDK 1.2和JDK 1.3,而ojdbc14.jar用于JDK 1.4及以上,所以尽量不要使用classes12.jar;
针对不同的数据库版本选择相应版本的驱动包;
一般连接连接数据库时报“java.lang.UnsupportedClassVer ...
在实际开发中遇到jstl换行问题,贴出来共享!!!
一.3列换行
<c:forEach var="i" begin="0" end="${size}" step="3">
<tr align="center" bgcolor="#FFFFFF">
<c:forEach var="product" items="${Product}" begin="${i}" end="${ ...
- 2009-06-09 15:58
- 浏览 4545
- 评论(0)
一.servlet构造出的AJAX返回的XML文件:
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
request.setCharacterEncoding("UTF-8");
response.setContentType("text/xml; charset=UTF-8");
response.setHeader("Cac ...
- 2009-01-08 09:42
- 浏览 2779
- 评论(0)
一:无返回值的存储过程
存储过程为:
CREATE OR REPLACE PROCEDURE TESTA(PARA1 IN VARCHAR2,PARA2 IN VARCHAR2) AS
BEGIN
INSERT INTO HYQ.B_ID (I_ID,I_NAME) VALUES (PARA1, PARA2);
END TESTA;
调用方法为:
CallableStatement proc = null;
proc = conn.prepareCall("{ call HYQ.TESTA(?,?) }");
proc.setString(1, "10 ...
- 2009-01-06 16:08
- 浏览 3327
- 评论(0)
public boolean isExistRunRota(String rotaid) {
log.debug("find isExistRunRota in RunDuty: ");
boolean isExist=false;
try {
String queryString = "select count(*) from RunDuty as model where model.rotaid=?";
if(((Long)getHibernateTemplate().find(queryString,rotaid).listI ...
- 2008-12-30 09:58
- 浏览 2274
- 评论(0)
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import = "javax.naming.*"%>
<%@ page import = "javax.sql.*" %>
<%@ page import = "java.sql.*" %>
<%@ page import = "java.util.*" %>
<%@ page import = "jav ...
- 2008-12-02 11:38
- 浏览 2817
- 评论(0)
方法1:直接用ORACLE方言函数进行比较
//综合查询
public List getOpeRecsByCon1(HttpServletRequest request){
log.debug("finding OpeRecords instances by Condition");
try {
String factoryId = "";
String spciltyId = "";
String dutyId = "";
String classId ...
- 2008-11-12 13:51
- 浏览 1857
- 评论(0)
package org.idcn.jse;
public class SortAll {
/**
* 冒泡排序,选择排序,插入排序,希尔(Shell)排序 Java的实现
* 2008.11.09
* @author YangL. (http://www.idcn.org)
*/
public static void main(String[] args) {
int[] i = { 1, 5, 6, 12, 4, 9, 3, 23, 39, 403, 596, 87 };
System.out.println("----冒泡 ...
- 2008-11-10 13:57
- 浏览 2224
- 评论(0)
应用场景:当需构造根据部门ID构造从此部门一直到最顶层部门的字符串时,如:XXX股份有限公司->XXX热电厂->运行分场->一厂->一厂运行三值->一厂汽机三班,此时传入此方法的是"一厂汽机三班"对应的DEPID,则返回此构造好的字符串,不过得保证最顶级部门的PID为NULL或为"".
public String findFullPathDepNameByDepid(String depid) {
log.debug("finding SysDepartment fullPathDepName by pr ...
- 2008-11-10 11:17
- 浏览 1441
- 评论(0)
1.迭代List(hql组装出来的对象)
hql:
String hql = "select (select b.rotaname from RunRota b where b.rotaid=a.rotaid),a.classid,a.classname from RunClass a where a.rotaid in "
+" (select c.rotaid from PlanRota c where "
+" c.startdate = (select max(b.startdate) from PlanRota b wher ...
- 2008-11-06 14:07
- 浏览 5970
- 评论(0)
使文本框内的文字居中:
style="text-align: center"
强制设置下拉列表框长度:
<select name="selectObj" title="selectObj" style="width:250px">
</select>
设置表格行当鼠标移入时变色,移出行时恢复:
<TR bgcolor="#ffffff"
onMouseOver="this.style.backgroundColor='#fee5ca'"
onMou ...
- 2008-11-03 17:23
- 浏览 1805
- 评论(0)
Action:
List allNodesList = sysDepartmentService.findbySql(sql,"ht.sys.model.SysDepartment");
Service:
public List findbySql(String sql,String classname){
return theDAO.findbySql(sql,classname);
}
Dao:
/**
* 执行sql查询
* @param sql
* @return
*/
public List findb ...
- 2008-10-23 15:46
- 浏览 3556
- 评论(0)