Note that there are some explanatory texts on larger screens.

plurals
  1. POproblem in finding the data
    text
    copied!<p>while i am finding the data the field of <code>TelephoneNo</code> showing the result in float like 54435435.0.even when i inserted this phone no as 54435435 my code is</p> <pre><code> String findby =cbfind.getSelectedItem().toString(); if(findby.equals("")){ JOptionPane.showMessageDialog(null," SELECT EITHER REGISTRATION NO OR NAME"); return; } if(findby.equals("RegNo")) { int regno1= Integer.parseInt(cbregn.getSelectedItem().toString()); try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); System.out.println("\n Driver loaded"); Connection con=DriverManager.getConnection("jdbc:odbc:wanisamajDB"); Statement stmt=con.createStatement(); ResultSet rs = stmt.executeQuery("SELECT * FROM REGISTRATION1 WHERE RegistrationNo="+regno1); System.out.println("Hi"); rs.next(); String per = rs.getString("SeniorPerson"); System.out.println("SeniorPerson: " + per ); String reg = rs.getString("RegistrationNo"); System.out.println("RegistrationNo: " + reg); String nplace = rs.getString("NativePlace"); System.out.println("NativePlace: " + nplace); String kul = rs.getString("Kul"); System.out.println("Kul: " + kul); String gtr = rs.getString("Gotra"); System.out.println("Gotra: " + gtr); String ksami = rs.getString("KulSwami"); System.out.println("KulSwami: " + ksami); String raddr = rs.getString("ResidensialAddress"); System.out.println("ResidensialAddress: " + raddr); String code = rs.getString("PinCode"); System.out.println("PinCode: " + code); String stdcd = rs.getString("STDcode"); System.out.println("STDcode: " + stdcd); String teleno = rs.getString("TelephoneNo"); System.out.println("TelephoneNo: " + teleno); String mno = rs.getString("MobileNo"); System.out.println("MobileNo: " + mno); String email = rs.getString("Email"); System.out.println("Email: " + email); String web = rs.getString("Website"); System.out.println("Website: " + web); String educ = rs.getString("Education"); System.out.println("Education: " + educ); String brch = rs.getString("Branch"); System.out.println("Branch: " + brch); String bgrp = rs.getString("BloodGroup"); System.out.println("BloodGroup: " + bgrp); JOptionPane.showMessageDialog(null, "RECORD FOUND"); cbnm.setSelectedItem(per); tfplace.setText(nplace); tfkul.setText(kul); tfgotra.setText(gtr); tfswami.setText(ksami); taraddr.setText(raddr); tfpcd.setText(code); tfstdcode.setText(stdcd); tftele.setText(teleno); tfmno.setText(mno); tfemail.setText(email); tfweb.setText(web); tfedu.setText(educ); tfbrch.setText(brch); cbbldgrp.setSelectedItem(bgrp); } catch (Exception e) { System.out.println("EXCEPTION " + e); } } if(findby.equals("Name")) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); System.out.println("\n Driver loaded"); Connection con=DriverManager.getConnection("jdbc:odbc:wanisamajDB"); Statement stmt=con.createStatement(); ResultSet rs = stmt.executeQuery("SELECT * FROM REGISTRATION1 WHERE SeniorPerson='"+cbnm.getSelectedItem().toString()+"'"); System.out.println("Hi"); rs.next(); String per = rs.getString("SeniorPerson"); System.out.println("SeniorPerson: " + per ); String reg = rs.getString("RegistrationNo"); System.out.println("RegistrationNo: " + reg); String nplace = rs.getString("NativePlace"); System.out.println("NativePlace: " + nplace); String kul = rs.getString("Kul"); System.out.println("Kul: " + kul); String gtr = rs.getString("Gotra"); System.out.println("Gotra: " + gtr); String ksami = rs.getString("KulSwami"); System.out.println("KulSwami: " + ksami); String raddr = rs.getString("ResidensialAddress"); System.out.println("ResidensialAddress: " + raddr); String code = rs.getString("PinCode"); System.out.println("PinCode: " + code); String stdcd = rs.getString("STDcode"); System.out.println("STDcode: " + stdcd); String teleno = rs.getString("TelephoneNo"); System.out.println("TelephoneNo: " + teleno); String mno = rs.getString("MobileNo"); System.out.println("MobileNo: " + mno); String email = rs.getString("Email"); System.out.println("Email: " + email); String web = rs.getString("Website"); System.out.println("Website: " + web); String educ = rs.getString("Education"); System.out.println("Education: " + educ); String brch = rs.getString("Branch"); System.out.println("Branch: " + brch); String bgrp = rs.getString("BloodGroup"); System.out.println("BloodGroup: " + bgrp); JOptionPane.showMessageDialog(null, "RECORD FOUND"); cbregn.setSelectedItem(reg); tfplace.setText(nplace); tfkul.setText(kul); tfgotra.setText(gtr); tfswami.setText(ksami); taraddr.setText(raddr); tfpcd.setText(code); tfstdcode.setText(stdcd); tftele.setText(teleno); tfmno.setText(mno); tfemail.setText(email); tfweb.setText(web); tfedu.setText(educ); tfbrch.setText(brch); cbbldgrp.setSelectedItem(bgrp); } catch (Exception e) { System.out.println("EXCEPTION " + e); } }//if </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload