X
xiaotianwangzi
Unregistered / Unconfirmed
GUEST, unregistred user!
数据库中凡是用formatToMoney插入的都是numberic类型。
<%@page contentType="text/html;charset=gb2312"%>
<%@page language="java" import="java.sql.*" %>
<%@page import="java.util.*" %>
<%@page import="java.text.*" %>
<jsp:useBean id="hyg" scope="page" class="hyg.faq" />
<jsp:useBean id="money" scope="page" class="hyg.FormatMoney" />
<HTML>
<HEAD><font size=6 align="center"><h1 align="center">职工工资设定</h1></font>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;
charset=GB2312">
</head>
<body bgcolor="#ccccff" width="40%">
<%!
public String getStr(String str)
{
try
{ String temp_p=str;
byte[] tmpbyte;
tmpbyte=temp_p.getBytes("ISO8859_1");
temp_p=new String(tmpbyte);
return temp_p;
}
catch(Exception e)
{
e.printStackTrace();
}
return "null";
}
%>
<%
int flag=0;
String bmbh=new String();
String bmmc=new String();
String xh=new String();
String zgbh=new String();
String zgxm=new String();
String zbsj=new String();
String zbnf=new String();
String zbyf=new String();
String gwlb=new String();
String zgjt=new String();
String zgyb=new String();
String sbjj=new String();
String yljj=new String();
String yhjb=new String();
String sfje=new String();
String yfje=new String();
String sql=new String();
java.text.SimpleDateFormat SDateFormater = new java.text.SimpleDateFormat("yyyy-MM-dd");
java.util.Date d = new java.util.Date();
DateFormat defaultFormat = DateFormat.getDateTimeInstance();
DateFormat shortFormat = DateFormat.getDateTimeInstance (DateFormat.SHORT,DateFormat.SHORT);
DateFormat mediumFormat = DateFormat.getDateTimeInstance(DateFormat.MEDIUM,DateFormat.MEDIUM);
DateFormat longFormat = DateFormat.getDateTimeInstance(DateFormat.LONG,DateFormat.LONG);
DateFormat fullFormat = DateFormat.getDateTimeInstance(DateFormat.FULL,DateFormat.FULL);
String defaultDate = defaultFormat.format(d);
String shortDate = shortFormat.format(d);
String mediumDate = mediumFormat.format(d);
String longDate = longFormat.format(d);
String fullDate = fullFormat.format(d);
bmbh=request.getParameter("bmbh");
bmmc=request.getParameter("bmmc");
xh=request.getParameter("xh");
zgbh=request.getParameter("zgbh");
zgxm=request.getParameter("zgxm");
zbsj=request.getParameter("zbsj");
zbnf=request.getParameter("zbnf");
zbyf=request.getParameter("zbyf");
gwlb=request.getParameter("gwlb");
zgjt=request.getParameter("zgjt");
zgyb=request.getParameter("zgyb");
sbjj=request.getParameter("sbjj");
yljj=request.getParameter("yljj");
yhjb=request.getParameter("yhjb");
sfje=request.getParameter("sfje");
yfje=request.getParameter("yfje");
do
uble zgjt1 =do
uble.parseDouble(zgjt);
do
uble zgyb1 =do
uble.parseDouble(zgyb);
do
uble sbjj1 =do
uble.parseDouble(sbjj);
do
uble yljj1 =do
uble.parseDouble(yljj);
do
uble yhjb1 =do
uble.parseDouble(yhjb);
do
uble sfje1 =do
uble.parseDouble(sfje);
do
uble yfje1 =do
uble.parseDouble(yfje);
String sql2=new String();
%><%
if((bmbh.length()!=0)&&(xh.length()!=0)){
sql2="insert into rs_ygzls(bmbh,bmmc,xh,zgbh,xm,zbsj,zbnf,zbyf,gwlb,ryjt,zgyb,sbjj,yljj,jb,sfje,yfje)values('"+bmbh+"','"+bmmc+"','"+xh+"','"+zgbh+"','"+zgxm+"','"+zbsj+"','"+zbnf+"','"+zbyf+"','"+gwlb+"','"+money.formatToMoney(zgjt)+"','"+money.formatToMoney(zgyb1)+"','"+money.formatToMoney(sbjj1)+"','"+money.formatToMoney(yljj1)+"','"+money.formatToMoney(yhjb1)+"','"+money.formatToMoney(sfje1)+"','"+money.formatToMoney(yfje1)+"')";
//sql="update cd_user_info set user_password='"+mi1+"'where user_password='"+mima+"'and user_name='"+xingm1+"'";
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
Connection conn=DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;User=sa;Password=rj;DatabaseName=mjgl001");
Statement stmt=conn.createStatement();
stmt.executeUpdate(sql2);
// ResultSet rs=hhh.executeQuery(sql);
%><div align="center">
<h3><font align="center">你好,工资设置成功</font></h3>
<br>
<br><a href="jxglxt.html">返回首页</a>
</div>
<%
}
else
{
%>
<div align="center">
<h3><font align="center">对不起,请检查输入项,请重新输入。</font></h3>
<br>
<font align="center"><a href="mmxg1.jsp">返回</a></font>
</div>
<%
}
%>
</body>
</html>
报错如下:
java.lang.NumberFormatException: ?÷??
at java.lang.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1213)
at java.lang.Double.parseDouble(Double.java:201)
at org.apache.jsp.gzsz$jsp._jspService(gzsz$jsp.java:209)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.authen
ticator.Authen
ticatorBase.invoke(Authen
ticatorBase.java:475)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
at java.lang.Thread.run(Thread.java:536)
<%@page contentType="text/html;charset=gb2312"%>
<%@page language="java" import="java.sql.*" %>
<%@page import="java.util.*" %>
<%@page import="java.text.*" %>
<jsp:useBean id="hyg" scope="page" class="hyg.faq" />
<jsp:useBean id="money" scope="page" class="hyg.FormatMoney" />
<HTML>
<HEAD><font size=6 align="center"><h1 align="center">职工工资设定</h1></font>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;
charset=GB2312">
</head>
<body bgcolor="#ccccff" width="40%">
<%!
public String getStr(String str)
{
try
{ String temp_p=str;
byte[] tmpbyte;
tmpbyte=temp_p.getBytes("ISO8859_1");
temp_p=new String(tmpbyte);
return temp_p;
}
catch(Exception e)
{
e.printStackTrace();
}
return "null";
}
%>
<%
int flag=0;
String bmbh=new String();
String bmmc=new String();
String xh=new String();
String zgbh=new String();
String zgxm=new String();
String zbsj=new String();
String zbnf=new String();
String zbyf=new String();
String gwlb=new String();
String zgjt=new String();
String zgyb=new String();
String sbjj=new String();
String yljj=new String();
String yhjb=new String();
String sfje=new String();
String yfje=new String();
String sql=new String();
java.text.SimpleDateFormat SDateFormater = new java.text.SimpleDateFormat("yyyy-MM-dd");
java.util.Date d = new java.util.Date();
DateFormat defaultFormat = DateFormat.getDateTimeInstance();
DateFormat shortFormat = DateFormat.getDateTimeInstance (DateFormat.SHORT,DateFormat.SHORT);
DateFormat mediumFormat = DateFormat.getDateTimeInstance(DateFormat.MEDIUM,DateFormat.MEDIUM);
DateFormat longFormat = DateFormat.getDateTimeInstance(DateFormat.LONG,DateFormat.LONG);
DateFormat fullFormat = DateFormat.getDateTimeInstance(DateFormat.FULL,DateFormat.FULL);
String defaultDate = defaultFormat.format(d);
String shortDate = shortFormat.format(d);
String mediumDate = mediumFormat.format(d);
String longDate = longFormat.format(d);
String fullDate = fullFormat.format(d);
bmbh=request.getParameter("bmbh");
bmmc=request.getParameter("bmmc");
xh=request.getParameter("xh");
zgbh=request.getParameter("zgbh");
zgxm=request.getParameter("zgxm");
zbsj=request.getParameter("zbsj");
zbnf=request.getParameter("zbnf");
zbyf=request.getParameter("zbyf");
gwlb=request.getParameter("gwlb");
zgjt=request.getParameter("zgjt");
zgyb=request.getParameter("zgyb");
sbjj=request.getParameter("sbjj");
yljj=request.getParameter("yljj");
yhjb=request.getParameter("yhjb");
sfje=request.getParameter("sfje");
yfje=request.getParameter("yfje");
do
uble zgjt1 =do
uble.parseDouble(zgjt);
do
uble zgyb1 =do
uble.parseDouble(zgyb);
do
uble sbjj1 =do
uble.parseDouble(sbjj);
do
uble yljj1 =do
uble.parseDouble(yljj);
do
uble yhjb1 =do
uble.parseDouble(yhjb);
do
uble sfje1 =do
uble.parseDouble(sfje);
do
uble yfje1 =do
uble.parseDouble(yfje);
String sql2=new String();
%><%
if((bmbh.length()!=0)&&(xh.length()!=0)){
sql2="insert into rs_ygzls(bmbh,bmmc,xh,zgbh,xm,zbsj,zbnf,zbyf,gwlb,ryjt,zgyb,sbjj,yljj,jb,sfje,yfje)values('"+bmbh+"','"+bmmc+"','"+xh+"','"+zgbh+"','"+zgxm+"','"+zbsj+"','"+zbnf+"','"+zbyf+"','"+gwlb+"','"+money.formatToMoney(zgjt)+"','"+money.formatToMoney(zgyb1)+"','"+money.formatToMoney(sbjj1)+"','"+money.formatToMoney(yljj1)+"','"+money.formatToMoney(yhjb1)+"','"+money.formatToMoney(sfje1)+"','"+money.formatToMoney(yfje1)+"')";
//sql="update cd_user_info set user_password='"+mi1+"'where user_password='"+mima+"'and user_name='"+xingm1+"'";
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
Connection conn=DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;User=sa;Password=rj;DatabaseName=mjgl001");
Statement stmt=conn.createStatement();
stmt.executeUpdate(sql2);
// ResultSet rs=hhh.executeQuery(sql);
%><div align="center">
<h3><font align="center">你好,工资设置成功</font></h3>
<br>
<br><a href="jxglxt.html">返回首页</a>
</div>
<%
}
else
{
%>
<div align="center">
<h3><font align="center">对不起,请检查输入项,请重新输入。</font></h3>
<br>
<font align="center"><a href="mmxg1.jsp">返回</a></font>
</div>
<%
}
%>
</body>
</html>
报错如下:
java.lang.NumberFormatException: ?÷??
at java.lang.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1213)
at java.lang.Double.parseDouble(Double.java:201)
at org.apache.jsp.gzsz$jsp._jspService(gzsz$jsp.java:209)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.authen
ticator.Authen
ticatorBase.invoke(Authen
ticatorBase.java:475)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
at java.lang.Thread.run(Thread.java:536)