Android Question [RESOLVED] jdbcSQL date Value '0000-00-00' can not be represented

sigster

Active Member
Licensed User
Longtime User
Hi

I am using jdbcSQL and mysql

when I try to get date I get this error


(SQLException) java.sql.SQLException: Value '0000-00-00' can not be represented as java.sql.Date



B4X:
                Dim adate As String = Crsr.GetString("VV_date")
                If adate = Null Then adate = ""
                row(8) = " " & adate
 
Last edited:

makis_best

Well-Known Member
Licensed User
Longtime User
I think this caused by JDBC, add zeroDateTimeBehavior=convertToNull at the end of the jdbc connection string.
That will fix the problem. Do something like this..
B4X:
jdbc:mysql://127.0.0.1:3306?zeroDateTimeBehavior=convertToNull
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…