mysql 修改root密码提示1064语法错误问题解决

展开阅读全文

java总是提示mysql语法错误

04-03

[code=java]SQLLoader.execute("INSERT INTO user(counter,name,password,sex,age) VALUES("+Server.counter+","+user.getName()+","+user.getPassword()+ "," +user.getSex()+ ","+user.getAge()+");");[/code]rn这是我执行的代码 SQLLorader是Statement对象, 然后传入的Server.couter 是int型 后面4个都是 string型 ,我在sql里面确实创建了 user表, 字段也都建立了, 我想问是不是 我这句insert语句 错误?? SQL语句中 引入java变量 不能用这种形式?rnrn下面提示的“ace”字段 就是上面 getName的数据rncom.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'ace' in 'field list'rn at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)rn at java.lang.reflect.Constructor.newInstance(Unknown Source)rn at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)rn at com.mysql.jdbc.Util.getInstance(Util.java:386)rn at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4237)rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4169)rn at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2617)rn at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2778)rn at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2828)rn at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2777)rn at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:949)rn at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:795)rn at Server.receive.register(Server.java:135)rn at Server.receive.run(Server.java:96) 论坛

MySql 1064错误 函数

03-11

[code=sql]DELIMITER $$ rncreate FUNCTION GETVLINKHEAD(PFLAG VARCHAR(3), IFLAG VARCHAR(3) ) RETURNS VARCHAR(400)rnBEGIN rn DECLARE V_SQLHEAD VARCHAR(400) DEFAULT ''; rn DECLARE PRFLAG VARCHAR(3);rn DECLARE UFLAG VARCHAR(3);rn SET UFLAG = UPPER(IFLAG);rn SET PRFLAG = UPPER(PFLAG);rn IF (PRFLAG = 'ALL') and (UFLAG IN ('FJP', 'FJR', 'FJS') ) THENrn SET V_SQLHEAD= 'INSERT INTO CT_TP_SRZ_FJ(POLICYCODE, CASENUMBER, SCORES, CREATDATE, GRADE, OPERATWAY, INSURANCE, LINK) ';rn ELSE IF (PRFLAG = 'ALL') and ( UFLAG IN ('PLP', 'PLR', 'PLS')) THENrn SET V_SQLHEAD= 'INSERT INTO CT_TP_SRZ_PRMY(POLICYCODE, CASENUMBER, SCORES, CREATDATE, GRADE, OPERATWAY, INSURANCE, LINK) ';rn ELSE IF (PRFLAG = 'ALL') and (UFLAG IN ('TKP', 'TKR', 'TKS')) THENrn SET V_SQLHEAD= 'INSERT INTO CT_TP_SRZ_WY (POLICYCODE, CASENUMBER, SCORES, CREATDATE, GRADE, OPERATWAY, TYPE, WEIYUTYPE,LINK) ';rn else IF (PRFLAG = 'ONE') and (UFLAG IN ('FJP', 'FJR', 'FJS')) THENrn SET V_SQLHEAD= 'INSERT INTO TEMP_ONE_CT_TP_SRZ_FJ(POLICYCODE, CASENUMBER, SCORES, CREATDATE, GRADE, OPERATWAY, INSURANCE, LINK) ';rn ELSE IF (PRFLAG = 'ONE') and (UFLAG IN ('PLP', 'PLR', 'PLS')) THENrn SET V_SQLHEAD= 'INSERT INTO TEMP_ONE_CT_TP_SRZ_PRMY(POLICYCODE, CASENUMBER, SCORES, CREATDATE, GRADE, OPERATWAY, INSURANCE, LINK) ';rn ELSE IF (PRFLAG = 'ONE') and (UFLAG IN ('TKP', 'TKR', 'TKS')) THENrn SET V_SQLHEAD= 'INSERT INTO TEMP_ONE_CT_TP_SRZ_WY (POLICYCODE, CASENUMBER, SCORES, CREATDATE, GRADE, OPERATWAY, TYPE, WEIYUTYPE,LINK) ';rn END IF;rnRETURN (V_SQLHEAD); rnEND $$ [/code][img=https://img-bbs.csdn.net/upload/201403/11/1394504322_541666.jpg][/img] 论坛

没有更多推荐了,返回首页