技术标签: java MySQL mysql jdbc 数据库 sql
Exception in thread "main" java.sql.SQLException: The server time zone value '�й���ʱ��' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:76)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:835)
at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:455)
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240)
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at jdbc.Example01.main(Example01.java:14)
Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value '�й���ʱ��' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:85)
at com.mysql.cj.util.TimeUtil.getCanonicalTimezone(TimeUtil.java:132)
at com.mysql.cj.protocol.a.NativeProtocol.configureTimezone(NativeProtocol.java:2243)
at com.mysql.cj.protocol.a.NativeProtocol.initServerSession(NativeProtocol.java:2267)
at com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:1319)
at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:966)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:825)
... 6 more
package jdbc;
import javax.xml.crypto.Data;
import java.sql.*;
public class Example01 {
public static void main(String[] args)throws SQLException{
//注册数据库驱动
DriverManager.registerDriver(new com.mysql.cj.jdbc.Driver());
//通过DriverManager获取连接
String url = "jdbc:mysql://localhost:3306/chapter01";
String name = "root";
String password = "2001";
Connection connection = DriverManager.getConnection(url,name,password);
//获取Connection对象获取Statement对象
Statement statement = connection.createStatement();
//执行SQl语句
String sql = "select * from users";
ResultSet resultSet = statement.executeQuery(sql);
//操作ResultSet
System.out.println("id|name|password|email|birthday");
while (resultSet.next()){
int id = resultSet.getInt("id");
String name1 = resultSet.getString("name");
String password1 = resultSet.getString("password");
String email = resultSet.getString("emil");
Date birthday = resultSet.getDate("brithday");
System.out.println(id+"|"+name1+"|"+password1+"|"+email+"|"+birthday);
}
resultSet.close();
statement.close();
connection.close();
}
}
将第十一行代码修改路由后面的添加
?serverTimezone=GMT%2B8
变成
String url = "jdbc:mysql://localhost:3306/chapter01?serverTimezone=GMT%2B8";
总从自学python之后就没有使用过了,但是课程学到了,一年后又重新捡起了python。最近迷上小说,但是奈何钱包薄,只能平时上盗版网站瞅瞅(关爱作者,支持正版,平时好看的小说wo)
托管代码托管代码(Managed Code)实际上就是中间语言(IL)代码。代码编写完毕后进行编译,此时编译器把代码编译成中间语言(IL),而不是能直接在你的电脑上运行的机器码。程序集(Assembly)的文件负责封装中间语言,程序集中包含了描述所创建的方法、类以及属性的所有元数据。托管代码在公共语言运行库(CLR)中运行。这个运行库给运行代码提供了多种服务,通常来说,公共语言运行..._1671465600
手里的单片机是gd32f103ret6,晶振和官方库默认的8M不一致,导致串口乱码。网上找了好久全是STM32的例子,不过还是有参考意义的。以下是gd32f10x 的设置方式。1.Keil中的Target设置:PS:这一项好像会自动设置,安全起见检查一下2. "gd32f10x.h" 中的 HXTAL_VALUE 修改。注意:gd32f10x.h默认是...
Javascript默认没有编加密解密函数,需要手动编写。如下是完整的字符串加解密函数,用到charCodeAt()、fromCharCode()和encodeURIComponent()函数。先上代码,三个函数说明请看后面。/** * 加密函数 * @param str 待加密字符串 * @returns {string} */function str_encrypt(s...
glibc版本2.34,kernel版本4.20以read为例,声明在/usr/include/unistd.h中,定义在glibc/sysdeps/unix/sysv/linux/read.c中。
经济学包括两个一级学科,理论经济学和应用经济学,金融学是应用经济学下的二级学科以下是我国的学科体系:一级学科:0201 理论经济学二级学科: 020101 政治经济学 020102 经济思想史 020103 经济史 020104 西方经济学 020105 世界经济 020106 人口、资源与环境经济学一级学科:0202 应用经济学二级学科: 020201 国民经济学 ...
学习《netty权威指南时》发现有的代码有误,我都更正了一下,可运行的代码可以访问我的github:https://github.com/wangdecheng/mycodes/tree/master/src/main/java/netty
DAC8563是TI的低功耗、电压输出、双通道、16位数据转换器(DAC)。其包括一个2.5V,4ppm/℃内部基准,提供2.5V或者5V的满量程输出电压范围。内部基准具有 ±5mV 的初始精度,并且可以提供或吸收高达VREFIN/VREFOUT 引脚为 20 mA。这些器件是单调的,可提供出色的线性度并最大限度地减少不需要的代码间瞬态电压(毛刺)。它们使用以高达 50 MHz 的时钟速率运行的多功能三线串行接口。该接口与标准 SPI、QSPI、Microwire 和数字信号处理器 (DSP) 等接口兼容。
第一章 信息收集1.1 收集域名信息1.1.1 Whois查询1.1.2 备案信息查询1.2 收集敏感信息1.3 收集子域名信息1、子域名检测工具2、搜索引擎枚举3、第三方聚合应用枚举4、证书透明度公开日志枚举1.4 收集常用端口信息1.5 指纹识别1.6 查找真实IP1、目标服务器存在CDN2、判断目标是否使用了CDN3、绕过CDN寻找真实IP4、验证获取的IP1.7 收集敏感文件目录1.8 社会工程学1.1 收集域名信息1.1.1 Whois查询https://whois.aizhan.com
在Android平台上开发可能没有真机的时候,我们通过DDMS中载入kml或nmea文件来模拟生产数据,使用方法参考 新版ADT插件让Android开发更人性化 一文,最终这两个文件加载到/data/misc/location/gps/nmea或/data/misc/location/gps/kml/一、kml文件其实是一个XML文件,我们看下kml文件结构1065 Brea Mall, Brea...
百度、美团 includedhttp://www.cnblogs.com/chhuach2005/p/4005402.html一、开篇:9月底,找工作接近尾声,笔者主要经历了百度、阿里、腾讯、美团、趋势科技、大众点评、华为的笔试、面试,其中拿到百度、美团、趋势科技、华为的软件研发offer。找工作是幸苦的,笔者曾一天来回跑面百度、大众点评、趋势科技三家公司。一天面试...
The embeded system is a sophisticated system consisting of several hardware and software componets,and its design may be serveral times more complex than that of a PC and the programs running on