Hi. I want to insert data to ms access from an application I developed in java but I think I have a prob with data types.
This is my code.
[code]
savebutton.addA ctionListener( new ActionListener( )
{
public void actionPerformed (ActionEvent e)
{
try{
Class.forName(" sun.jdbc.odbc.J dbcOdbcDriver") ;
con= DriverManager.g etConnection(ur l);
String sqlStatement = "INSERT INTO PatientDB(Patie ntID,Name,Surna me,Phoneno,Date ofbirth,Complai nt) values(numberin put.getInteger( ),nameinput.get Text( ),surnameinput. getText(),phone input.getIntege r(),d ateofbirthinput .getInteger(),t ext.getText())" ;
PreparedStateme nt pstmt = con.prepareStat ement(sqlStatem ent);
pstmt.executeUp date();
con.close();
}
catch(ClassNotF oundException ex)
{}
catch(SQLExcept ion ex)
{
ex.printStackTr ace();
}
}
});
[\code]
[error]
Hi. I want to insert data to ms access but I think I have a prob with data types.
This is my code.
[code]
savebutton.addA ctionListener( new ActionListener( )
{
public void actionPerformed (ActionEvent e)
{
try{
Class.forName(" sun.jdbc.odbc.J dbcOdbcDriver") ;
con= DriverManager.g etConnection(ur l);
String sqlStatement = "insert into PatientDB(Patie ntID,Name,Surna me,Phoneno,Date ofbir th,Complaint) values(numberin put.getInteger( ),nameinput.get Text( ),surnameinput. getText(),phone input.getIntege r(),d ateofbirthinput .getInteger(),t et.getText())";
PreparedStateme nt pstmt = con.prepareStat ement(sqlStatem ent);
pstmt.executeUp date();
con.close();
}
catch(ClassNotF oundException ex)
{}
catch(SQLExcept ion ex)
{
ex.printStackTr ace();
}
}
});
[\code]
[error]
java.sql.SQLExc eption: [Microsoft][ODBC Microsoft Access Driver] Undefined function 'numberinput.ge tText' in expression.
[\error]
[\error]
This is my code.
[code]
savebutton.addA ctionListener( new ActionListener( )
{
public void actionPerformed (ActionEvent e)
{
try{
Class.forName(" sun.jdbc.odbc.J dbcOdbcDriver") ;
con= DriverManager.g etConnection(ur l);
String sqlStatement = "INSERT INTO PatientDB(Patie ntID,Name,Surna me,Phoneno,Date ofbirth,Complai nt) values(numberin put.getInteger( ),nameinput.get Text( ),surnameinput. getText(),phone input.getIntege r(),d ateofbirthinput .getInteger(),t ext.getText())" ;
PreparedStateme nt pstmt = con.prepareStat ement(sqlStatem ent);
pstmt.executeUp date();
con.close();
}
catch(ClassNotF oundException ex)
{}
catch(SQLExcept ion ex)
{
ex.printStackTr ace();
}
}
});
[\code]
[error]
Hi. I want to insert data to ms access but I think I have a prob with data types.
This is my code.
[code]
savebutton.addA ctionListener( new ActionListener( )
{
public void actionPerformed (ActionEvent e)
{
try{
Class.forName(" sun.jdbc.odbc.J dbcOdbcDriver") ;
con= DriverManager.g etConnection(ur l);
String sqlStatement = "insert into PatientDB(Patie ntID,Name,Surna me,Phoneno,Date ofbir th,Complaint) values(numberin put.getInteger( ),nameinput.get Text( ),surnameinput. getText(),phone input.getIntege r(),d ateofbirthinput .getInteger(),t et.getText())";
PreparedStateme nt pstmt = con.prepareStat ement(sqlStatem ent);
pstmt.executeUp date();
con.close();
}
catch(ClassNotF oundException ex)
{}
catch(SQLExcept ion ex)
{
ex.printStackTr ace();
}
}
});
[\code]
[error]
java.sql.SQLExc eption: [Microsoft][ODBC Microsoft Access Driver] Undefined function 'numberinput.ge tText' in expression.
[\error]
[\error]
Comment