求解答谢谢,mysql的Incorrect String value错误

CREATE FUNCTION f1() RETURNS VARCHAR(30)
RETURN DATA_FORMAT(NOW(),'%Y年%m月%d日 %H点:%i分:%s秒');
select f1();
然后就出现Incorrect String value错误

3个回答

创建函数的结构体·······

我测试了 没有报错 另外 是DATE_FORMATE

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
mysql复制粘贴中产生的问题
请问为什么我直接复制粘贴sql语句运行时,cmd串口提示以下错误,怎么改? #创建商品表 create table product( pid int primary key auto_increment, pname varchar(20), price double, pdate timestamp ) #自动增长列:auto_increment,要求:1,必须整型(int) 2.必须是主键 insert into product values (null,'谭妮平',0.01,null); insert into product values (null,'李士雪',38,null); insert into product values (null,'左慈',-998,null); insert into product values (null,'黄迎',99999,null); insert into product values (null,'南国强',99998,null); insert into product values (null,'士兵',1,null); insert into product values (null,'李士兵',698,null); cmd窗口提示的信息: mysql> create table product( -> pid int primary key auto_increment, -> pname varchar(20), -> price double, -> pdate timestamp -> ); Query OK, 0 rows affected (0.01 sec) mysql> insert into product values (null,'谭妮平',0.01,null); ERROR 1366 (HY000): Incorrect string value: '\xC4\xDD\xC6\xBD' for column 'pname ' at row 1 mysql> insert into product values (null,'李士雪',38,null); ERROR 1366 (HY000): Incorrect string value: '\xC0\xEE\xCA\xBF\xD1\xA9' for colum n 'pname' at row 1 mysql> insert into product values (null,'左慈',-998,null); ERROR 1366 (HY000): Incorrect string value: '\xD7\xF3\xB4\xC8' for column 'pname ' at row 1 mysql> insert into product values (null,'黄迎',99999,null); ERROR 1366 (HY000): Incorrect string value: '\xBB\xC6\xD3\xAD' for column 'pname ' at row 1 mysql> insert into product values (null,'南国强',99998,null); ERROR 1366 (HY000): Incorrect string value: '\xC4\xCF\xB9\xFA\xC7\xBF' for colum n 'pname' at row 1 mysql> insert into product values (null,'士兵',1,null); ERROR 1366 (HY000): Incorrect string value: '\xB1\xF8' for column 'pname' at row 1 mysql> insert into product values (null,'李士兵',698,null); ERROR 1366 (HY000): Incorrect string value: '\xC0\xEE\xCA\xBF\xB1\xF8' for colum n 'pname' at row 1 请问怎么回事?怎么解决?
c++向mysql插入string类数据出错
报错:插入 is failure ,error is :Incorrect string value: '\xF0\xC2!\xED2\x01' for column 'sname' at row 1 代码:#include<iostream> #include<string> #include<fstream> #include <iomanip> #include"windows.h" #include<mysql.h> #include<stdlib.h> using namespace std; int main(){ MYSQL mysql; mysql_init(&mysql); int t = 100; string a = "ticke"; if (!mysql_real_connect(&mysql, "localhost", "root", "hsy1019", "studentmanage", 3306, NULL, 0)) { cout << "\n数据库连接发生错误"; return 0; } else cout << "connect successfully"; int i = 0; //int res; char query[100]; cout << "学生信息为 学号 姓名" << "\n"; sprintf_s(query, "insert into studentg(sno,sname) values('%d','%s')", t,a); if (mysql_query(&mysql, query)) fprintf(stderr, "插入 is failure ,error is :%s\n", mysql_error(&mysql)); else puts("插入 success!"); //res = mysql_query(&mysql, "insert into studentg(sno,sname) values(stu[i].id,stu[i].name"); mysql_close(&mysql); system("pause"); return 1; }
mysql的问题。。。。jdbc保存到mysql
19:25:33,586 ERROR [STDERR] java.sql.SQLException: Incorrect string value: '\xEF\xBF\xBD' for column 'login_name' at row 1 19:25:33,586 ERROR [STDERR] at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2928) 19:25:33,586 ERROR [STDERR] at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1571) 19:25:33,586 ERROR [STDERR] at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1666) 报这个~~跪求大神
c#插入mysql报错 ????
Incorrect string value: '\xE7\xAD\xBE\xE7\xBD\xB2...' for column 'file_text' at row 1
java储存mysql乱码报错
我现在是都文本来储存数据库, 做的是记录搜索内容的东西, 可是如果搜索内容本身中就有乱码, 要如何解决 ![图片说明](https://img-ask.csdn.net/upload/201501/29/1422510333_754315.png) 比如这个图片,那个像L的东西, String line = new String(br.readLine().getBytes(), "ISO8859_1" ) 转utf-8 也没用 报这样的错 java.sql.SQLException: Incorrect string value: '\xF0\x9F\x91\x8C\xE8\xBF...' for column 'keyWord' at row 52
java更新mysql表内容出错
sql语句: public static void deleteUser(String loginName){ String sql = "update user set flag=3 where loginName= "+ loginName ; DBUtil.getInstance().delete(sql); } 错误信息: java.sql.SQLException: Data truncation: Truncated incorrect DOUBLE value: 'admin' Query: update user set flag=3 where loginName= 123654 Parameters: [] 不太懂是怎么错了
数据库已经改成utf8b4但Emoji表情符号录入MySQL数据库还是报错
数据库已经改成了utf8mb4了,数据库的列也改成utf8mb4, 但是插入表情还是报错: Caused by: java.sql.SQLException: Incorrect string value: '\xF0\x9F\x98\x97\xF0\x9F...' for column 'CONTENT' at row 1 数据库版本是5.5.57 jdbc驱动包版本是5.1.32 框架是spring mvc +mybatis+spring 下面是各种截图,求大神指教,求解决 ![图片说明](https://img-ask.csdn.net/upload/201802/27/1519700159_997619.png) ![图片说明](https://img-ask.csdn.net/upload/201802/27/1519700173_25418.png) ![图片说明](https://img-ask.csdn.net/upload/201802/27/1519700342_482356.png) ![图片说明](https://img-ask.csdn.net/upload/201802/27/1519700350_643143.png)
MySQL emoji 表情问题 Java大神请进
报错 严重: Servlet.service() for servlet [springMVC] in context with path [/travel] threw exception [Request processing failed; nested exception is org.springframework.jdbc.UncategorizedSQLException: ### Error updating database. Cause: java.sql.SQLException: Incorrect string value: '\xF0\x9F\x98\x82' for column 'requestURL' at row 1 ### The error may involve log.saveLog-Inline ### The error occurred while setting parameters ### SQL: INSERT INTO common_clientlog(clientIp,requestURL,timeConsuming,createTime) VALUES (?,?,?,NOW()) ### Cause: java.sql.SQLException: Incorrect string value: '\xF0\x9F\x98\x82' for column 'requestURL' at row 1 ; uncategorized SQLException for SQL []; SQL state [HY000]; error code [1366]; Incorrect string value: '\xF0\x9F\x98\x82' for column 'requestURL' at row 1; nested exception is java.sql.SQLException: Incorrect string value: '\xF0\x9F\x98\x82' for column 'requestURL' at row 1] with root cause java.sql.SQLException: Incorrect string value: '\xF0\x9F\x98\x82' for column 'requestURL' at row 1 at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1094) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4226) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4158) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2615) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2776) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2840) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2082) at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1302) at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172) at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172) at sun.reflect.GeneratedMethodAccessor38.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:55) at com.sun.proxy.$Proxy39.execute(Unknown Source) at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:41) at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:66) at sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:59) at com.sun.proxy.$Proxy37.update(Unknown Source) at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:45) at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:100) at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:75) at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:148) at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:137) at sun.reflect.GeneratedMethodAccessor50.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:358) at com.sun.proxy.$Proxy16.insert(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:240) at com.frontdo.travel.dao.impl.LogDaoImpl.saveObject(LogDaoImpl.java:27) at com.frontdo.travel.dao.impl.LogDaoImpl.saveObject(LogDaoImpl.java:1) at com.frontdo.travel.interceptor.AuthInterceptor.postHandle(AuthInterceptor.java:91) at org.springframework.web.servlet.HandlerExecutionChain.applyPostHandle(HandlerExecutionChain.java:149) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:928) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:851) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:855) at javax.servlet.http.HttpServlet.service(HttpServlet.java:646) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at com.frontdo.travel.filter.RequestParameterFilter.doFilter(RequestParameterFilter.java:45) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at com.frontdo.travel.filter.LoginFilter.doFilter(LoginFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) DEBUG[com.frontdo.travel.interceptor.AuthInterceptor]-信息:request /travel/action/sendOrgMessage,prcess time :1ms ![图片说明](https://img-ask.csdn.net/upload/201707/27/1501126993_996335.png) #本地环境 DBUrl=jdbc:mysql://localhost:3306/travel? my.ini文件 [client] # pipe # socket=0.0 port=3306 default-character-set = utf8mb4 [mysql] no-beep default-character-set=utf8mb4 [mysqld] # The next three options are mutually exclusive to SERVER_PORT below. # skip-networking # enable-named-pipe # shared-memory # shared-memory-base-name=MYSQL # The Pipe the MySQL Server will use # socket=MYSQL # The TCP/IP Port the MySQL Server will listen on port=3306 # Path to installation directory. All paths are usually resolved relative to this. # basedir="C:/Program Files/MySQL/MySQL Server 5.7/" # Path to the database root datadir=C:/ProgramData/MySQL/MySQL Server 5.7\Data # The default character set that will be used when a new schema or table is # created and no character set is defined character-set-server=utf8mb4 character-set-client-handshake = FALSE collation-server = utf8mb4_unicode_ci init_connect='SET NAMES utf8mb4' # The default storage engine that will be used when create new tables when default-storage-engine=INNODB # Set the SQL mode to strict sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" # Enable Windows Authentication # plugin-load=authentication_windows.dll # General and Slow logging. log-output=FILE general-log=0 general_log_file="DESKTOP-B37Q65G.log" slow-query-log=1 slow_query_log_file="DESKTOP-B37Q65G-slow.log" long_query_time=10 但就是还报错 ,请问 为什么?
什么导致SQLAlchemy访问数据库出现警告
``` from sqlalchemy import create_engine from consts import DB_URI eng = create_engine(DB_URI) with eng.connect() as con: con.execute('drop table if exists users') con.execute('create table users(Id INT PRIMARY KEY AUTO_INCREMENT, ' 'Name VARCHAR(25))') con.execute("insert into users(name) values('xiaoming')") con.execute("insert into users(name) values('wanglang')") rs = con.execute('select * from users') for row in rs: print row ``` consts.py的代码为(用python驱动可以正常连接数据库并操作): ``` HOSTNAME = 'localhost' DATABASE = 'john' USERNAME = 'root' PASSWORD = '123' DB_URI = 'mysql://{}:{}@{}/{}'.format(USERNAME, PASSWORD, HOSTNAME, DATABASE) ``` 出现如下警告: Python27\lib\site-packages\sqlalchemy\engine\default.py:469: Warning: Incorrect string value: '\xD6\xD0\xB9\xFA\xB1\xEA...' for column 'VARIABLE_VALUE' at row 479 cursor.execute(statement, parameters) (1L, 'xiaoming') (2L, 'wanglang') Process finished with exit code 0 数据库为mysql5.7版本 不明白为什么会出现警告,求大神解答!!
Python使用sqlalchemy进行查询显示warning但是数据无误
系统win10,64位,数据库mysql5.7.19,数据库驱动是pymysql0.7.11,数据库的配置文件里默认编码是utf8mb4,Python2.7 64位。执行的代码如下: ``` engine = create_engine('mysql+pymysql://root:password@localhost:3306/test?charset=utf8mb4') DBSession = sessionmaker(bind=engine) session = DBSession() res = session.execute("select * from user") session.close() ``` 虽然能够进行 相应的查询,包括增删查改也支持中文,数据也没有问题,但是每次操作都会有一次warning: ``` E:\Python2.7\lib\site-packages\pymysql\cursors.py:166: Warning: (1366, u"Incorrect string value: '\\xD6\\xD0\\xB9\\xFA\\xB1\\xEA...' for column 'VARIABLE_VALUE' at row 480") result = self._query(query) ``` 而我的数据根本没有480行,想知道这是为什么。数据库的编码设置如图所示: ![图片说明](https://img-ask.csdn.net/upload/201711/01/1509468443_49383.png) 谢谢大家!
mysql 在DOS窗口输入带中文的数据时报错,字符集问题
mysql 在DOS窗口输入带中文的数据时报错,知道是字符集问题,但都改成utf8了,求解这到底是怎么回事! mysql> show variables like '%character%'; +--------------------------+-------------------------------------------+ | Variable_name | Value | +--------------------------+-------------------------------------------+ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | I:\MySQL\MySQL Server 5.5\share\charsets\ | +--------------------------+-------------------------------------------+ 8 rows in set (0.00 sec) mysql> insert into student(id,name,chinese,english,math) values(5,'李来财',82,84,67); ERROR 1366 (HY000): Incorrect string value: '\xC0\xEE\xC0\xB4\xB2\xC6' for column 'name' at row 1 ![图片说明](https://img-ask.csdn.net/upload/201705/27/1495893197_369624.png)
mysql 中下面这个存储过程为什么错了?
delimiter @@ create procedure dolist9 () begin declare str1 , str2 varchar (20) ; declare results varchar (2000) def; declare flag boolean default true ; declare cur cursor for select name,homeaddr from baseinfo ; declare continue handler for not found set flag=false ; open cur ; while flag do fetch cur into str1 , str2 ; if (left(str1,1)='陈') then set results = concat(str1 ,str2) ; end if ; end while ; close cur ; select results ; end @@ delimiter ; baseinfo中已经有了name和homeaddr两列,一共是237行,运行call dolist9 时报错incorrect string value![图片说明](https://img-ask.csdn.net/upload/201706/07/1496842462_250520.png) name的类型是varchar(50) homeaddr类型是varchar(255) 但是varchar(20)是完全可以分别装下name列值和homeaddr列值的。 过程的作用是判断名字是不是姓陈然后把姓陈的人和住址连起来。 求大家帮我看看这个应该怎么改。先多谢大家!
JSP,mysql,tomcat,罕见中文乱码问题from textarea?
最近在上手学javaweb,根据书里的练习题要做一个雇员系统,其中有一项是用textarea输入雇员的简介,大概就是一个页面输入信息,然后通过submit传值到另一个页面用javabean 接收,接收方式是setProperties的自动设置,然后在数据库里更新信息。 然后最开始出现了类似Incorrect string value: '\xE6\xB1\x9F\xE5\xAE\x81...' for column ‘note' 的错误信息,所以我就尝试单独设置note,用iso8859-1解码再编码再设置,解码后就不再报错了,但是会出现乱码,而且不管我用任何编码方式都是乱码,并且其他text都没有乱码唯独textarea有。我尝试过GBK,UTF-8,重新用iso8859-1,甚至latin1都试过了还是乱码,我就佛了。 下面 是一些或许会有用的信息:数据库连接的url里相关信息是useUnicode=true&characterEncoding=GBK;request.setCharacterEncoding("GBK")或者UTF-8都试过,set和不set都试过,form是get和post都试过,JSP文件最上面那几个charset=UTF-8和=GBK都试过,数据库里character_set_client=gbk, character_set_connection=gbk, character_set_databse=latin1, character_set_filesystem=binary, character_set_results=gbk, character_set_server =latin1, character_set_system=utf8;然后还试过在textarea里加入属性style="word-break:break-all;word-wrap: break-word;",不过貌似是为了解决换行问题的,反正也是没用。噢,最后提一下,这个textarea的乱码不是一堆看不懂的字符,就是纯粹的???,不知道这个信息有没有用,希望有大神来解答一下小弟的问题,不胜感激。
Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource一直出现这个错误
Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 1hge15za2g5ilmr1c7l2tj|7ed94f02, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hge15za2g5ilmr1c7l2tj|7ed94f02, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://localhost:3306/store, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ] java.sql.SQLException: Incorrect string value: '\xAC\xED\x00\x05vr...' for column 'code' at row 1 Query: insert into user values(?,?,?,?,?,?,?,?,?,?) Parameters: [2B9A90A8D99A435AA2E8656C214D0B6D, tom, 123, 汤姆, tom@store.com, 2019-04-22, null, 0, 0, class com.yxd.domain.User] at org.apache.commons.dbutils.AbstractQueryRunner.rethrow(AbstractQueryRunner.java:320) at org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:489) at org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:455) at com.yxd.dao.impl.Userdaoimpl.save(Userdaoimpl.java:16) at com.yxd.service.impl.UserserviceImpl.regist(UserserviceImpl.java:16) at com.yxd.web.servlet.UserSerlet.regist(UserSerlet.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.yxd.web.servlet.base.BaseServlet.service(BaseServlet.java:25) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at com.yxd.web.filter.EncodingFilter.doFilter(EncodingFilter.java:36) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source) java.sql.SQLException: Incorrect string value: '\xAC\xED\x00\x05vr...' for column 'code' at row 1 Query: insert into user values(?,?,?,?,?,?,?,?,?,?) Parameters: [54CEE5255C0B4784B3541DBEA10E4D05, tom, 123, tom, tom@store.com, 2019-04-23, null, 0, 0, class com.yxd.domain.User] at org.apache.commons.dbutils.AbstractQueryRunner.rethrow(AbstractQueryRunner.java:320) at org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:489) at org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:455) at com.yxd.dao.impl.Userdaoimpl.save(Userdaoimpl.java:16) at com.yxd.service.impl.UserserviceImpl.regist(UserserviceImpl.java:16) at com.yxd.web.servlet.UserSerlet.regist(UserSerlet.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.yxd.web.servlet.base.BaseServlet.service(BaseServlet.java:25) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at com.yxd.web.filter.EncodingFilter.doFilter(EncodingFilter.java:36) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source) java.sql.SQLException: Incorrect string value: '\xAC\xED\x00\x05vr...' for column 'code' at row 1 Query: insert into user values(?,?,?,?,?,?,?,?,?,?) Parameters: [C6AA8C2093284CA7A0E8D11A6042F6F2, tom, 123, , , , null, null, 0, class com.yxd.domain.User] at org.apache.commons.dbutils.AbstractQueryRunner.rethrow(AbstractQueryRunner.java:320) at org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:489) at org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:455) at com.yxd.dao.impl.Userdaoimpl.save(Userdaoimpl.java:16) at com.yxd.service.impl.UserserviceImpl.regist(UserserviceImpl.java:16) at com.yxd.web.servlet.UserSerlet.regist(UserSerlet.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.yxd.web.servlet.base.BaseServlet.service(BaseServlet.java:25) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at com.yxd.web.filter.EncodingFilter.doFilter(EncodingFilter.java:36) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source) java.sql.SQLException: Incorrect string value: '\xAC\xED\x00\x05vr...' for column 'code' at row 1 Query: insert into user values(?,?,?,?,?,?,?,?,?,?) Parameters: [BF92CAFD61B64CCD935710E600A6AB47, tom, 123, 汤姆, tom@store.com, 2019-04-29, null, 1, 0, class com.yxd.domain.User] at org.apache.commons.dbutils.AbstractQueryRunner.rethrow(AbstractQueryRunner.java:320) at org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:489) at org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:455) at com.yxd.dao.impl.Userdaoimpl.save(Userdaoimpl.java:16) at com.yxd.service.impl.UserserviceImpl.regist(UserserviceImpl.java:16) at com.yxd.web.servlet.UserSerlet.regist(UserSerlet.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.yxd.web.servlet.base.BaseServlet.service(BaseServlet.java:25) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at com.yxd.web.filter.EncodingFilter.doFilter(EncodingFilter.java:36) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source)
node.js解析input中文报错
通过nodejs将html页面中的表单内容插入mysql数据库。当input文本框内输入的为英文或数字时完全正确,一旦输入中文,点击提交按钮,服务端显示错误"Incorrect String Value……' 现在检查,数据库所有的字符设置都已经为utf8。nodejs代码中也有req.setEncoding('utf8')。表单form标签中也有accept-charset="UTF-8"。node.js代码、html代码、浏览器编码全部为utf8。请问是哪里的错误导致nodejs不能解析input里的中文? 以下是我node.js的代码: ``` var http=require('http'); var mysql=require('mysql'); var qs=require('querystring'); var db=mysql.createConnection({ host:'127.0.0.1', user:'root', password:'12345', database:'datanews' }); var server=http.createServer(function(req,res){ switch (req.method) { case 'POST': switch (req.url) { case '/': addUser(db,req,res); break; } break; } }); server.listen(3000,'127.0.0.1'); function addUser(db,req,res) { var newData=''; req.setEncoding('utf8'); req.on( 'data', function(chunck){ newData+=chunck; } ); req.on( 'end', function () { var data=qs.parse(newData); db.query( "INSERT INTO userInfo(nickname,identify,password,gender,birthDay) "+ " VALUES(?,?,?,?,?)", [data.nickname,data.identify,data.password,data.gender,data.birthDay], function (err) { if (err) { throw err; } else{ console.log("seccussful"); var html='<p>注册成功</p>' toBrowser(res,html); } } ) } ) } function toBrowser(res,htmldata) { res.setHeader('Content-Type','text/html;charset=utf8'); res.setHeader('Content-Length',Buffer.byteLength(htmldata)); res.end(htmldata); } ```
mariadb数据库乱码,如何解决。
``` String driver ="org.mariadb.jdbc.Driver"; //从配置参数中获取数据库url String url = "jdbc:mariadb://127.0.0.1:3306/maria" + "?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull" +"&transformedBitIsBoolean=true"; //从配置参数中获取用户名 String user = "root"; //从配置参数中获取密码 String pass = "123"; //注册驱动 try { Class.forName(driver); //获取数据库连接 Connection conn = DriverManager.getConnection(url,user,pass); //创建Statement对象 Statement stmt = conn.createStatement(); //执行查询 boolean add = stmt.execute("insert into t_exhibition_user set name = '飞'," +"company = 'yuan',job = 'yuan',phone = '123345678909',is_buy_equipment = 'N'"); ``` 这是我向数据量添加数据的操作,添加失败。错误如下: ``` java.sql.SQLDataException: (conn=15) Incorrect string value: '\x9E' for column 'name' at row 1 at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:225) at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.getException(ExceptionMapper.java:165) at org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue(MariaDbStatement.java:238) at org.mariadb.jdbc.MariaDbStatement.executeInternal(MariaDbStatement.java:356) at org.mariadb.jdbc.MariaDbStatement.execute(MariaDbStatement.java:407) at com.ratta.supernote.note.MariadbAndMysql.main(MariadbAndMysql.java:30) Caused by: java.sql.SQLException: Incorrect string value: '\x9E' for column 'name' at row 1 Query is: insert into t_exhibition_user set name = '飞',company = 'yuan',job = 'yuan',phone = '123345678909',is_buy_equipment = 'N' java thread: main at org.mariadb.jdbc.internal.util.LogQueryTool.exceptionWithQuery(LogQueryTool.java:126) at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:222) at org.mariadb.jdbc.MariaDbStatement.executeInternal(MariaDbStatement.java:350) ... 2 more ``` 这里的中文导致添加数据失败,而如果使用如何代码则可以添加成功 ``` String driver ="com.mysql.jdbc.Driver"; //从配置参数中获取数据库url String url = "jdbc:mysql://127.0.0.1:3306/maria" + "?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull" +"&transformedBitIsBoolean=true"; //从配置参数中获取用户名 String user = "root"; //从配置参数中获取密码 String pass = "123"; //注册驱动 try { Class.forName(driver); //获取数据库连接 Connection conn = DriverManager.getConnection(url,user,pass); //创建Statement对象 Statement stmt = conn.createStatement(); //执行查询 boolean add = stmt.execute("insert into t_exhibition_user set name = '飞'," +"company = 'yuan',job = 'yuan',phone = '123345678909',is_buy_equipment = 'N'"); ``` 这是为什么呢?数据库是mariadb,数据库字符集如图: ![图片说明](https://img-ask.csdn.net/upload/201903/28/1553770326_818760.png) ![图片说明](https://img-ask.csdn.net/upload/201903/28/1553770341_26610.png) ![图片说明](https://img-ask.csdn.net/upload/201903/28/1553770354_62463.png) 现在不想改变数据库的字符,也不能使用MySQL的连接池驱动,如何才能将中文添成功。 useUnicode=true&characterEncoding=utf-8 这个配置常识过了,没效果。
struts+hibernate+mysql中文乱码问题
我在新增页面的时候,如是对象的某个属性为中文,就会抛下面那个异常,导致新增不成功 net.sf.hibernate.JDBCException: Could not execute JDBC batch update at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:129) at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2417) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2367) at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2236) at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61) Caused by: java.sql.BatchUpdateException: General error message from server: "Incorrect string value: '\xD6\xD0\xB9\xFA' for column 'url_name' at row 1" at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1492) at net.sf.hibernate.impl.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:54) at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:122) ... 31 more 如果程序中不输入中文就能新增成功; 如查数据库中某个表的某一属性是中文,然后显示在页面是????; 我在hibernate.cfg.xml里面配了<property name="connection.url">jdbc:mysql://localhost:3306/test?useUnicode=true&amp;characterEncoding=GB2312</property> 我的问题是,怎么去解决这个中文乱码问题,上网查了一会儿,试了几种方案都不行。所以来这问问了,请大家帮忙,谢谢!! [b]问题补充:[/b] 哥们,按你这样做不行呀 [b]问题补充:[/b] 我们那个项目是以前开发的,现在只是往里面加一些功能,但是以前开发的时候,采用的编码方式是gbk,我现在感觉问题是出在这。jsp文件,java文件,都是用的gbk,但是现在也没有办法去改呀,要转的话会出好多编码方面的错的,请教各位在这种情况下怎么去解决乱码问题 [b]问题补充:[/b] 大家帮我想,有什么好办法去解决 [b]问题补充:[/b] jh_soft哥们的意思是把页面传过来的每一个属性都要转一遍格式吗
python提交commit()错误
![图片说明](https://img-ask.csdn.net/upload/201803/15/1521126207_767529.png) 报错 C:\Python33\python.exe C:/Users/test/sql2.py C:\Python33\lib\site-packages\pymysql\cursors.py:165: Warning: (1366, "Incorrect string value: '\\xD6\\xD0\\xB9\\xFA\\xB1\\xEA...' for column 'VARIABLE_VALUE' at row 480") result = self._query(query) Traceback (most recent call last): File "C:\Python33\lib\site-packages\sqlalchemy\engine\base.py", line 1193, in _execute_context context) File "C:\Python33\lib\site-packages\sqlalchemy\engine\default.py", line 507, in do_execute cursor.execute(statement, parameters) File "C:\Python33\lib\site-packages\pymysql\cursors.py", line 165, in execute result = self._query(query) File "C:\Python33\lib\site-packages\pymysql\cursors.py", line 321, in _query conn.query(q) File "C:\Python33\lib\site-packages\pymysql\connections.py", line 860, in query self._affected_rows = self._read_query_result(unbuffered=unbuffered) File "C:\Python33\lib\site-packages\pymysql\connections.py", line 1061, in _read_query_result result.read() File "C:\Python33\lib\site-packages\pymysql\connections.py", line 1349, in read first_packet = self.connection._read_packet() File "C:\Python33\lib\site-packages\pymysql\connections.py", line 1018, in _read_packet packet.check_error() File "C:\Python33\lib\site-packages\pymysql\connections.py", line 384, in check_error err.raise_mysql_exception(self._data) File "C:\Python33\lib\site-packages\pymysql\err.py", line 107, in raise_mysql_exception raise errorclass(errno, errval) pymysql.err.IntegrityError: (1062, "Duplicate entry '7' for key 'PRIMARY'") The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:/Users/test/sql2.py", line 25, in <module> session.commit() File "C:\Python33\lib\site-packages\sqlalchemy\orm\session.py", line 937, in commit self.transaction.commit() File "C:\Python33\lib\site-packages\sqlalchemy\orm\session.py", line 461, in commit self._prepare_impl() File "C:\Python33\lib\site-packages\sqlalchemy\orm\session.py", line 441, in _prepare_impl self.session.flush() File "C:\Python33\lib\site-packages\sqlalchemy\orm\session.py", line 2237, in flush self._flush(objects) File "C:\Python33\lib\site-packages\sqlalchemy\orm\session.py", line 2363, in _flush transaction.rollback(_capture_exception=True) File "C:\Python33\lib\site-packages\sqlalchemy\util\langhelpers.py", line 66, in __exit__ compat.reraise(exc_type, exc_value, exc_tb) File "C:\Python33\lib\site-packages\sqlalchemy\util\compat.py", line 187, in reraise raise value File "C:\Python33\lib\site-packages\sqlalchemy\orm\session.py", line 2327, in _flush flush_context.execute() File "C:\Python33\lib\site-packages\sqlalchemy\orm\unitofwork.py", line 391, in execute rec.execute(self) File "C:\Python33\lib\site-packages\sqlalchemy\orm\unitofwork.py", line 556, in execute uow File "C:\Python33\lib\site-packages\sqlalchemy\orm\persistence.py", line 181, in save_obj mapper, table, insert) File "C:\Python33\lib\site-packages\sqlalchemy\orm\persistence.py", line 830, in _emit_insert_statements execute(statement, multiparams) File "C:\Python33\lib\site-packages\sqlalchemy\engine\base.py", line 948, in execute return meth(self, multiparams, params) File "C:\Python33\lib\site-packages\sqlalchemy\sql\elements.py", line 269, in _execute_on_connection return connection._execute_clauseelement(self, multiparams, params) File "C:\Python33\lib\site-packages\sqlalchemy\engine\base.py", line 1060, in _execute_clauseelement compiled_sql, distilled_params File "C:\Python33\lib\site-packages\sqlalchemy\engine\base.py", line 1200, in _execute_context context) File "C:\Python33\lib\site-packages\sqlalchemy\engine\base.py", line 1413, in _handle_dbapi_exception exc_info File "C:\Python33\lib\site-packages\sqlalchemy\util\compat.py", line 203, in raise_from_cause reraise(type(exception), exception, tb=exc_tb, cause=cause) File "C:\Python33\lib\site-packages\sqlalchemy\util\compat.py", line 186, in reraise raise value.with_traceback(tb) File "C:\Python33\lib\site-packages\sqlalchemy\engine\base.py", line 1193, in _execute_context context) File "C:\Python33\lib\site-packages\sqlalchemy\engine\default.py", line 507, in do_execute cursor.execute(statement, parameters) File "C:\Python33\lib\site-packages\pymysql\cursors.py", line 165, in execute result = self._query(query) File "C:\Python33\lib\site-packages\pymysql\cursors.py", line 321, in _query conn.query(q) File "C:\Python33\lib\site-packages\pymysql\connections.py", line 860, in query self._affected_rows = self._read_query_result(unbuffered=unbuffered) File "C:\Python33\lib\site-packages\pymysql\connections.py", line 1061, in _read_query_result result.read() File "C:\Python33\lib\site-packages\pymysql\connections.py", line 1349, in read first_packet = self.connection._read_packet() File "C:\Python33\lib\site-packages\pymysql\connections.py", line 1018, in _read_packet packet.check_error() File "C:\Python33\lib\site-packages\pymysql\connections.py", line 384, in check_error err.raise_mysql_exception(self._data) File "C:\Python33\lib\site-packages\pymysql\err.py", line 107, in raise_mysql_exception raise errorclass(errno, errval) sqlalchemy.exc.IntegrityError: (pymysql.err.IntegrityError) (1062, "Duplicate entry '7' for key 'PRIMARY'") [SQL: 'INSERT INTO user (id, name) VALUES (%(id)s, %(name)s)'] [parameters: {'id': '7', 'name': 'haha'}] (Background on this error at: http://sqlalche.me/e/gkpj) 进程已结束,退出代码1 虽然报错了,但数据库里还是插入了数据的
根据id修改多条数据的statu值,修改一条数据可以成功,修改多条就会失败
### 控制器方法 ![图片说明](https://img-ask.csdn.net/upload/201711/24/1511507543_911360.png) ### 服务实现类方法 ![图片说明](https://img-ask.csdn.net/upload/201711/24/1511507556_282065.png) ### 执行语句 ![图片说明](https://img-ask.csdn.net/upload/201711/24/1511507564_422131.png) ### 这是执行到语句报错 ### ==> Preparing: update student set statu = '1' where id in (?) ### ==> Parameters: 10575 , 10571(String) ### Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@6d77f8b4] ### 这是报错信息 ### Error updating database. Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: '10575 , 10571' ### The error may involve com.school.dao.StudentMapper.deleteById-Inline ### The error occurred while setting parameters ### SQL: update student set statu = '1' where id in (?) ### Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: '10575 , 10571' SQL []; Data truncation: Truncated incorrect DOUBLE value: '10575 , 10571'; nested exception is com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: '10575 , 10571'] with root cause com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: '10575 , 10571' at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4230) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4164) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2615) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2776) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2838) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2082) at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1307) at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:169) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:62) at com.sun.proxy.$Proxy28.execute(Unknown Source) at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:44) at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:69) at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:48) at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:105) at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:71) at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:152) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:358) at com.sun.proxy.$Proxy15.update(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.update(SqlSessionTemplate.java:254) at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:54) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:52) at com.sun.proxy.$Proxy19.deleteById(Unknown Source) at com.school.service.impl.StudentServiceImpl.deleteById(StudentServiceImpl.java:76) at com.school.controller.StudentCtrl.deleteById(StudentCtrl.java:57) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:690) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:945) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852) at javax.servlet.http.HttpServlet.service(HttpServlet.java:635) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837) at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1457) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)
爬虫福利二 之 妹子图网MM批量下载
爬虫福利一:27报网MM批量下载    点击 看了本文,相信大家对爬虫一定会产生强烈的兴趣,激励自己去学习爬虫,在这里提前祝:大家学有所成! 目标网站:妹子图网 环境:Python3.x 相关第三方模块:requests、beautifulsoup4 Re:各位在测试时只需要将代码里的变量 path 指定为你当前系统要保存的路径,使用 python xxx.py 或IDE运行即可。
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、PDF搜索网站推荐 对于大部
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 顺便拉下票,我在参加csdn博客之星竞选,欢迎投票支持,每个QQ或者微信每天都可以投5票,扫二维码即可,http://m234140.nofollow.ax.
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入  假设现有4个人
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 欢迎 改进 留言。 演示地点跳到演示地点 html代码如下`&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;music&lt;/title&gt; &lt;meta charset="utf-8"&gt
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。 1. for - else 什么?不是 if 和 else 才
数据库优化 - SQL优化
前面一篇文章从实例的角度进行数据库优化,通过配置一些参数让数据库性能达到最优。但是一些“不好”的SQL也会导致数据库查询变慢,影响业务流程。本文从SQL角度进行数据库优化,提升SQL运行效率。 判断问题SQL 判断SQL是否有问题时可以通过两个表象进行判断: 系统级别表象 CPU消耗严重 IO等待严重 页面响应时间过长
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 c/c++ 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7
通俗易懂地给女朋友讲:线程池的内部原理
餐厅的约会 餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”我楞了一下,心里想女朋友今天是怎么了,怎么突然问出这么专业的问题,但做为一个专业人士在女朋友面前也不能露怯啊,想了一下便说:“我先给你讲讲我前同事老王的故事吧!” 大龄程序员老王 老王是一个已经北漂十多年的程序员,岁数大了,加班加不动了,升迁也无望,于是拿着手里
经典算法(5)杨辉三角
写在前面: 我是 扬帆向海,这个昵称来源于我的名字以及女朋友的名字。我热爱技术、热爱开源、热爱编程。技术是开源的、知识是共享的。 这博客是对自己学习的一点点总结及记录,如果您对 Java、算法 感兴趣,可以关注我的动态,我们一起学习。 用知识改变命运,让我们的家人过上更好的生活。 目录一、杨辉三角的介绍二、杨辉三角的算法思想三、代码实现1.第一种写法2.第二种写法 一、杨辉三角的介绍 百度
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹
面试官:你连RESTful都不知道我怎么敢要你?
面试官:了解RESTful吗? 我:听说过。 面试官:那什么是RESTful? 我:就是用起来很规范,挺好的 面试官:是RESTful挺好的,还是自我感觉挺好的 我:都挺好的。 面试官:… 把门关上。 我:… 要干嘛?先关上再说。 面试官:我说出去把门关上。 我:what ?,夺门而去 文章目录01 前言02 RESTful的来源03 RESTful6大原则1. C-S架构2. 无状态3.统一的接
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看
SQL-小白最佳入门sql查询一
一 说明 如果是初学者,建议去网上寻找安装Mysql的文章安装,以及使用navicat连接数据库,以后的示例基本是使用mysql数据库管理系统; 二 准备前提 需要建立一张学生表,列分别是id,名称,年龄,学生信息;本示例中文章篇幅原因SQL注释略; 建表语句: CREATE TABLE `student` ( `id` int(11) NOT NULL AUTO_INCREMENT, `
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // dosho
【图解经典算法题】如何用一行代码解决约瑟夫环问题
约瑟夫环问题算是很经典的题了,估计大家都听说过,然后我就在一次笔试中遇到了,下面我就用 3 种方法来详细讲解一下这道题,最后一种方法学了之后保证让你可以让你装逼。 问题描述:编号为 1-N 的 N 个士兵围坐在一起形成一个圆圈,从编号为 1 的士兵开始依次报数(1,2,3…这样依次报),数到 m 的 士兵会被杀死出列,之后的士兵再从 1 开始报数。直到最后剩下一士兵,求这个士兵的编号。 1、方
致 Python 初学者
文章目录1. 前言2. 明确学习目标,不急于求成,不好高骛远3. 在开始学习 Python 之前,你需要做一些准备2.1 Python 的各种发行版2.2 安装 Python2.3 选择一款趁手的开发工具3. 习惯使用IDLE,这是学习python最好的方式4. 严格遵从编码规范5. 代码的运行、调试5. 模块管理5.1 同时安装了py2/py35.2 使用Anaconda,或者通过IDE来安装模
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,
程序员:我终于知道post和get的区别
IT界知名的程序员曾说:对于那些月薪三万以下,自称IT工程师的码农们,其实我们从来没有把他们归为我们IT工程师的队伍。他们虽然总是以IT工程师自居,但只是他们一厢情愿罢了。 此话一出,不知激起了多少(码农)程序员的愤怒,却又无可奈何,于是码农问程序员。 码农:你知道get和post请求到底有什么区别? 程序员:你看这篇就知道了。 码农:你月薪三万了? 程序员:嗯。 码农:你是怎么做到的? 程序员:
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
      11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1
程序员把地府后台管理系统做出来了,还有3.0版本!12月7号最新消息:已在开发中有github地址
第一幕:缘起 听说阎王爷要做个生死簿后台管理系统,我们派去了一个程序员…… 996程序员做的梦: 第一场:团队招募 为了应对地府管理危机,阎王打算找“人”开发一套地府后台管理系统,于是就在地府总经办群中发了项目需求。 话说还是中国电信的信号好,地府都是满格,哈哈!!! 经常会有外行朋友问:看某网站做的不错,功能也简单,你帮忙做一下? 而这次,面对这样的需求,这个程序员
网易云6亿用户音乐推荐算法
网易云音乐是音乐爱好者的集聚地,云音乐推荐系统致力于通过 AI 算法的落地,实现用户千人千面的个性化推荐,为用户带来不一样的听歌体验。 本次分享重点介绍 AI 算法在音乐推荐中的应用实践,以及在算法落地过程中遇到的挑战和解决方案。 将从如下两个部分展开: AI 算法在音乐推荐中的应用 音乐场景下的 AI 思考 从 2013 年 4 月正式上线至今,网易云音乐平台持续提供着:乐屏社区、UGC
【技巧总结】位运算装逼指南
位算法的效率有多快我就不说,不信你可以去用 10 亿个数据模拟一下,今天给大家讲一讲位运算的一些经典例子。不过,最重要的不是看懂了这些例子就好,而是要在以后多去运用位运算这些技巧,当然,采用位运算,也是可以装逼的,不信,你往下看。我会从最简单的讲起,一道比一道难度递增,不过居然是讲技巧,那么也不会太难,相信你分分钟看懂。 判断奇偶数 判断一个数是基于还是偶数,相信很多人都做过,一般的做法的代码如下
日均350000亿接入量,腾讯TubeMQ性能超过Kafka
整理 | 夕颜出品 | AI科技大本营(ID:rgznai100) 【导读】近日,腾讯开源动作不断,相继开源了分布式消息中间件TubeMQ,基于最主流的 OpenJDK8开发的
8年经验面试官详解 Java 面试秘诀
    作者 | 胡书敏 责编 | 刘静 出品 | CSDN(ID:CSDNnews) 本人目前在一家知名外企担任架构师,而且最近八年来,在多家外企和互联网公司担任Java技术面试官,前后累计面试了有两三百位候选人。在本文里,就将结合本人的面试经验,针对Java初学者、Java初级开发和Java开发,给出若干准备简历和准备面试的建议。   Java程序员准备和投递简历的实
面试官如何考察你的思维方式?
1.两种思维方式在求职面试中,经常会考察这种问题:北京有多少量特斯拉汽车? 某胡同口的煎饼摊一年能卖出多少个煎饼? 深圳有多少个产品经理? 一辆公交车里能装下多少个乒乓球? 一
相关热词 c# 二进制截断字符串 c#实现窗体设计器 c#检测是否为微信 c# plc s1200 c#里氏转换原则 c# 主界面 c# do loop c#存为组套 模板 c# 停掉协程 c# rgb 读取图片
立即提问