Mapping MySQL Error Numbers to JDBC SQLState Codes
MySQL Error Number
MySQL Error Name
Legacy (X/open) SQLState
SQL Standard SQLState
1022
Er_dup_key
S1000
23000
Today, when I used Power Designer to reverse the database for the second time, I encountered a problem:
Unable to list the users.
[Microsoft] [odbc SQL Server Driver] [SQL Server] cannot predefine statements
SQLSTATE = 37000
SQL Server200
According to the definitions in the X/open and SQL access group SQL CAE specifications (1992), sqlerror returns the sqlstate value. The sqlstate value is a string containing five characters. The following table lists the drivers.ProgramIt can be the
I encountered this problem today,
Rs. getstring (4) is of the datetime type and is the default value.
Error:Cannot convert value '2017-00-00 00:00:00 'from Column 9 to timestamp.
Then I searched for the solution on the Internet as follows:
Document directory
Answer
Http://blog.csdn.net/pjchen/archive/2008/04/19/2308245.aspx
Use hibernate to connect to the database of mysql5. Since the table uses a datetime time period, the following
Java. SQL. sqlexception: cannot convert value
Use Hibernate to connect to the database of mysql5. Since the table uses a datetime time period, the following
Java. SQL. SQLException: Cannot convert value '2017-00-00 00:00:00 'from column 9 to TIMESTAMP.At com. mysql. jdbc. ResultSet.
In the MySQL database, the datetime type is used to store the time. When reading this field using JDBC, The resultset should be used. gettimestamp () to get a java. SQL. timestamp type data. In this case, neither resultset. getdate () nor resultset.
In the previous, encountered the use of ibatis operation of Oracle time accuracy lost, and yesterday encountered the JDBC Operation MySQL Time field problem, from the Internet to see the various styles of interpretation of these issues of the
When using resultset in MySQL development, both getstring () or getdate (), or GetObject, are thrown out title the exception. Check MySQL official Bug Advisory:It is because the MySQL preset is thrown out of the exception (exception) when the string
Use the datetime type to store the time in the MySQL database, use Resultset.gettimestamp () When reading this field in JDBC, and get a java.sql.Timestamp type of data. Neither resultset.getdate () nor resultset.gettime () can be used here, as the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.