我正在尝试将用户输入的数据插入数据库,但是收到错误“语法错误:遇到”[“第1行第160行”。这是我的代码,我做错了什么?`
pdat$Cap<-NULL
pdat$Lab<-NULL
pdat2 <- na.omit(pdat)
pdat2$FV_Log <- (Model1$model[[1]] - Model1$residuals)
and run my model2 using data=pdat2 but the following error message comes up.
Model2<-plm(log(GL)~ Cap.lag.ln + Cap.2lag.ln + Lab.ln + Lab.lag.ln
+ FV_Log, data=pdat2, model = "within")
**Error in model.matrix.pFormula(formula, data, rhs = 1, model = model, :
NA in the individual index variable
In addition: Warning message:
In `[.data.frame`(index, as.numeric(rownames(mf)), ) :
NAs introduced by coercion**
答案 0 :(得分:1)
可以将查询更改为此内容吗?
sql = "INSERT INTO Customer (FNAME, LNAME, AGE, LICNUM, STATE, CAR_TYPE, RENTDATE, RETURNDATE, TOTAL, PAYTYPE, RETURNED) VALUES('"+f_name.getText()+"','"+l_name.getText()+"','"+Age+"','"+liscense_num.getText()+"','"+issuing.getText()+"','"+car_select.getToolkit()+"','"+rental.getText()+"','"+return_d.getText()+"','"+total.getText()+"','"+button_val.getText()+"','true') ";
答案 1 :(得分:0)
--Not an answer:
java.sql.SQLSyntaxErrorException: Syntax error: Encountered "[" at line 1, column 160.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
at Auto.actionPerformed(Auto.java:381)
at java.awt.Button.processActionEvent(Unknown Source)
at java.awt.Button.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: ERROR 42X01: Syntax error: Encountered "[" at line 1, column 160.
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at org.apache.derby.impl.sql.compile.ParserImpl.parseStatementOrSearchCondition(Unknown Source)
at org.apache.derby.impl.sql.compile.ParserImpl.parseStatement(Unknown Source)
at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source)
at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)
at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown Source)
... 25 more