sql error: data types

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    #16
    Originally posted by cypriot
    I did as you said. I still get errors. I was getting undefined function errors 'nameinput.getT ext' and now I get insert syntax error.
    Code:
    public void AddPatient()
             {
    
                 
                 
                try{
    	             
    	     Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    	     
    	       con= DriverManager.getConnection(url);
    	     
    String sqlStatement = "INSERT INTO PatientDB(PatientID,Name,Surname,Phoneno,Dateofbirth,Complaint) VALUES("+numberinput.getText()+",'"+nameinput.getText()+"','"+surnameinput.getText()+"',"+phoneinput.getText()+","+dateofbirth.getText()+"'"+textpane.getText()+"')";
          st= con.createStatement();
                
            st.execute(sqlStatement);
    
    	       con.close();

    Ok!
    These type of expression I don't know you getting from.
    Make sure that whether your Syntax is Ok or not.

    Kind regards,
    Dmjpro.

    Comment

    Working...