【发布时间】:2018-07-31 09:50:17
【问题描述】:
你好我不知道如何将日期从 JDateChooser 插入 mysql 转换为接受 mysql 的格式...... 我正在使用 MVC fremework ...并且我正在以下列方式插入数据 ....
是我的驱动类
添加一个 jtxfile 只是为了尝试使用我的应用程序调用它
txtFecha2 (this.vistaAlumno.getTxtFecha2().getText())
在视图中,我为每个组件设置了 GET 和 SET 方法,以便我可以从另一个类中使用它们...
JDateChooser 称为 jdFecha。
public void actionPerformed(ActionEvent e) {
if (e.getSource() == vistaAlumno.getBtnInsertar()) {
//obtiene ID de producto this.mimodelo.getDatosVentaxFechas( this.frmconsulta.__fecha1.getDate(), this.frmconsulta.__fecha2.getDate() ) );
//String cat[] = this.vistaAlumno.__lista_categorias.getSelectedItem().toString().split("-");
if (this.modeloAlumno.NuevoProducto(
this.vistaAlumno.getTxtMatricula().getText(),
this.vistaAlumno.getTxtNombre().getText(),
this.vistaAlumno.getTxtApellido_p().getText(),
this.vistaAlumno.getTxtApellido_m().getText(),
this.vistaAlumno.getTxtSexo().getText(),
this.vistaAlumno.getTxtFecha2().getText(),
this.vistaAlumno.getTxtDireccion().getText(),
this.vistaAlumno.getTxtCorreo().getText()// ,
// cat[0].trim()
)) {
this.vistaAlumno.getJtDatosAlumno().setModel(this.modeloAlumno.getTablaAlumno()); //actualiza JTable
JOptionPane.showMessageDialog(null, "Nuevo Alumno Registrado");
} else {
JOptionPane.showMessageDialog(null, "Error: Verifique los datos del nuevo Alumno");
}
您好,非常感谢
【问题讨论】:
标签: java c# mysql sql jdatechooser