Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package view;
- import java.sql.Connection;
- import java.sql.DriverManager;
- import java.sql.ResultSet;
- import java.sql.Statement;
- import javax.faces.model.ResultSetDataModel;
- import oracle.adf.view.rich.component.rich.data.RichTable;
- import oracle.adf.view.rich.component.rich.input.RichInputText;
- import oracle.adf.view.rich.component.rich.output.RichOutputLabel;
- import oracle.adf.view.rich.context.AdfFacesContext;
- public class Method {
- private RichInputText txtbox;
- private RichOutputLabel lbl;
- private RichOutputLabel lbl2;
- private RichTable table;
- public Method() {
- }
- public String textChange() {
- AdfFacesContext adf = AdfFacesContext.getCurrentInstance();
- adf.addPartialTarget(table);
- try{
- Class.forName("oracle.jdbc.OracleDriver");
- Connection con = DriverManager.getConnection("jdbc:oracle:thin:@Jaffer:1521:XE", "HR","hr");
- Statement stmt = con.createStatement();
- ResultSet rslt = stmt.executeQuery("select JOB_ID from EMPLOYEES where LAST_NAME='King' AND EMAIL='SKING'");
- rslt.next();
- String str =rslt.getString(1).toString();
- rslt = stmt.executeQuery("select * from JOBS where JOB_ID='"+str+"'");
- rslt.next();
- ResultSetDataModel dataModel=new ResultSetDataModel();
- dataModel.setWrappedData(rslt);
- table.setValue(dataModel);
- //txtbox.setValue(rslt.getString(1).toString());
- }catch (Exception e){
- }
- return null;
- }
- public void setTxtbox(RichInputText txtbox) {
- this.txtbox = txtbox;
- }
- public RichInputText getTxtbox() {
- return txtbox;
- }
- public void setLbl(RichOutputLabel lbl) {
- this.lbl = lbl;
- }
- public RichOutputLabel getLbl() {
- return lbl;
- }
- public void setLbl2(RichOutputLabel lbl2) {
- this.lbl2 = lbl2;
- }
- public RichOutputLabel getLbl2() {
- return lbl2;
- }
- public void setTable(RichTable table) {
- this.table = table;
- }
- public RichTable getTable() {
- return table;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement