Mysql JDBC URL parameters and exception issues

Source: Internet
Author: User

Today in writing the Java Project uses the

<select id= "Getplans"  parametertype= "HashMap"  resulttype= "HashMap" >         select            *         FROM              ' plan '         WHERE             isDelete=#{isDelete} AND nestId in              <foreach collection= "NestIds"  item= " Nestid " index=" index "                 open= "("  close= ")"  separator= "," >                 #{nestId}             </foreAch></select> 

Unfortunately, the background report is abnormal:

Java.sql.SQLException:Value ' 0000-00-00 00:00:00 ' can not is represented as Java.sql.Timestamp

It was discovered that the data table had a addtime of "0000-00-00 00:00:00", either MyBatis or hibernate, and that the valid date format was "2015-05-29 21:23:07".

At this point, you can:

<select id= "Getplans"  parametertype= "HashMap"  resulttype= "HashMap" >         SELECT             ' PlanId ',  ' type ',  ' planname ',  ' userId ',  ' nestid ',  ' userstatus ',  ' budgetstatus ',   ' budget ',  ' rule ',  ' isdelete '         FROM              ' plan '          WHERE            isDelete=#{isDelete}  and nestid in             < foreach collection= "Nestids"  item= "Nestid"  index= "index"                  open= "("  close= ")"  separator= "," >                 #{nestid}             </foreach>    </select>

But I can only use "*" in another SQL, so I can only find a workaround.

After viewing official documents and Baidu search.

Remember to use

Jdbc:mysql://localhost:3306/solr?characterencoding=utf-8&autoreconnect=true&failoverreadonly=false &Zerodatetimebehavior=converttonull&useunicode=true

Solve!

So I enclose the MySQL JDBC url parameter table for later use:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6D/BD/wKiom1VqsEmRUy6zAAZQCeG_O5E304.jpg "style=" float: none; "title=" 1.png "alt=" Wkiom1vqsemruy6zaazqceg_o5e304.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6D/BD/wKiom1VqsEqh7e1_AAZJ3Qppb7s164.jpg "style=" float: none; "title=" 2.png "alt=" Wkiom1vqseqh7e1_aazj3qppb7s164.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6D/B9/wKioL1VqseCwE4Y6AAafpyHLGGI141.jpg "style=" float: none; "title=" 3.png "alt=" Wkiol1vqsecwe4y6aaafpyhlggi141.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6D/BD/wKiom1VqsEri9QhIAAX5yrMTUpI793.jpg "style=" float: none; "title=" 4.png "alt=" Wkiom1vqseri9qhiaax5yrmtupi793.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6D/B9/wKioL1VqseCxUo0MAAZ3CRztq1E998.jpg "style=" float: none; "title=" 5.png "alt=" Wkiol1vqsecxuo0maaz3crztq1e998.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6D/BD/wKiom1VqsErhSFf5AAYgyok2GFs570.jpg "style=" float: none; "title=" 6.png "alt=" Wkiom1vqserhsff5aaygyok2gfs570.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6D/B9/wKioL1VqseGiqtDfAAaTO1LkgZ4057.jpg "style=" float: none; "title=" 7.png "alt=" Wkiol1vqsegiqtdfaaato1lkgz4057.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6D/BD/wKiom1VqsEuB1EsEAATJo_ozDOY259.jpg "style=" float: none; "title=" 8.png "alt=" Wkiom1vqseub1eseaatjo_ozdoy259.jpg "/>



This article is from the "dream to think XI" blog, please be sure to keep this source http://qiangmzsx.blog.51cto.com/2052549/1656852

Mysql JDBC URL parameters and exception issues

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.