| Author |
Doubt in the following code
|
ChakraPani Margani
Greenhorn
Joined: Aug 19, 2007
Posts: 15
|
|
Hai to all, I got an error while compiling this code. public boolean update1(String Uin) { try { ResultSet rs=null; Statement st=null; Connection con=null; PreparedStatement ps=null; String UIN=Uin; String name=""; boolean flag1=false; Class.forName("oracle.jdbc.driver.OracleDriver"); System.out.println("DriverLoaded"); con=DriverManager.getConnection("jdbc racle:thin:@localhost:1521 racle","scott","tiger"); System.out.println("Connection established"); st=con.createStatement(); rs=st.executeQuery("select *from uin"); while(rs.next()) { name=rs.getString(1); if(name.equalsIgnoreCase(UIN)) flag1=true; } if(!flag1) { ps=con.prepareStatement("insert into uin values(?)"); ps.setString(1,name); int i=ps.executeUpdate(); if(i>0) System.out.println("Number is Successfully Inserted"); flag1= true; } return flag1; }//try catch(Exception e) { e.printStackTrace(); } }//method the error message is : -------------------------- BeanLogic.java:87: missing return statement { ^ 1 error please help me to solve this problem...
|
 |
krishnamoorthy kitcha
Ranch Hand
Joined: Feb 04, 2006
Posts: 96
|
|
Hi chakrapani put the return statement end of code like private boolean check(){ boolean chk=false; try{ } catch(){ } return chk; }
|
 |
 |
|
|
subject: Doubt in the following code
|
|
|