Microservice d'avenir Spring Cloud Alibaba de l'entrée au dossier d'apprentissage avancé du chapitre 5

Microservice d'avenir Spring Cloud Alibaba de l'entrée au niveau avancé

J'ai récemment enregistré le processus d'apprentissage au cours de Xuemukenet


Below are the methods of Object class :
public final void java.lang.Object.wait() throws java.lang.InterruptedException
public final void java.lang.Object.wait(long,int) throws java.lang.InterruptedException
public final native void java.lang.Object.wait(long) throws java.lang.InterruptedException
public boolean java.lang.Object.equals(java.lang.Object)
public java.lang.String java.lang.Object.toString()
public native int java.lang.Object.hashCode()
public final native java.lang.Class java.lang.Object.getClass()
public final native void java.lang.Object.notify()
public final native void java.lang.Object.notifyAll()

/**
 *PreparedStatement绑定日期参数的时候,如果传入的是 java.util.Date,则会抛出如下异常
*  Caused by: java.lang.ClassCastException: java.util.Date cannot be cast to java.sql.Date
*/
ps.setDate(2, (java.sql.Date) startDate);//抛异常
ps.setDate(2, new java.sql.Date(startDate.getTime()));//正确方法

Je suppose que tu aimes

Origine blog.51cto.com/14994690/2550337
conseillé
Classement