| Author |
Help me in clearing the Errors!
|
Swaminathan Balasubramani
Ranch Hand
Joined: Apr 12, 2005
Posts: 38
|
|
Can anyone help me in clearing the errors. import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import javax.sql.*; import java.sql.*; public class SearchSAPOnline extends HttpServlet { static Connection dbcon; String Keywords[]; public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { try { Class.forName("oracle.jdbc.driver.OracleDriver"); dbcon=DriverManager.getConnection("jdbc racle:thin:@bbsu-2:1521:keonline","system","knowledge"); System.out.println("Connection Established"); } catch(ClassNotFoundException e) { System.out.println("Database Driver Not found"); System.out.println(e.toString()); } catch(Exception e) { System.out.println(e.toString()); } res.setContentType("text/html"); String mine = req.getParameter("mine"); try { PreparedStatement s=dbcon.prepareStatement("select f_id,f_name,file_ext,date_creation,date_lupdate,d_id,keywords,path from file_info"); ResultSet rs=s.executeQuery(); while(rs.next()) { String FileID=rs.getString("f_id"); String FileName= rs.getString("f_name"); String FileExtension= rs.getString("file_ext"); String DateCreation= rs.getString("date_creation"); String DateLupdate=rs.getString("date_lupdate"); String DeptID=rs.getString("d_id"); String Keywords=rs.getString("keywords"); String Path=rs.getString("path"); } String[] keywords = new String[10]; String key =" "; int count = 0; char comma=','; int size= keywords.length(); try { for(int i=0; i<size; i++) { if(Keywords.charAt(i) == comma) { Keywords[count] = mine; mine = " "; count = count + 1; } else { mine = mine + Keywords.charAt(i); } } for(int j=0; j<=2; j++) { System.out.println(Keywords[j]); if (Keywords[j].equals(find)) System.out.println("Key word found : " + Keywords[j]); } } catch(Exception e) { System.out.println("Error :" + e); } } catch(Exception e) { System.out.println("Error in Excecuting the query"); } try { dbconn.close(); } catch(Exception e) { System.out.println("Error Closing the Database"); } } }
|
B.Swaminathan<br /> <br />Mobile:+91 09886510453
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
What errors? Also, If you are going to post more than a line or two of code, please use the UBB Code Tags. They preserve your indenting and make the code more readable.
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
 |
I agree. Here's the link: jrebel
|
|
subject: Help me in clearing the Errors!
|
|
|