javax.naming.NameNotFoundException javax.naming.NameNotFoundException: Name TestDB is not bound in this ContextIntentCompanyBean的insert方法运行异常:null不知道咋回事了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 总之就是在调用这个函数的时候出现了异常public boolean Insert() { boolean b = false; try { con = connBean.getConnection(); pstmt = con.prepareStatement(this.getStrSql()); pstmt.setString(1, this.getCompanyName()); pstmt.setString(2, this.getContactPhone()); pstmt.setString(3, this.getContactPerson()); pstmt.setString(4, this.getContactPhone_K()); pstmt.setString(5, this.getContactPerson_K()); pstmt.setString(6, this.getAddress()); pstmt.setString(7, this.getTalkMode()); pstmt.setString(8, this.getTalkDate()); pstmt.setInt(9, this.getEmployeeID()); pstmt.setString(10, this.getRe()); pstmt.executeUpdate(); b = true; } catch (Exception ex) { System.out.println(" IntentCompanyBean的insert方法运行异常:"+ex.getMessage()); } finally { freeMem(); } return b; } int i = pstmt.executeUpdate();if(i==1){b = true;} 看了下也只有这里和 con = connBean.getConnection();System.out.println(con);con.prepareStatement(this.getStrSql());System.out.println(this.getStrSql()));才会有空指针了,看哪个输出NULL JSONObject 的问题 使用jdbc创建触发器/存储过程/函数/视图问题 ejb中bmp里编写find方法返回的是什么? 谁知道有免费的 java写的数学库(用于曲线拟合) IIS+TOMCAT整合问题 创建DOM树的时候出现以下异常,如何解决! 关于jboss中使用log4j的问题,大哥们救救我啊! 高分寻找介绍语音聊天的资料。 EJB究竟适合我们吗? 关于Spring Data JPA 忽略大小写模糊查询问题 关于jetty netbean 导入源代码问题
public boolean Insert() {
boolean b = false;
try {
con = connBean.getConnection();
pstmt = con.prepareStatement(this.getStrSql());
pstmt.setString(1, this.getCompanyName());
pstmt.setString(2, this.getContactPhone());
pstmt.setString(3, this.getContactPerson());
pstmt.setString(4, this.getContactPhone_K());
pstmt.setString(5, this.getContactPerson_K());
pstmt.setString(6, this.getAddress());
pstmt.setString(7, this.getTalkMode());
pstmt.setString(8, this.getTalkDate());
pstmt.setInt(9, this.getEmployeeID());
pstmt.setString(10, this.getRe());
pstmt.executeUpdate();
b = true;
}
catch (Exception ex) {
System.out.println(" IntentCompanyBean的insert方法运行异常:"+ex.getMessage());
}
finally {
freeMem();
}
return b;
}
if(i==1){
b = true;
}
看了下也只有这里和
con = connBean.getConnection();
System.out.println(con);
con.prepareStatement(this.getStrSql());
System.out.println(this.getStrSql()));
才会有空指针了,看哪个输出NULL