私は以下の例外java.lang.NumberFormatException:ForInputString "7110332507339" ます。java.sql.SQLException:インデックスでINまたはOUTパラメーターの欠落:: 4
1)java.lang.NumberFormatException:ForInputString」 7110332507339"
2)ます。java.sql.SQLException:でも私は、入力時に正しいデータを与えているインデックス:: 4
でINまたはOUTパラメータがありません。私はこれを解決するために多くを検索しましたが、まだ例外を取得しています。ここで私のcode.myデータベースの列は、データ型でも写真に添付されます 誰も私に解決策を提案することはできますか?おかげ
try{
Class.forName("oracle.jdbc.OracleDriver");
try (Connection conn =
DriverManager.getConnection(
"jdbc:oracle:thin:@localhost:1521:XE","hr","123"))
{
String qry1 = "insert into storeStaff
values(?,?,?,?,?,?,?,?,?)";
try {
pstmnt=conn.prepareStatement(qry1);
String EID=employeID.getText();
pstmnt.setString(1,EID);
String ename=name.getText();
pstmnt.setString(2,ename);
String efname=fatherName.getText();
pstmnt.setString(3,efname);
try{ String emcnic=cnic.getText();
int ecnic=Integer.parseInt(emcnic);
pstmnt.setInt(4,ecnic);}catch(Exception q)
{JOptionPane.showMessageDialog(null,q);}
String edob=dob.getText();
pstmnt.setString(5,edob);
String adress=address.getText();
pstmnt.setString(6,adress);
username.setText(EID);
pstmnt.setString(7,EID);
String pwd=password.getText();
pstmnt.setString(8,pwd);
String post=facultyChoice.getItem(facultyChoice.getSelectedIndex());
pstmnt.setString(9,post);
pstmnt.executeQuery();
if(EID!= null && ename!=null
&& efname!=null &&edob!=null && adress!=null && post!=null){
JOptionPane.showMessageDialog(null, "Added");
}
} catch (SQLException eex)
{JOptionPane.showMessageDialog(null,"Error"+eex);}}
} catch (SQLException exx)
{JOptionPane.showMessageDialog(null,"Error"+exx);} catch
(ClassNotFoundException ex) {
JOptionPane.showMessageDialog(null,"Error"+ex);
}}
の列に文字列を挿入しているためであるあなたは、データ型とデータベース列を追加してくださいすることができあなたの質問に? – sForSujit
質問を編集した後に画像に追加されました@sForSujit –
ありがとうございます、私はそれを調べます – sForSujit