Mostrando las entradas con la etiqueta java. Mostrar todas las entradas
Mostrando las entradas con la etiqueta java. Mostrar todas las entradas

miércoles, abril 23, 2008

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

These haterz at mysqlAB have changed the behaviour for MySQL Connector from 30 to the 3.1.x versions, now The Date column type cannot be mapped to a Date java Object when it is null, just because the null default value in mysql is not NULL, but '0000-00-00'

This is the message:

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

The mysql version is: 4.1.14
the MySQL Connector/J is: mysql-connector-java-3.1.6-bin.jar

The easy way of getting out of there and not get the exception is passing "zeroDateTimeBehavior=convertToNull" as a parameter to your jdbc url, like:

jdbc:mysql://kraftek.com/alox?zeroDateTimeBehavior=convertToNull

The hard way is to change your old code to passthrough that...

suckerz






Obtenido de:

http://www.kraftek.com/blog/index.php?/archives/
105-java.sql.SQLException-Value-0000-00-00-can-
not-be-represented-as-java.sql.Date.html

miércoles, marzo 07, 2007

Cómo cambiar el Look and Feel ???

Este es el código a modificar en tu main ( letras en negrita ) :

public static void main(String args[]) {

try{ UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName());
new Emergencia().setVisible(true);
}catch(Exception e){
JOptionPane.showMessageDialog(null,e, "Error",1);
}// fin de try & catch

}// fin de main

El look & feel q se mostrará es el q tengas en tu Windows :