Parameter index out of range 谢谢! [问题点数:0分,结帖人huxiweng]

Bbs1
本版专家分:13
结帖率 100%
Bbs1
本版专家分:8
Bbs1
本版专家分:0
Bbs1
本版专家分:44
Bbs1
本版专家分:74
Bbs1
本版专家分:0
Bbs1
本版专家分:77
Bbs1
本版专家分:0
Bits index out of range
对 Delphi 5 ClientDataSet, Edit操作, Post时报错 Bits <em>index</em> <em>out</em> of <em>range</em>, insert时正常, 不知是何原因?
index Out of Range "">"DBGrid index Out of Range "
Query1->DisableControl();rnfor(int i=0; iAppend();rn Query1->FiledByName("f1")->Value="sss";rn Query1->FiledByName("f2")->Value="sss1";rn Query1->Post();rnrnQuery1->EnableControl();rnrn为什么加上 :rnQuery1->DisableControl();rnQuery1->EnableControl();rn时有时候会出现"DBGrid <em>index</em> Out of Range " 错误!rn
grid index out of range
beginrn dmData.adoQCode.open;rn dmData.adoQCode.Append;rn dmData.adoQCode.FieldByName('Type').AsString := cbbType.Text;rn dmData.adoQCode.FieldByName('Value').AsString := edtValue.Text;rn dmData.adoQCode.FieldByName('Mem').AsString := edtMem.Text;rn dmdata.adoQCode.Post;rn end;rn我用的是DBgrid和Access库,在添加一条记录时报出grid <em>index</em> <em>out</em> of <em>range</em> 的错误,请各位知道的加以指点
index out of range exception??
<em>index</em> <em>out</em> of <em>range</em> exception??rnrn[color=#FF0000]error code:rnrn if (!Convert.IsDBNull(reader["Name"]))rn username = reader["Name"].ToString();[/color]rnrnrn2. source code:rnrn public bool LoginUser(string username,string pwd)rn rn rn bool exists = false;rn SqlParameter[] parms = new SqlParameter[2];rn parms[0] = new SqlParameter("@name", SqlDbType.NVarChar, 100);rn parms[1] = new SqlParameter("@password", SqlDbType.NVarChar, 100);rn parms[0].Value = username;rn parms[1].Value = pwd;rn SqlDataReader reader = DbTools.ExecuteReader("LoginUserProce", parms);rnrn if (reader.Read())rn rn[color=#339966] exists = true;rn if (!Convert.IsDBNull(reader.GetValue(2)))[/color]???????????????rn username = reader.GetValue(2).ToString();rn if (!Convert.IsDBNull(reader["password"]))rn pwd = reader["password"].ToString();rn rn rn reader.Close();rn return exists;rnrn rnrnrn
Parameter index out of range (1 > number of parameters, which is 0).求解
package com.asiasoft.studentsmanager; import java.util.ArrayList; import java.io.BufferedReader; im
Parameter index out of range (1 > number of parameters, which is 0)
今天在写模糊分页查询的时候报错如下: Caused by: java.sql.SQLException: Parameter <em>index</em> <em>out</em> of <em>range</em> (1 &amp;gt; number of <em>parameter</em>s, which is 0). at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:959) at com.m...
index out of range"">QList::at: "index out of range"
出错:ASSERT failure in QList&lt;T&gt;::at: "<em>index</em> <em>out</em> of <em>range</em>", file E:\qt\Qt5.10\5.10.0\mingw53_3...
java.sql.SQLException: Parameter index out of range (3 > number of parameters, which is 2).
java.sql.SQLException: Parameter <em>index</em> <em>out</em> of <em>range</em> (3 &amp;gt; number of <em>parameter</em>s, which is 2).java.sql.SQLException: Parameter <em>index</em> <em>out</em> of <em>range</em> (3 &amp;gt; number of <em>parameter</em>s, which is 2). at com.mysq...
java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).
rnjava.sql.SQLException: Parameter <em>index</em> <em>out</em> of <em>range</em> (1 > number of <em>parameter</em>s, which is 0).rn at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910)rn at com.mysql.jdbc.PreparedStatement.setInternal(PreparedStatement.java:2715)rn at com.mysql.jdbc.PreparedStatement.setString(PreparedStatement.java:3546)rn at com.achievo.test.team.Connection.ConnectionDB.insert(ConnectionDB.java:170)rn at com.achievo.test.team.DAO.FileDAO.insert(FileDAO.java:111)rn at com.achievo.test.team.po.imp.FilePOImpl.insert(FilePOImpl.java:21)rn at com.achievo.test.team.bo.imp.FileBOImpl.insert(FileBOImpl.java:21)rn at com.achievo.test.team.ui.action.ResourceUploadAction.execute(ResourceUploadAction.java:96)rn at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)rn at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)rn at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)rn at com.achievo.test.team.commom.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:39)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)rn at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)rn at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)rn at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)rn at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)rn at java.lang.Thread.run(Thread.java:595)谁能帮我看下有错在哪里啊?rnConnectionDB.javarnrn public int insert(String sql ,String fileID,String typeID)rn int INSERT_RESULT=0;rn con = getConnection();rn ps = con.prepareStatement(sql); rn ps.setString(1, fileID); rn ps.setString(2, typeID);rn INSERT_RESULT = ps.executeUpdate(); rn return INSERT_RESULT;rn rnrnThe insert() was been used by this:rnfileDAO.javarnrnpublic boolean insert(FileInformation fileInformation) rn ConnectionDB connectionDB;rn int INSERT_RESULT_RETURN ,INSERT_FILE_TYPE_RETURN= 0;rn List items = new ArrayList();rn items.add(fileInformation.getFileName());rn items.add(fileInformation.getFileDescription());rn items.add(fileInformation.getFileSize());rn connectionDB = new ConnectionDB();rn try rn INSERT_RESULT_RETURN = connectionDB.insert(FILE_INFO_ADD, items);rn if (INSERT_RESULT_RETURN > 0) rn rn String fileID = selectFileID(fileInformation);rn String typeID = selectTypeID(fileInformation);rn INSERT_FILE_TYPE_RETURN=connectionDB.insert(FILE_TYPE_ADD, fileID,typeID);rn if ( INSERT_FILE_TYPE_RETURN> 0) rn this.isRSTure = true;rn rnrn rn catch (Exception e) rn e.printStackTrace();rn rnrn connectionDB.close();rn return isRSTure;rn rnrnrn
Specified argument was out of the range of valid values. Parameter name: index
/*采用动态添加列的方法产生一个GridView后,分页时出现上述错误:Specified argument was <em>out</em> of the <em>range</em> of valid values. Parameter name: <em>index</em>*/rnrnGridView gv1 = new GridView();rnBoundField bf = new BoundFiled();rn...rngv1.Columns.Add(bf);rn...rn//下面两行注释掉后正常。rngv1.AllowPaging = true; rngv1.PageSize = 2;rnrngv1.DataBind();
java.sql.SQLException: Parameter index out of range (1 > number of parameters, w
[code="java"]public class Register rn public static boolean register(String name, String password) rn throws SQLException, ClassNotFoundException rn Class.forName("com.mysql.jdbc.Driver");rn Connection cn = DriverManager.getConnectionrn ("jdbc:mysql://localhost/test", "root", "179401");rn PreparedStatement pst = cn.prepareStatementrn ("select * from temp");rn ResultSet rs = pst.executeQuery();rn rn while (rs.next()) rn if (rs.getString(1).equals(name)) rn System.<em>out</em>.println("The username " + name + " has already existed!");rn return false;rn rn rn rn pst.setString(1, name);rn pst.setString(2, password);rn rn cn.close();rn rn return true;rn rn[/code]rnrn异常 rnjava.sql.SQLException: Parameter <em>index</em> <em>out</em> of <em>range</em> (1 > number of <em>parameter</em>s, which is 0).rn com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1075)rn com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989)rn com.mysql.jdbc.SQLError.createSQLException(SQLError.java:984)rn com.mysql.jdbc.SQLError.createSQLException(SQLError.java:929)rn com.mysql.jdbc.PreparedStatement.checkBounds(PreparedStatement.java:3711)rn com.mysql.jdbc.PreparedStatement.setInternal(PreparedStatement.java:3695)rn com.mysql.jdbc.PreparedStatement.setString(PreparedStatement.java:4546)rn com.v.registration.Register.register(Register.java:22)rn com.v.registration.RegisterAction.execute(RegisterAction.java:9)rn sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn java.lang.reflect.Method.invoke(Method.java:597)rn com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:441)rn com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:280)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:243)rn com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252)rn org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)rn org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)rn org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)rnrn
Parameter index out of range (1 > number of parameters, which is 0).
求解,如题。。。。。
Parameter index out of range (5 > number of parameters, which is 4)
我的insert语句是这样的:rn"INSERT INTO USER_MANAGE(NAME,LOGINNAME,PWD,IP) VALUES(?,?,?,?)",new Object[] map.get("name"), map.get("loginname"), map.get("pwd"), map.get("ip"),new Date() ) > 0rn结果报这样的错误:rnParameter <em>index</em> <em>out</em> of <em>range</em> (5 > number of <em>parameter</em>s, which is 4)rn请问是怎么回事?
Parameter index out of range (1 > number of parameters, which is 0) 报错及解决方案
使用mybatis查询是报错,SQL异常:Parameter <em>index</em> <em>out</em> of <em>range</em> (1 &amp;gt; number of <em>parameter</em>s, which is 0),感觉很奇怪,检查了好久才发现犯了个特别low的问题。 错误提示: java.sql.SQLException: Parameter <em>index</em> <em>out</em> of <em>range</em> (1 &amp;gt; number of par...
Mybatis 关于Parameter index out of range (1 > number of parameters, which is 0)的解决方法
我在项目中使用Mybatis进行数据库的访问,在注解使用模糊查询的时候出现了 Parameter <em>index</em> <em>out</em> of <em>range</em> (1 &amp;gt; number of <em>parameter</em>s, which is 0)的错误。 经查阅资料发现,注解的SQL 使用like的写法有问题,正确写法应该如下: 平时我们写SQL like语句的时候 一般都会写成 like '% %' 在Myb...
Mybatis 错误信息:Parameter index out of range
Mybatis  的xml的Mapper文件中用到Like拼接模糊查询时出现如下错误提示:     Parameter <em>index</em> <em>out</em> of <em>range</em> (2 > number of <em>parameter</em>s, which is 1) 原因是  PreparedStatement的sql中?是不能带有引号的; select * from t_user where nake like '%?%
出现以下异常: Parameter index out of range (3 &gt; number of parameters, which is 2).
java.sql.SQLException: Parameter <em>index</em> <em>out</em> of <em>range</em> (3 &amp;gt; number of <em>parameter</em>s, which is 2).   出错源代码:public Page getPage(int currNo,int pageSize,int type) {         List&amp;lt;goods_detail&amp;gt; list=ne...
String index out of range: 6
[img=https://img-bbs.csdn.net/upload/201305/18/1368875784_483066.png][/img]rn[img=https://img-bbs.csdn.net/upload/201305/18/1368875946_841555.png][/img]rn[img=https://img-bbs.csdn.net/upload/201305/18/1368875959_219033.png][/img]rnrnrn老是说 字符串索引超出范围 到底哪里错了????
奇怪的 String index out of range
int chars = newsform.getContent().length(); //总字符数 intrn int PerPage = 1000; //每页要分的字符数rn int allpage; //总页数rnrn allpage = (chars + PerPage - 1) / (PerPage); //取得总页数rn rn String str[] = new String[allpage];rnrn String news = getStr(newsform.getContent());rn System.<em>out</em>.println(allpage+"页");rn System.<em>out</em>.println(chars+"个字符");rn for (int i = 0; i < allpage; i++) rn rn if (i==allpage-1) rn rn str[i] = news.substring((i * PerPage));rn System.<em>out</em>.println(str[i].length());rn rn else rn rn str[i] = news.substring((i * PerPage), ((i + 1) * PerPage));rn System.<em>out</em>.println("第"+i+"次"+str[i].length());rn rnrn rn rn打印出:rn6页rn5191个字符rn第0次1000rn第1次1000rn第2次1000rn第3次1000rnrn这是错误:String <em>index</em> <em>out</em> of <em>range</em>: 5000rnrn帮我看下怎么会错的?
String index out of range: -1
String <em>index</em> <em>out</em> of <em>range</em>: -1rnrn是怎么回事啊 rnrn<em>谢谢</em>
list index out of range 求解
import os,re,linecacherndef fun(path):rn for root,dirs,files in os.walk(path):rn for fn in files:rn rootpath = os.path.join(root,fn)rn filetype=fn.split('.')[1]rn if filetype in['xml']:rn print(rootpath) rn new=(linecache.getline(rootpath,4)).rstrip()rn print (new)rn #print (type(new))rn newsp=new.split('.')rn #print (type(newsp))rn print(newsp[1])rn f= open(rootpath,'r+')rn d=f.read()rn open(rootpath, 'w').write(re.sub(r'a', 'b', d))rn f.close()rn else:rn continuernfun(r'C:\wmpub')rnrnrnrnC:\wmpub\a.xmlrnrnTraceback (most recent call last):rn File "C:\Documents and Settings\Administrator\桌面\test.py", line 21, in rn fun(r'C:\wmpub')rn File "C:\Documents and Settings\Administrator\桌面\test.py", line 14, in funrn print(newsp[1])rnIndexError: list <em>index</em> <em>out</em> of <em>range</em>rn>>>
Row index out of range问题
public class Table1 extends JFramern String rid[] = new String[100];rn int count = 0;rn /*rn * public static void main(String a[]) new Table1(); rn */rn rn public void center(JFrame frame) rn double x = frame.getWidth(); // 居中困难rn double y = frame.getHeight();rn Toolkit kit = Toolkit.getDefaultToolkit();rn Dimension screenSize = kit.getScreenSize();rn double xx = screenSize.getWidth();rn double yy = screenSize.getHeight();rn frame.setLocation((int) (xx / 2 - x / 2), (int) (yy / 2 - y / 2));rn rn public Table1() rn JPanel zuida = new JPanel(new BorderLay<em>out</em>(0, 10));rn JPanel jp1 = fangzi();rn JPanel jp2 = dingdan();rn jp2.setBorder(BorderFactory.createTitledBorder("订单信息"));rn JTabbedPane tp = new JTabbedPane();rn tp.addTab("房间预定", jp1);rn tp.addTab("订单信息", jp2);rn // zuida.add(jp1);rn zuida.add("North", tp);rn JFrame frame = new JFrame("酒店");rn frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);rn //zuida.setBackground(new Color(102,204,255)); 设置背景颜色rn zuida.setBorder(new EmptyBorder(5, 5, 5, 5));rn frame.setContentPane(zuida);rn frame.setVisible(true);rn frame.pack();rn center(frame);rn System.<em>out</em>.println("123");rn // frame.setLocationRelativeTo(null);//这个也是居中的方法rn rn JPanel fangzi() rn JTable jiu = jiudian();rn JTable table = order();rn JScrollPane pane = new JScrollPane(jiu); // 加滑轮rn JPanel panel = new JPanel();//rn JPanel panel2 = new JPanel(new FlowLay<em>out</em>(FlowLay<em>out</em>.CENTER, 30, 10));rn JPanel panel3 = new JPanel(new GridLay<em>out</em>(1, 10));rn JPanel panel4 = new JPanel(new BorderLay<em>out</em>(0, 10));rn panel.setPreferredSize(new Dimension(600, 400));rn panel.setLay<em>out</em>(new BorderLay<em>out</em>());rn JButton b1 = new JButton("预订");rn JButton b2 = new JButton("加至购物车");rn JButton b3 = new JButton("预定多个");rn JButton b4 = new JButton("生成订单");rn panel2.add(b1);rn panel2.add(b2);rn panel2.add(b3);rn panel2.add(b4);rn ButtonListener bListener = new ButtonListener(jiu,rid);rn rn JButton b5 = new JButton("查询空房");rn panel3.add(b5);rn rn rn bListener.jPanel = panel;rn bListener.jPanel2 = pane;rn ButtonListener bListener2 = new ButtonListener(table);rn b5.addActionListener(bListener2);rn rn b1.addActionListener(bListener);rn b2.addActionListener(bListener);rn b3.addActionListener(bListener);rn b4.addActionListener(bListener);rnrn panel.add("Center", pane);rn panel.add("S<em>out</em>h", panel2);rn panel.add("North", panel3);rn panel.setBorder(BorderFactory.createTitledBorder("房间信息"));rn rn rn rn return panel;rn rn JPanel dingdan() rn JTable dingdan = order();rn JScrollPane pane = new JScrollPane(dingdan);rn JPanel jp10 = new JPanel(new BorderLay<em>out</em>());rn jp10.add("Center", pane);rn JButton b1 = new JButton("确定");rn JButton b2 = new JButton("刷新");rn jp10.add("S<em>out</em>h", b1);rn jp10.add("North",b2);rn ButtonListener bListener1 = new ButtonListener(dingdan);rn b1.addActionListener(bListener1);rn b2.addActionListener(bListener1);rn return jp10;rn rn JTable order() //生成订单的表格rn Vector lieV = new Vector();rn Vector hangV = new Vector();rn try rn Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");rn Connection con;rn con = DriverManager.getConnection("jdbc:sqlserver://localhost:1433;DataBaseName=Hotel", "sa", "123");rn PreparedStatement statement = con.prepareStatement("Select * from 订单 where Userid =? ");rn statement.setString(1, new MainClass().getname());rn ResultSet rs = statement.executeQuery();rn while (rs.next()) rn Vector hangv = new Vector();rn hangv.add(Integer.parseInt(rs.getString(1)));rn hangv.add(rs.getString(2)); rn hangv.add((rs.getString(3))); rn hangv.add((rs.getString(4))); rn hangv.add((rs.getInt(5))); rn hangv.add((rs.getString(6))); rn hangv.add((rs.getInt(7)));rn hangV.add(hangv);rn rn catch (Exception e) rn System.<em>out</em>.println("Error" + e);rn rn final Object Lie[] = "订单编号", "用户", "房间编号", "订单日期","数量", "状态","价格" ;rn lieV.add("订单编号");rn lieV.add("用户");rn lieV.add("房间编号");rn lieV.add("订单日期");rn lieV.add("数量");rn lieV.add("状态");rn lieV.add("价格");rn rn //JTable jiu = new JTable(row, Lie); // 建立表格rn DefaultTableModel tableModel = new DefaultTableModel(hangV, lieV);rn JTable jiu = new JTable(tableModel); rn jiu.setPreferredScrollableViewportSize(new Dimension(400, 300));rn jiu.setRowHeight(30);rn jiu.setRowMargin(5);rn jiu.setRowSelectionAllowed(true);rn jiu.setSelectionBackground(Color.WHITE);rn jiu.setSelectionForeground(Color.red);rn jiu.setGridColor(Color.BLACK);rn // jiu.selectAll();rn jiu.setRowSelectionInterval(0, 0);rnrn //jiu.clearSelection();rn jiu.setDragEnabled(false);rn jiu.setShowGrid(true);rn jiu.setShowHorizontalLines(false);rn jiu.setShowVerticalLines(false);rn //jiu.doLay<em>out</em>();rn jiu.setBackground(Color.LIGHT_GRAY);rn //ButtonListener bListener = new ButtonListener(jiu, rid);rn //bListener.otherTable = jiu;rn return jiu;rn rn //!!!!rn JTable jiudian() //生成酒店的表格 rn // 用向量来实现动态的大小rn //Object 可以不用了rn Vector lieV = new Vector();rn Vector hangV = new Vector();rn Object row[][] = new Object[30][30];rn try rn Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");rn Connection con;rn con = DriverManager.getConnection("jdbc:sqlserver://localhost:1433;DataBaseName=Hotel", "sa", "123");rn Statement statement = con.createStatement();rn ResultSet rs = statement.executeQuery("Select * from 房间");rn int x = 0;rn int y = 0;rn rn while (rs.next()) rn Vector hangv = new Vector();rn row[x][y] = Integer.parseInt(rs.getString("rid"));rn hangv.add(row[x][y]);rn y++;rn row[x][y] = rs.getInt("Rprice");rn hangv.add(row[x][y]);rn y++;rn row[x][y] = (rs.getString("raddress"));rn hangv.add(row[x][y]);rn y++;rn row[x][y] = (rs.getString("rtype"));rn hangv.add(row[x][y]);rn y++;rn row[x][y] = (rs.getString("rstate"));rn hangv.add(row[x][y]);rn x++;rn y = 0;rn hangV.add(hangv);rn rn catch (Exception e) rn System.<em>out</em>.println("Error" + e);rn rn final Object Lie[] = "编号", "价格", "位置", "类型", "状态" ;rn lieV.add("编号");rn lieV.add("价格");rn lieV.add("位置");rn lieV.add("类型");rn lieV.add("状态");rn rn //JTable jiu = new JTable(row, Lie); // 建立表格rn DefaultTableModel tableModel = new DefaultTableModel(hangV, lieV);rn JTable jiu = new JTable(tableModel); rn jiu.setPreferredScrollableViewportSize(new Dimension(400, 300));rn jiu.setRowHeight(30);rn jiu.setRowMargin(5);rn jiu.setRowSelectionAllowed(true);rn jiu.setSelectionBackground(Color.WHITE);rn jiu.setSelectionForeground(Color.red);rn jiu.setGridColor(Color.BLACK);rn // jiu.selectAll();rn jiu.setRowSelectionInterval(0, 0);rnrn //jiu.clearSelection();rn jiu.setDragEnabled(false);rn jiu.setShowGrid(true);rn jiu.setShowHorizontalLines(false);rn jiu.setShowVerticalLines(false);rn jiu.doLay<em>out</em>();rn jiu.setBackground(Color.LIGHT_GRAY);rnrn return jiu;rn rnrnrnrnrnErrorjava.lang.IllegalArgumentException: Row <em>index</em> <em>out</em> of <em>range</em>rn实在不知道怎么修改rn
mybatis的sql 执行报错:Parameter index out of range (4 > number of parameters, which is 3)
mybatis的sql 执行报错:Parameter <em>index</em> <em>out</em> of <em>range</em> (4 > number of <em>parameter</em>s, which is 3)
Parameter index out of range (3 > number of parameters, which is 2)
-
出现java.sql.SQLException: Parameter index out of range (1 > number of parameters,
本人是个菜鸟,想问下,我想在HTML中添加一条记录到数据库t_emp中,然后出现这个错误,这个参数出错在哪?百度弄不出。怎么改才行呢? package web; import java.io.IOEx
Cause: java.sql.SQLException: Parameter index out of range (5 > number of parameters, which is 4).
错误描述:    启动项目调接口的时候控制台报错    Cause: java.sql.SQLException: Parameter <em>index</em> <em>out</em> of <em>range</em> (5 &amp;gt; number of <em>parameter</em>s, which is 4).错误分析:    可以看到控制台日志输出了下面这一句话    ### The error occurred while setting par...
解决java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).等类似问题
Type Exception ReportMessage Request processing failed; nested exception is org.springframework.dao.TransientDataAccessResourceException:Description The server encountered an unexpected condition that...
String index out of range: 48
String <em>index</em> <em>out</em> of <em>range</em>: 48
oracle数据库错误:Missing IN or OUT parameter at index:: 1
上传文件到oracle数据库,相关代码如下:rn……rn//get file namernfileName = mySmartUpload.getFiles().getFile(0).getFileName(); rn//get file sizernsize = mySmartUpload.getFiles().getFile(0).getSize();rn//get file contentrncom.jspsmart.upload.File fileContent = mySmartUpload.getFiles().getFile(0);rnbyte[] fileData = new byte[size];rnfor (int i = 0; i < size; i++) rnrn fileData[i] = fileContent.getBinaryData(i);rnrn rnString sql = "insert into test (id,filename,file) values (" + id +",'" + fileName +"',?)";rnPreparedStatement ps = conn.prepareStatement(sql);rnps.setBinaryStream(3, new ByteArrayInputStream(fileData),size);rnps.executeUpdate();//执行到该句出现错误!!rnps.close();rn……rnrn我发现错误发生在ps.executeUpdate();rnrnAn error occurs : java.sql.SQLException: Missing IN or OUT <em>parameter</em> at <em>index</em>:: 1rnrn请问这是什么原因?如何改?<em>谢谢</em>!
Please help--Missing IN or OUT parameter at index:: 1
请教下Missing IN or OUT <em>parameter</em> at <em>index</em>:: 1 是什么错。rnrn这个错不是经常抛出,一天会有一两次这样的错误。rnrn但是我找了很久还是找不到很好的解决方法。rnrn请问,这个Exception究竟是什么回事,应该怎样去解决?rnrnAny help would be appreciate.
String index out of range: -1 异常,急需处理
nnnn  
java.lang.StringIndexOutOfBoundsException: String index out of range: 9 at java
java.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: 9 rnat java.lang.String.substring(String.java:1765) rnat com.sq.entity.builder.Utilities.getStrLen(Utilities.java:1462) rnat org.apache.jsp.entity.member.resenterpriselist_jsp._jspService(resenterpriselist_jsp.java:373) rnat org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) rnat javax.servlet.http.HttpServlet.service(HttpServlet.java:717) rnat org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374) rnat org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342) rnat org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267) rnat javax.servlet.http.HttpServlet.service(HttpServlet.java:717) rnat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) rnat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) rnat org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) rnat org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) rnat org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) rnat org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) rnat org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) rnat org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) rnat org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) rnat org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) rnat org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) rnat java.lang.Thread.run(Thread.java:595) rnrnrn这是一个发布的别人的网站,可是里面有很多地方都报的这同一个错,怀疑不是单纯的下标越界问题,不晓得原因究竟出在哪里?希望有遇到类似情况 的高手解答一下迷津,谢了!!!
记一次 like 查询的MySQL Parameter index out of range 异常
异常信息 TransientDataAccessResourceException: PreparedStatementCallback; Parameter <em>index</em> <em>out</em> of <em>range</em> (xx &amp;amp;amp;gt; number of <em>parameter</em>s, which is xx).; nested exception is java.sql.SQLException: Parameter in...
python3 出错求大神帮助list index out of range
-
更新数据库表信息时抛异常java.sql.SQLException: Parameter index out of range (1 > number of parameter
从数据库中读取信息时,出现如下错误:java.sql.SQLException: Parameter <em>index</em> <em>out</em> of <em>range</em> (1 > number of <em>parameter</em>这个问题困扰了我几乎将近一下午的时间,最后从网上找了好多方法也不管用,最后终于解决了,才发现是我的sql语句中的”?”打成了中文版的”?”,把它改过来就好了,问题就解决啦!
String index out of range: -2问题
今天突然遇到这个问题。String <em>index</em> <em>out</em> of <em>range</em>: -2不知道为什么?请高手指点迷津。rn[code=Java]java.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: -2rn at java.lang.String.substring(String.java:1444)rn at jsp_servlet._fams.__tb_assetscard_car_doadd._jspService(__tb_assetscard_car_doadd.java:203)rn at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)rn at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1077)rn at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)rn at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348)rn at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:7047)rn at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)rn at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)rn at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3902)rn at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2773)rn at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)rn at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)[/code]
关于Grid Index Out Of Range 的问题
我在窗体中添加了一个PageContol组件,通过切换PageContol的页面来实现不同数据表的全部记录显示,代码如下rnprocedure TForm2.PageControl1Change(Sender: TObject);rnbeginrn if pagecontrol1.TabIndex=0 thenrn beginrn datamodule1.ADOQuery2.Close;rn with datamodule1.ADOQuery1 dorn beginrn close;rn sql.Clear;rn sql.Add('select * from 年度培训计划表 order by 年度, 编号 ASC');rn open;rn last;rn end;rn DBGrid1.DataSource:=datamodule1.DataSource1;rn DBNavigator1.DataSource:=datamodule1.DataSource1;rn end;rn if pagecontrol1.TabIndex=1 thenrn beginrn datamodule1.ADOQuery1.Close;rn with datamodule1.ADOQuery2 dorn beginrn close;rn sql.Clear;rn sql.Add('select * from 计划外培训项目表 order by 编号 ASC');rn open;rn last;rn end;rn DBGrid1.DataSource:=datamodule1.DataSource2;rn DBNavigator1.DataSource:=datamodule1.DataSource2;rn end;rnend;rn窗体显示时Pagecontrol的Tab<em>index</em>为0,代码如下:rnprocedure TForm2.FormShow(Sender: TObject);rnbeginrn dbgrid1.DataSource:=datamodule1.DataSource1;rn dbnavigator1.DataSource:=datamodule1.DataSource1;rn with datamodule1.ADOQuery1 dorn beginrn close;rn sql.Clear;rn sql.Add('select * from 年度培训计划表 order by 年度, 编号 ASC');rn open;rn last;rn end;rnend;rnrn然后我又增加了一个按钮,点击时显示表的全部记录,代码如下:rnprocedure TForm2.QueryAllClick(Sender: TObject);rnbeginrn if pagecontrol1.TabIndex=0 thenrn beginrn datamodule1.ADOQuery2.Close;rn with datamodule1.ADOQuery1 dorn beginrn close;rn sql.Clear;rn sql.Add('select * from 年度培训计划表 order by 年度, 编号 ASC');rn open;rn last;rn end;rn DBGrid1.DataSource:=datamodule1.DataSource1;rn DBNavigator1.DataSource:=datamodule1.DataSource1;rn end;rn if pagecontrol1.TabIndex=1 thenrn beginrn datamodule1.ADOQuery1.Close;rn with datamodule1.ADOQuery2 dorn beginrn close;rn sql.Clear;rn sql.Add('select * from 计划外培训项目表 order by 编号 ASC');rn open;rn last;rn end;rn DBGrid1.DataSource:=datamodule1.DataSource2;rn DBNavigator1.DataSource:=datamodule1.DataSource2;rn end;rnend;rnrn现在的问题在于,当窗体显示时,我点击该按钮,就会出错,弹出出现异常:Grid <em>index</em> <em>out</em> of <em>range</em> 。rn利用F7跟踪调试,发现错误在last这条语句上。rnrn我搞了半天也没弄明白为什么会出错,敬请大家赐教!!!!!!
index out of range"提示......">又一个"Grid index out of range"提示......
为何我的Adoquery增加记录有时会出现"Grid <em>index</em> <em>out</em> of <em>range</em>"?何解?
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
HTTP Status 500 - rnrn--------------------------------------------------------------------------------rnrntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnorg.apache.jasper.JasperException: Exception in JSP: /<em>index</em>.jsp:75rnrn72: bordercolor="#3F96E3">rn73: rn74: rn75: rn77: rn78: rnrnrnStacktrace:rn org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn com.erp.fiter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:34)rnrnrnroot cause rnrnorg.apache.jasper.JasperException: Exception in JSP: /product/newproductinfo.jsp:74rnrn71: color="Navy">rn72: rn76: rnrnrnStacktrace:rn org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)rn org.apache.jsp.<em>index</em>_jsp._jspService(org.apache.jsp.<em>index</em>_jsp:133)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn com.erp.fiter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:34)rnrnrnroot cause rnrnjava.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: -1rn java.lang.String.substring(String.java:1768)rn org.apache.jsp.product.newproductinfo_jsp._jspService(org.apache.jsp.product.newproductinfo_jsp:147)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)rn org.apache.jsp.<em>index</em>_jsp._jspService(org.apache.jsp.<em>index</em>_jsp:133)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn com.erp.fiter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:34)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/5.5.15 logs.rnrnrn--------------------------------------------------------------------------------rnrnApache Tomcat/5.5.15
Mybatis异常解决之:java.sql.SQLException: Parameter index out of range
mybatis使用过程中遇到下面一个异常:org.springframework.dao.TransientDataAccessResourceException: ### Error querying database. Cause: java.sql.SQLException: Parameter <em>index</em> <em>out</em> of <em>range</em> (1 &amp;gt; number of <em>parameter</em>s...
mybatis中Parameter index out of range (2 > number of parameters, which is 1).
mybatis中Parameter <em>index</em> <em>out</em> of <em>range</em> (2 &amp;gt; number of <em>parameter</em>s, which is 1). Parameter <em>index</em> <em>out</em> of <em>range</em> (2 &amp;gt; number of <em>parameter</em>s, which is 1).(参数索引超出范围) 在mybatis里面写就是应该是 like  '%${name} %' ...
MYSQL: Parameter index out of range
异常如下: > java.sql.SQLException: Parameter <em>index</em> <em>out</em> of <em>range</em> (1 > number of <em>parameter</em>s, which is 0). at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:964) at com.mysql.jdbc.SQLError.createSQLExcepti
jdbc在模糊搜索时候报错:Parameter index out of range
jdbc在模糊搜索时候报错:Parameter <em>index</em> <em>out</em> of <em>range</em> 。
操作MySQL数据库报出:Parameter index out of range (1 > number of parameters, which is
对MySQL进行insert操作,控制台抛出以下错误:Parameter <em>index</em> <em>out</em> of <em>range</em> (1 > number of <em>parameter</em>s, which is 0) 调试了半天后查找资料后,问题就出在当设置参数时,没有相应的问号与之匹配或者根本就没有?号、 String sql = "insert into t_courler
错误提示:String index out of range: 500?
请教大家: rn我在数据录入时把好几个字段用"*"分开,存储在一个字段中。在从数据库中取出数据时,语句如下. rnResultSet rs=st.executeQuery("select * from tblMain"); rnrs.next(); rnString resip=rs.getString("resipID"); rnzym=rs.getString("title"); rnfujiazym=rs.getString("titleAlternative"); rnint m=fujiazym.length(); rnint i=0; rnint j=0; rnint k=0; rnString fjzym[]; rnfjzym=new String[20]; rnrnwhile(!(fujiazym.equals("*"))) rnj=fujiazym.<em>index</em>Of('*'); rnk++; rnfjzym[k]=fujiazym.substring(i,j); rnfujiazym=fujiazym.substring(j+1,m); rn rn执行后出现错误提示, rnjava.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: 500 rn我的数据库中的titleAlternative字段大小是500.请教是何原因rnrn
关于“Grid index out of range”的问题
我的程序rn 1)所用控件rn TDBGrid *DBGrid1;rn TDBNavigator *DBNavigator1;rn TDataSource *DSSQL;rn TQuery* Query1;rn 2)控年设置rn DSSQL->DataSet = Query1;rn DBNavigator1->DataSource = DSSQL;rn DBGrid1->DataSource = DSSQL;rnrn 3)出错的情况rn 3-1) 第一次执行rnrn Query1->Close();rn Query1->SQL->Clear();rn Query1->SQL->Add("select * from aa where qsOpen():rnrn 然后点击DBNavigator1控件的“Last”按钮,程序正常rn 3-2)第二次执行rnrn Query1->Close();rn Query1->SQL->Clear();rn Query1->SQL->Add("select * from aa where qsOpen():rnrn 然后点击DBNavigator1控件的“Last”按钮,程序报“Grid <em>index</em> <em>out</em> of <em>range</em>”错. 点警告框的“确定”按钮后,进入C++Builder的调试状态,不作任何变动,直接rn“RUN”按钮,回到程序运行状态,再按DBNavigator1控件的“Last”按钮,程序又正常。rn 以后每再次重新用SQL查询后,想到数据集的最后一条记录(用语句Query1->Last();也一样),非要出次错,才会正常,不知是何道理,不知有何对策,我估计是DBGrid1的设置有误,但不知具体原因。rn 请赐教,rn为感!!rnrnrn
求助:IndexError: list index out of range
使用Spyder(python 3.6)代码为:rn#!/usr/bin/env python3rnimport sysrnrnfrom xlrd import open_workbookrnfrom xlwt import Workbookrnrninput_file = sys.argv[1]rn<em>out</em>put_file = sys.argv[2]rnrn<em>out</em>put_workbook = Workbook()rn<em>out</em>put_worksheet = <em>out</em>put_workbook.add_sheet('jan_2013_<em>out</em>put')rnrnwith open_workbook(input_file) as workbook:rn worksheet = workbook.sheet_by_name('january_2013')rn for row_<em>index</em> in <em>range</em>(worksheet.nrows):rn for column_<em>index</em> in <em>range</em>(worksheet.ncols):rn <em>out</em>put_worksheet.write(row_<em>index</em>, column_<em>index</em>, worksheet.cell_value(row_<em>index</em>, column_<em>index</em>))rn<em>out</em>put_workbook.save(<em>out</em>put_file)rnrn执行:python 2excel_parsing_and_write.py sale_2013 L<em>out</em>put.xlsrnrn出现问题,输出;rnPython 3.6.2 |Anaconda custom (64-bit)| (default, Sep 19 2017, 08:03:39) [MSC v.1900 64 bit (AMD64)]rnType "copyright", "credits" or "license" for more information.rnrnIPython 6.1.0 -- An enhanced Interactive Python.rnrnrnrnrunfile('C:/LearnPython/excel/2excel_parsing_and_write.py', args='sales_2013.xlsx', wdir='C:/LearnPython/excel')rnTraceback (most recent call last):rnrn File "", line 1, in rn runfile('C:/LearnPython/excel/2excel_parsing_and_write.py', args='sales_2013.xlsx', wdir='C:/LearnPython/excel')rnrn File "H:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 710, in runfilern execfile(filename, namespace)rnrn File "H:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 101, in execfilern exec(compile(f.read(), filename, 'exec'), namespace)rnrn File "C:/LearnPython/excel/2excel_parsing_and_write.py", line 8, in rn <em>out</em>put_file = sys.argv[2]rnrnIndexError: list <em>index</em> <em>out</em> of <em>range</em>
java.lang.StringIndexOutOfBoundsException: String index out of range: -1错误
[img=https://img-bbs.csdn.net/upload/201704/14/1492166177_246376.png][/img][img=https://img-bbs.csdn.net/upload/201704/14/1492166190_367039.png][/img]rnrn //向服务器获取根目录rn public static String getRootList() throws Exceptionrn String json = "\"type\":\"getRootList\"";rn <em>out</em>put.write(json.getBytes());rn <em>out</em>put.flush();rn byte[] b = new byte[1024];rn int len = input.read(b);rn json = new String(b,0,len);//字符串进行转化rnrn Config.ROOT_LIST_JSON_STR = json;rn return json; rn rn[img=https://img-bbs.csdn.net/upload/201704/14/1492166266_975276.png][/img]rntry rn String json_str = Config.service.getRootList();rn System.<em>out</em>.println(json_str);rn JSONObject json = JSONObject.fromObject(json_str);//对json的解析rn rn JSONArray jsonArray_mulu = json.getJSONArray("mulu");rn JSONArray jsonArray_files = json.getJSONArray("files");rn rn this.removeAll();rn rn int count = jsonArray_mulu.size()+jsonArray_files.size();rn rn for (int i = 0; i < jsonArray_mulu.size(); i++) rn JSONObject mulu = jsonArray_mulu.getJSONObject(i);rn rn this.add(new FileJPanel(mulu.getString("rdid"), mulu.getString("did"), "DIR", mulu.getString("dname")));rn rn rn for (int i = 0; i < jsonArray_files.size(); i++) rn JSONObject file = jsonArray_files.getJSONObject(i);rn this.add(new FileJPanel(file.getString("did"), file.getString("fid"), "FILE", file.getString("fname")));rn rn rn rn this.setPreferredSize(new Dimension(508,(count/5+(count%5==0?0:1))*135));rn catch (Exception e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn javax.swing.JOptionPane.showMessageDialog(this.getParent(), "网络异常,请稍后再试");rn rn相关的代码贴出来了,但不是很理解这个数组怎么就越界了。也不知道怎么去修改
hibernate criteria 分页查询 提示Parameter index out of range
困扰了一天的问题,看代码就是没问题,把.setFirstResult().setMaxResults()去掉之后就能查询了,加上就报错,然后各种百度,最后得出结论,在spring的配置文件中 使用spring管理sessionfactory时把方言写成这个就好了 &amp;lt;prop key=&quot;hibernate.dialect&quot;&amp;gt; org.hibernate.dialec...
java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0)
详细错误描述: import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Select; import cn.zw.custEntity.Cust; @Mapper public interface CustMapper { @Select("select bc.id as
解决ava.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0)类似问题
遇到了Parameter <em>index</em> <em>out</em> of <em>range</em> (1 > number of <em>parameter</em>s, which is 0) ,检查了很多遍错误。最后终于发现,原来sql中带有'单引号的,一个很简单的失误,我折腾了1个钟头,忘大家引以为戒啊...  java.sql.SQLException: Parameter <em>index</em> <em>out</em> of <em>range</em> (1 > n
Parameter index out of range (3 > number of parameters, which is 2).
Parameter <em>index</em> <em>out</em> of <em>range</em> (3 > number of <em>parameter</em>s, which is 2). 当出现这种问题时,可能因为在mybatis中使用like方式不对,可参考:http://w6513017.iteye.com/blog/1512761使用
ibatis 中遇到的 Parameter index out of range (13 > number of parameters, which is 12).问题
在iBatis 数据查询中,执行xml 查询语句碰见了: Parameter <em>index</em> <em>out</em> of <em>range</em> (13 > number of <em>parameter</em>s, which is 12).的报错, 检查后解决,发现是查询中存在: DATE_FORMAT(a1.businessDate, '#{countLevelString}') as businessDate,字段。 函数
求助:String index out of range: 0 !!!
[img=https://img-bbs.csdn.net/upload/201606/27/1467029138_584565.png][/img]rn当程序在执行这条语句时,报String <em>index</em> <em>out</em> of <em>range</em>: 0!!异常 但是自己也没有使用过数组之类的容器,求各位大大帮助,已经纠结两天了!
dbGrid index out of range怎么解决
我利用adoquery控减连接数据库。用dbgrid空件显示内容,但是如果数据库中的纪录超过了一定的数量的时候,救护出现错误:代码如下:rngrid <em>index</em> <em>out</em> of <em>range</em>rnrn我知道是dbgrid控减的问题,从那里可以设置dbgrid空间的范围属性。
java.lang.StringIndexOutOfBoundsException: String index out of range: 0
09:57:40,051 ERROR Dispatcher:38 - Exception occurred during processing request: String <em>index</em> <em>out</em> of <em>range</em>: 0rnjava.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: 0rn at java.lang.String.charAt(String.java:658)rn at org.hibernate.type.CharacterType.get(CharacterType.java:52)rn at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:186)rn at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:175)rn at org.hibernate.type.AbstractType.hydrate(AbstractType.java:105)rn at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2267)rn at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1443)rn at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1371)rn at org.hibernate.loader.Loader.getRow(Loader.java:1271)rn at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:619)rn at org.hibernate.loader.Loader.doQuery(Loader.java:745)rn at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:270)rn at org.hibernate.loader.Loader.loadEntity(Loader.java:1953)rn at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:86)rn at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:76)rn at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3270)rn at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:496)rn at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:477)rn at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:227)rn at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:285)rn at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:152)rn at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1080)rn at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1028)rn at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:623)rn at org.hibernate.type.EntityType.resolve(EntityType.java:431)rn at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:140)rn at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:898)rn at org.hibernate.loader.Loader.doQuery(Loader.java:773)rn at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:270)rn at org.hibernate.loader.Loader.doList(Loader.java:2449)rn at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2192)rn at org.hibernate.loader.Loader.list(Loader.java:2187)rn at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:452)rn at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)rn at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)rn at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1258)rn at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)rn at com.bjpowernode.drp.base.daoImp.ClientDaoImp.getfindById(ClientDaoImp.java:89)rn at com.bjpowernode.drp.base.serviceImp.ClientServiceImp.getfindById(ClientServiceImp.java:22)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:606)rn at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)rn at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)rn at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)rn at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)rn at com.sun.proxy.$Proxy18.getfindById(Unknown Source)rn at com.bjpowernode.drp.base.action.ClientAction.getfindById(ClientAction.java:31)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:606)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:450)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:289)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:252)rn at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:167)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)rn at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:239)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:239)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:252)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:161)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rnrnrnrn[color=#FF0000]rn以上这些是异常信息,我确定我是执行这条语句出错:rnhibernateTemplate.get(Client.class, id);rn我也确定id有值 比如10001是数值型int,rn百思不得其解,赐教!rn[/color]
MySQL使用like出现 操作MySQL数据库报出:Parameter index out of range (1 > number of parameters
... sql = "...where 1=1  and s.content like '%?%'"; sqlValue.add(content); ... 一直出现错误Parameter <em>index</em> <em>out</em> of <em>range</em> (1 > number of <em>parameter</em>s, which is 0) 自己修改 sql = "...where 1=1  and s.content li
jsp中向MySQL插入数据出现:Parameter index out of range (1 > number of parameters, which is 0).
正常的想法是和MySQL插入语句一样的:String sql="insert into student(‘no’,‘name’,‘score’,‘password’) values(?,?,?,?)"但其实如果这样写就会爆出:Parameter <em>index</em> <em>out</em> of <em>range</em> (1 > number of <em>parameter</em>s, which is 0).如果改成如下语句就不会报错String
调用MYSQL存储过程引发的“Parameter index of 5 is out of range (1, 4)”问题
错误信息如下: 0:13:58,218 INFO SbxxServiceImpl:19 - 开始执行SbxxServiceImpl类的 createSblx 方法 ! 10:13:58,218 INF
JAVA 调用MYSQL 带返回值存储过程 Parameter index of 13 is out of range (1, 11)
刚开始一直是正常的,后期添加了两个输入参数,程序一直报着问题(int 类型的 ps_qdlxid 和varchar 类型的 ps_qdlxmc) , 代码如下 : 如果删除新增增加两个参数的赋值语句,
谁能给我通俗易懂的解释下预处理PreparedStatement对象的setInt(int parameterIndex, int x)
刚接触java连接数据库,上面那个问题希望有人能解释下,越通俗越好,API说得太专业,不怎么好理解,<em>谢谢</em>
root cause java.lang.StringIndexOutOfBoundsException: String index out of range
HTTP Status 500 -rnrntype Exception reportrnrnmessagernrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexceptionrnrnorg.apache.jasper.JasperException: java.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: -1rn org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:502)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:430)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rnroot causernrnjava.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: -1rn java.lang.String.substring(String.java:1932)rn org.apache.jsp.admin.product_005fadd_005fok_jsp._jspService(product_005fadd_005fok_jsp.java:78)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rnnote The full stack trace of the root cause is available in the Apache Tomcat/6.0.33 logs.
string index out of range字符串怎么越界了?
打印出来s.encode('hex')是 0300 但是打印s[1]却报下面错误?rnstring <em>index</em> <em>out</em> of <em>range</em>
index out of range"">dbgird控件---->"grid index out of range"
我在用dbgird控件时, 当dbgird的宽度变大到一定程度, 当点击insert键插入信息时就出错,信息如下:rn"grid <em>index</em> <em>out</em> of <em>range</em>"  如何解决???什么原因???
Grid Index out of Range (TDBAdvGrid/D7)
我知道这个是表格索引越界了,可是dbGrid有没有办法不通过代码只是通过控件设置就可以自动添加记录呢?rnrn顺便请教一个问题,某个数字字段,要求值在2000-500000,dbGrid的输入格可以直接设置只接受符合条件的输入吗?
SSRS 2008 “Index was out of range…” Error
sql server report从05升级到08,查看报表出现如下问题,在05下看没有任何问题,大虾解决!!!rnrn客户端呈现期间出错。rnIndex was <em>out</em> of <em>range</em>. Must be non-negative and less than the size of the collection. Parameter name: <em>index</em>
执行sql的时候为什么会出现Parameter index out of range (1 > number of parameters, which is 0)?
数据库insert出错,浪费了我很长时间,结果发现是中英文标点问题,写此篇(mysql数据库)总结,以利于后学者,知道的可以点评一下,欢迎交流。 数据库错误:Parameter   <em>index</em>   <em>out</em>   of   <em>range</em>   (1   >   number   of   <em>parameter</em>s,   which   is   0).  错误发生原因其实很简单,就是当设置参数
使用PreparedStatement时,输出完整的SQL语句
使用psstmt时不能打印出完整的sql语句,挺不方便的,找到一个实现方法,记录下来。 package com.zhh.function.util; import java.io.InputStream; import java.io.Reader; import java.math.BigDecimal; import java.net.URL; import java.sq
Mybatis java.sql.SQLException: Parameter index of 2 is out of range (1, 0) 错误原因
排除了各方面的原因之后,把问题定在了mysql的jar 包版本上,原来用的是mysql-connector-java-5.1.13.jar 死活都是报下面的错误,后来换成了较新的版本 5.1.40 问题解决, 建议使用mybatis开发,使用mysql数据库,驱动用 5.1.40 版本!       mysql     mysql-connector-java     5.1.40  
JDBC之PreparedStatement的用法
jdbc(java database connectivity,java数据库连接)的api中的主要的四个类之一的java.sql.statement要求开发者付出大量的时间和精力。在使用statement获取jdbc访问时所具有的一个共通的问题是输入适当格式的日期和时间戳:2002-02-05 20:56 或者 02/05/02 8:56 pm。 通过使用java.sql.prepared
delphi6 'grid index out of range' 'TDBNavigator'
TDBGrid可以顯示資料rn我使用TDBNavigator去控制TDBGrid的上一筆跟下一筆還有最後一筆跟第一筆rnrn執行時,如果先案最後一筆rn他就會出現Grid <em>index</em> <em>out</em> of <em>range</em>rnrn如果今天先按下一筆再案最後一筆,程式就可以很順利的執行rn請問rn這是什麼原因??rnrn我有網查了,說要去檢查<em>index</em>是不是 0 到 Count - 1 的数值rn想請問一下哪一個的<em>index</em>是TQUERY還是TDBGRID還是??
java.lang.StringIndexOutOfBoundsException: String index out of range: -6
在解析数据库中一个字段的数据的时候总是报数组越界这个错误,具体情况:rn数据库中有4W多条数据,我要比较a字段和b字段中是否有相同部分,用到了字符串的substring()方法rn我测试过多次,但每次报错的数据都不一样,都报数组越界的错。rnrnIR_SID IR_SRCNAME rn----------- -------------------------rn5963 JB 3540-1983 ; rnrnrnIR_SID IR_SRCNAME rn----------- -------------------------rn7216 JB/T 8648.2-1997 ; rnrnIR_SRCNAME的数据是我要用substring()方法处理的数据,运行一次会报处理JB 3540-1983出现数组越界的错,再重新运行一次会报处理JB/T 8648.2-1997出现数组越界的错,运行多少次就会出现多少次不同的数据报错,并且都是数组越界,我的问题是[color=#FF0000]如果真的是某个数据或者某些数据在用substring()处理的时候有错的话应该是一直报错,为什么运行一次就报不同的数据有错呢?[/color]rnrn下面是具体代码:rn[code=Java]rnconn = DBConnectionManager.getInstance().getConnection();rnString sql = "select IR_SID,IR_URLTITLE,IR_SRCNAME from URLCONTENT";rnSQLHelper.conn = conn;rnlist = SQLHelper.ExecuteReader(sql, null);rnfor(int i = 0 ; i < list.size(); i ++)rnObject[] obj = (Object[]) list.get(i);rnid = Integer.parseInt(obj[0].toString());rnurltitle = ((String) obj[1]).trim();rnif(obj[2] == null||"".equals(((String) obj[2]).trim()))rn srcnames = "";rnelsern srcnames = ((String) obj[2]).trim();rnrnString titlenum = null;rnString newcol = "";rnif(!urltitle.contains("-"))rn urltitle = urltitle+"-";rnrn titlenum = (urltitle.substring(urltitle.lastIndexOf(" ")+1, urltitle.lastIndexOf("-"))).trim();rn if(srcnames!=null)rn String[] srcname = srcnames.split(";");rn for(int j = 0 ; j < srcname.length ; j ++)rn if(srcname[j]!=null&&srcname[j].length()!=0)rn if(!srcname[j].trim().contains("-"))rn srcname[j] = srcname[j].trim()+"-";rn rn rn String srcnum = (srcname[j].trim().substring(srcname[j].trim().lastIndexOf(" ")+1, srcname[j].trim().lastIndexOf("-"))).trim();rn if(srcnum.equals(titlenum))rn newcol = srcname[j].trim();rn rn rn rn rn rn updatesql.append("update URLCONTENT set col='"+newcol+"' where IR_SID="+id+";");rnrnconnect = DBConnectionManager.getInstance().getConnection();rnSQLHelper.conn = connect;rnSQLHelper.ExecuteNonQuerys(updatesql.toString(), null);rnSystem.<em>out</em>.println("执行完毕!");rn[/code]
python程序错误IndexError: list index out of range
新学习python这个问题总是没法解决希望大家帮帮忙rn源码:rn[code=python]#! /usr/bin/env pythonrn#coding=utf-8rnimport timernimport osrnstr1 = open( r'C:\Users\python\Desktop\url.txt' ,'r').readlines()rnnum = 0rnwhile num %(str1[num])rnIndexError: list <em>index</em> <em>out</em> of <em>range</em>
String index out of range: -91 怎么解决?
String files = "[2010-07-19 08:20:51] Uin=1072, UserName=林立, Addr=XXXX:1047, Action=login, Mode=local, Result=0(success)\n"rn+ "[2010-07-19 22:55:08] Uin=1017, UserName=伟文, Addr=XXXX:1070, Action=log<em>out</em>, Mode=local";rn rn String loginTime="";rn int uin=0;rn String userName="";rn String addr="";rn String action="";rn String mode="";rn String result="";rn String[] lines = files.split("\n");rn for(String line:lines)rn rn vo = new LogVO();rnrn int <em>index</em>1 = line.<em>index</em>Of("[");rn int <em>index</em>2 = line.<em>index</em>Of("]");rn loginTime = line.substring(<em>index</em>1+1, <em>index</em>2);rn rn int <em>index</em>3 = line.<em>index</em>Of("Uin=");rn int <em>index</em>4 = line.<em>index</em>Of(",", <em>index</em>3);rn uin = Integer.parseInt(line.substring(<em>index</em>3+4, <em>index</em>4));rnrn int <em>index</em>5 = line.<em>index</em>Of("UserName=");rn int <em>index</em>6 = line.<em>index</em>Of(",", <em>index</em>5);rn userName = line.substring(<em>index</em>5+9, <em>index</em>6);rnrn int <em>index</em>7 = line.<em>index</em>Of("Addr=");rn int <em>index</em>8 = line.<em>index</em>Of(",", <em>index</em>7);rn addr = line.substring(<em>index</em>7+5, <em>index</em>8);rnrn int <em>index</em>9 = line.<em>index</em>Of("Action=");rn int <em>index</em>10 = line.<em>index</em>Of(",", <em>index</em>9);rn action = line.substring(<em>index</em>9+7, <em>index</em>10);rnrn int <em>index</em>11 = line.<em>index</em>Of("Mode=");rn int <em>index</em>12 = line.<em>index</em>Of(",", <em>index</em>11);rn mode = line.substring(<em>index</em>11+5, <em>index</em>12);//到了这里就说下标越界了rn if(line.contains("Result="))rn rn int <em>index</em>13 = line.<em>index</em>Of("Result=");rn int <em>index</em>14 = line.<em>index</em>Of("\n", <em>index</em>13);rn result = line.substring(<em>index</em>13+7, 8);rn rn rn vo.setLoginTime(loginTime);rn vo.setUin(uin);rn vo.setUserName(userName);rn vo.setAddr(addr);rn vo.setAction(action);rn vo.setMode(mode);rn vo.setResult(result);rn list.add(vo);rn rnrn我现在是从日志里面解析出各个字段信息,但是到mode = line.substring(<em>index</em>11+5, <em>index</em>12);//这一行就报错:String <em>index</em> <em>out</em> of <em>range</em>: -91,下面一个result也是越界,这个要怎么改呢?rn
Parameter index out of range (1 > number of parameters,which is 0).
这里费时很多,谨记!数据库错误:****Parameter <em>index</em> <em>out</em> of <em>range</em> (1 > number of <em>parameter</em>s, which is 0). 错误发生原因其实很简单,就是当设置参数时,没有相应的问号与之匹配(或者根本就没有?号). 如果是:Parameter <em>index</em> <em>out</em> of <em>range</em>
mybatis Parameter index out of range (1 > number of parameters, which is 0)
今天遇到了一个有意思的问题,看错误信息提示,好像是有个参数没有匹配上,具体错误信息如下: ### SQL: SELECT count(*) FROM (SELECT * FROM testTable) table_count ; SQL []; Parameter <em>index</em> <em>out</em> of <em>range</em> (1 > number of <em>parameter</em>s, which is 0).; nest
Mybatis运行报错:Cause: java.sql.SQLException: Parameter index out of range解决方法
今天在调一个接口的时候,sql和实现方法都写好了,单元测试时报这个错误: Parameter <em>index</em> <em>out</em> of <em>range</em> (5 &amp;gt; number of <em>parameter</em>s, which is 4). 翻译过来就是sql里需要五个参数,但是只传了四个参数。纳尼?明明传了五个的,为什么少了一个呢? 仔细检查了下sql语句,发现问题应该出在了like这个地方:name like ...
mybatis查询报错Parameter index out of range (3 > number of parameters, which is 2).
&amp;lt;select id=&quot;getDistinctCompanyBusiness&quot; <em>parameter</em>Type=&quot;java.util.Map&quot; resultType=&quot;com.qy.insurance.ls.adjust.dto.company.CompanyStatisticsResponse&quot;&amp;gt; SELECT e.client_name...
关于ibatis的parameter index out of range (1 > number parameters which is 0).异常
说起来这个异常很坑爹啊,调试了一下午,数据一点都
Gridview删除的时候提示Index was out of range
[code=HTML]rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn[/code]rnrn[code=C#]rnprotected void Page_Load(object sender, EventArgs e)rn rn if (!IsPostBack)rn rn showdata(0);rn rn rnrn //显示数据rn protected void showdata(int pageIndex)rn rn SqlConnection sqlcon;rn string strCon = ConfigurationSettings.AppSettings["ConnectionString"];rn string sqlstr = "select * from tjnews where type='发表文章' or type='实验室活动'";rn sqlcon = new SqlConnection(strCon);rn SqlDataAdapter myda = new SqlDataAdapter(sqlstr, sqlcon);rn DataSet myds = new DataSet();rn sqlcon.Open();rn myda.Fill(myds, "tjnews");rn DataView view = myds.Tables["tjnews"].DefaultView;rn string sort = "date desc,id desc";rn view.Sort = sort;rnrn GridView1.DataKeyNames = new string[] "id" ;//不加这个不能执行"删除"功能rn GridView1.DataSource = view;rn GridView1.PageIndex = pageIndex;rn GridView1.DataBind();rn rnrn //翻页事件rn protected void fangye(object sender, GridViewPageEventArgs e)rn rn showdata(e.NewPageIndex);rn rnrn //提示rn protected void tishi(object sender, GridViewRowEventArgs e)rn rn //如果是绑定数据行 ,判断是否是数据行rn if (e.Row.RowType == DataControlRowType.DataRow)rn rn //当鼠标停留时更改背景色rn e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#00A9FF'");rn //当鼠标移开时还原背景色rn e.Row.Attributes.Add("onmouse<em>out</em>", "this.style.backgroundColor=c");rnrn if (e.Row.RowState == DataControlRowState.Normal || e.Row.RowState == DataControlRowState.Alternate)rn rn ((LinkButton)e.Row.Cells[6].Controls[0]).Attributes.Add("onclick", "javascript:return confirm('你确认要删除吗?')");rn rn rnrn //显示编号rn if (e.Row.RowIndex != -1)rn rn int id = e.Row.RowIndex + 1;rn e.Row.Cells[0].Text = id.ToString();rn rn rnrn //删除rn protected void RowDeleting(object sender, GridViewDeleteEventArgs e)rn rn GridViewRow row = GridView1.Rows[e.RowIndex];rnrn DataSet ds = new DataSet();rn string strcn = ConfigurationSettings.AppSettings["ConnectionString"];rn SqlConnection cn = new SqlConnection(strcn);rn cn.Open();rn string sql = "delete from tjnews where id ='" + int.Parse(GridView1.DataKeys[e.RowIndex].Value.ToString()) + "'";rn SqlCommand cm = new SqlCommand(sql, cn);rn cm.ExecuteNonQuery();//执行rn cn.Close();rnrn showdata(0);rn rn[/code]rnrn点击删除的时候会提示Index was <em>out</em> of <em>range</em>,在服务器上会,本地不会,请问是什么原因?
java.lang.StringIndexOutOfBoundsException: String index out of range: 116
at java.lang.String.checkBounds(String.java:402)rnat java.lang.String.(String.java:443)rnat jxl.biff.StringHelper.getString(StringHelper.java:164)rnat jxl.read.biff.WriteAccessRecord.(WriteAccessRecord.java:56)rnat jxl.read.biff.WorkbookParser.parse(WorkbookParser.java:821)rnat jxl.Workbook.getWorkbook(Workbook.java:237)rnat jxl.Workbook.getWorkbook(Workbook.java:198)rnat com.iedudata.action.AddStudentResultRecordAction.addExamResult(AddStudentResultRecordAction.java:454)rnat com.iedudata.action.AddStudentResultRecordAction.addStudentResultRecord(AddStudentResultRecordAction.java:89)rnat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rnat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rnat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rnat java.lang.reflect.Method.invoke(Method.java:597)rnat com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)rnat com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229)rnat com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)rnat com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rnat com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)rnat org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)rnat com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rnat com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rnat com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:167)rnat com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rnat com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rnat org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:83)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rnat org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:207)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rnat com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rnat com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:127)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rnat org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:107)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rnat org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:206)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rnat com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:115)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rnat com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:143)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:121) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rnat org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:170)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rnat com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:123)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rnat com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)rn
VB国家考试题集.exe下载
VB国家考试题集.exe VB国家考试题集.exe 相关下载链接:[url=//download.csdn.net/download/wzb413/2643042?utm_source=bbsseo]//download.csdn.net/download/wzb413/2643042?utm_source=bbsseo[/url]
android2.2系统内置音乐播放器代码下载
android2.2系统内置音乐播放器代码~~~~~~~~~~~~~~~~ 相关下载链接:[url=//download.csdn.net/download/csaa165648/3643620?utm_source=bbsseo]//download.csdn.net/download/csaa165648/3643620?utm_source=bbsseo[/url]
2010数学建模B题下载
2010数学建模B题上海世博会对经济的影响 相关下载链接:[url=//download.csdn.net/download/chenhaohui0574/4683070?utm_source=bbsseo]//download.csdn.net/download/chenhaohui0574/4683070?utm_source=bbsseo[/url]
我们是很有底线的