I suspect you've got a redundant line of code here. Else, it's a
duplicate.

<<<<<<<@JdbcControl.SQL(statement = "INSERT into useraccess
values({userName},{age})")>>>>>>>> 

-----Original Message-----
From: sahuly [mailto:[EMAIL PROTECTED] 
Sent: 17 January 2007 10:04 AM
To: [email protected]
Subject: Re: Connection and transaction in JDBC Control



hai Jason,

sorry i can't get it here i have one problem, identify where the
mistake is i am not able to get it

Controller  class:-----------------------
 
@Jpf.Controller (
                 
    simpleActions = {
        @Jpf.SimpleAction(name = "begin", path =
"/com/ofs/jdbccontrol/beehive/pageflow/index.jsp")    
    },
    sharedFlowRefs = {
        @Jpf.SharedFlowRef(name = "shared" , type =
com.ofs.jdbccontrol.beehive.sharedflow.SharedFlow.class)
    }
)
public class Controller
extends PageFlowController {
    
    @Control()
    private UserBOControl userControl;
    public UserDTO[] getUser;
    
    
    @Jpf.Action (
        forwards = {
            @Jpf.Forward(name = "success", path = "index.jsp"),
            @Jpf.Forward(name = "failure", path =
"/com/ofs/jdbccontrol/beehive/pageflow/error.jsp")
        }
    )
    
    public Forward addUserInfo(UserDTO userDTO) {
        
        try {
            userControl.addUserInfo(userDTO.getUserName(),
userDTO.getAge());
------> This statement is not executed i.e control is not returned
back 
------> to
here..its not come back  from          UserBOControl  my webpage idle
but
data is
        getting inserted into the DB
------> at the same time i dont know whether connection is released or

------> not
and also 
        don't know where to maintain the transaction and
how??????????????
 
            return new Forward("success");
        } catch (Exception e) {
             e.printStackTrace(System.err);   
        }
        return new Forward("success");
    }
    
    @Jpf.Action (
         forwards = {
             @Jpf.Forward(name = "success", path =
"/com/ofs/jdbccontrol/beehive/pageflow/listUser.jsp"),
             @Jpf.Forward(name = "failure", path =
"/com/ofs/jdbccontrol/beehive/pageflow/error.jsp")
         }
    )
    public Forward getUserInfo() { 
        
        Forward fwd = new Forward("success");
        try {
            
            getUser = userControl.getUserInfo("sachin");
            fwd.addActionOutput("list", getUser);
        } catch (Exception e) {
            e.printStackTrace(System.err);
            return new Forward("failure");
        }
        return fwd;
    }
}
 

UserBOControl class  :----------
 
@org.apache.beehive.controls.api.bean.ControlExtension
@JdbcControl.ConnectionDriver(
    databaseDriverClass = "oracle.jdbc.driver.OracleDriver",
    databaseURL         = "jdbc:oracle:thin:@192.54.45.251:1521:ORCL",

    userName            = "t01",    
    password            = "t012006"
)
 
public interface UserBOControl
extends JdbcControl {
    
    @JdbcControl.SQL(statement = "INSERT into useraccess
values({userName},
{age})")
    public void addUserInfo(String userName, int age)
    throws SQLException;
    
    @JdbcControl.SQL(statement = "SELECT * FROM userinfo WHERE
userName =
{name}")
    public UserDTO[] getUserInfo(String name)
    throws SQLException;
 
}











sahuly wrote:
> 
> hi ,
> 
> where the connection is established and released in the JDBC 
> Control...if anyone have idea please reply....tell me some idea to 
> maintain transactoin in JDBC Control
> 
> thanks in advance
> 
> regards,
> sahuly.
> 
> 
> 

--
View this message in context:
http://www.nabble.com/Connection-and-transaction-in-JDBC-Control-tf302
0970.html#a8406075
Sent from the Beehive - User mailing list archive at Nabble.com.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This e-mail and its contents are subject to the Telkom SA Limited
e-mail legal notice available at 
http://www.telkom.co.za/TelkomEMailLegalNotice.PDF
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reply via email to