Advertisement
Guest User

Untitled

a guest
Jan 5th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. String strxa = tfx1.getText(); //here i will get the student id from user.
  2.  
  3. Class.forName("oracle.jdbc.driver.OracleDriver");
  4. Connection con = DriverManager.getConnection("jdbc:oracle:thin:@//host:1521/service","username","pwd");
  5. Statement st =con.createStatement();
  6. String str3 ="select student_xml from student where student_id='"+strxa+"'";
  7.  
  8. System.out.println(str3);
  9.  
  10. ResultSet rs = st.executeQuery(str3);
  11. System.out.println(str3);
  12.  
  13. if (rs.next()) {
  14.  
  15. XMLType poxml = (XMLType)rs.getObject(1);
  16. System.out.println(poxml); //when i try to print this no output in console
  17. String poString =poxml.getStringVal();
  18. System.out.println(poString); when i try to print this no output in console
  19.  
  20.  
  21. //Sets Records in TextFields.
  22. area.setText(poString);
  23.  
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement