To Creator Team (Rowsets at SessionBean)

1) Why the rowsets are created at sessionbean?
2) What are the benefits?
3) If the rowsets stay at sessionbean, the server's memory will not be overloaded?
4) How about the conexions with database? Will they be always open?

Hi,
1) , 2) We create rowsets in sessionbean to avoid unnecessary database
interactions. If we put in page bean, every time a page is
loaded/rendered, it might need to fetch data from database.
3) Placing rowsets to SessionBean and datprividers to page bean gives a balance between memory usage and performance. If you sometime need to minimize server's memory usage, place rowsets in page beans
Thanks, Misha
(Creator team)

Similar Messages

  • Question to Creator team on performance

    Performance issue due to lifecycle.
    There are 2 issues resulted from life cycle of jCreator:
    1/ Let�s say I have a page displaying data in a data table from a database� table but the sql statement have some parameters and .
    On the same page I would like to change criteria to redisplay the same page.
    I have a button to validate my criteria change.
    When I press the button the first thing done is page contructor called then button_action method called.
    The issue is the sql statement is build in the page constructor so I missed the opportunity to change the parameters in my sql statement.
    To resolve this issue I have to add in button _action method to rebuild my sql statement with new parameters and re-execute and call renderResponse(). So a performance hit here especially my sql statement in complex.
    2/ The same scenario but my button is for displaying a second page.
    The issue here is even I don�t need page 1 anymore but the page 1 constructor is still build and it may take a lot of time to do (complex task in constructor) and then page 2 is build. This takes enormous time and for nothing.
    Unless there�s other alternatives I think it would be better that the button_action is called before page constructor because:
    a/ In the case 1 I want to change the parameters then I will reassign value to parameters of sql statement and then constructor executed so I don�t need to do extra work to re-execute sql statement and call renderResponse() method.
    b/ In case 2 I want to display page 2 so if button_action executes first then I can skip to call page 1 constructor and this gives a boost to performance. the same when I go back to page 1 from page 2: page 2 constructor called for nothing....
    These 2 issues cause me a headache because I am working a big database on iSeries (AS/400) machine. To display a page takes time and if I want to display the last page (never finished).
    Are there any alternatives ???

    You asked for it, you got it...the Java Studio Creator team has provided significant design-time performance with this latest hot fix. Connect to the Update Center http://developers.sun.com/prodtech/javatools/jscreator/downloads/updates/index.html and get it today!
    Note: This hot fix requires Sun Java Studio Creator 2 Update 1. If you need to upgrade from Java Studio Creator 2, see the Downloads page http://developers.sun.com/prodtech/javatools/jscreator/downloads/index.jsp.
    Comments? A new forum thread has been started to consolidate discussion about the hotfix and issues related to IDE performance. Come on over to Get Improved Performance with Hot Fix 2 at http://swforum.sun.com/jive/thread.jspa?threadID=105441 and let us know what you think.

  • Creator Team: bug?

    Hi,
    Ocassionally, I get this error:
    Exception Details: java.lang.IndexOutOfBoundsException
      Index: 0, Size: 0
    Possible Source of Error:
       Class Name: java.util.ArrayList
       File Name: ArrayList.java
       Method Name: RangeCheck
       Line Number: 546
    Source not available. Information regarding the location of the exception can be identified using the exception stack trace below.
    Stack Trace:
    java.util.ArrayList.RangeCheck(ArrayList.java:546)
    java.util.ArrayList.remove(ArrayList.java:389)
    javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:271)
    javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)
    com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)
    com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:221)
    com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
    sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-2)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:585)
    org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
    java.security.AccessController.doPrivileged(AccessController.java:-2)
    javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
    org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
    org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
    org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
    org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
    java.security.AccessController.doPrivileged(AccessController.java:-2)
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    com.sun.rave.web.ui.util.UploadFilter.doFilter(UploadFilter.java:194)
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:210)
    org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
    org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
    java.security.AccessController.doPrivileged(AccessController.java:-2)
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
    org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132)
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
    org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
    org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:189)
    com.sun.enterprise.web.connector.grizzly.ProcessorTask.doProcess(ProcessorTask.java:604)
    com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:475)
    com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:371)
    com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:264)
    com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:281)
    com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:83)
    It should be noted that when I refresh the browser, that the application works well. I am running the app on Sun's App. Server.
    Please advise

    Hi Roman,
    Thanks for replying. For a moment there, I thought I was being blacklisted ;-}
    In the application, I have a dddlist and a table. The values in the table are dependent on the ddlist value selected. In other words, if a user chooses ABC in the ddlist, the values in the table would be "A" ,"B" ,"C". However, if the user chooses DEF in the dropdown, then the values in the table would be "D","E","F"
    It goes one step further...the selected value in the ddlist is coming from a previous page (passed thru the URL). However, the user can change the value, and the table is populated automatically. There is also a text box and a button if the user wants to search the existing options in the table.
    Now for the code:
    The pre-renderer method:
    //pid: value from url
    //SearchParam: value from textbox. It is set to % if user does not enter anything
    if (pid != null && (SearchParam != null) ) {
    //Sgroup_tblRowSet3: rowset that table is bound to
       getSessionBean1().getSgroup_tblRowSet3().setObject(1, pid);
                    getSessionBean1().getSgroup_tblRowSet3().setObject(2,SearchParam);
                  getSessionBean1().getSgroup_tblRowSet3().setObject(3,SearchParam);
                  getSessionBean1().getSgroup_tblRowSet3().execute();
                  ddPG.setSelected(new Integer(pid));
            getSgroup_tblDataProvider().refresh();Any suggestions?
    Thanks

  • To Creator Team and All Creator Experts..??

    Hi
    Myself Prashant (SCJP)
    Currently I am using studio creator as my development tool
    It's Impressive but I got an Problem while retriving data in html format in my database and showing it as it is formatted using html tags used and stored in database along with data
    if anybody of u can solve my problem and send me the proper instruction or information ..plz do tht
    Thank You..

    I think this is not Creator problem and you should ask your question in programming forum.
    BTW if you store html data within database you should care about special characters like quotes etc. Anyway more information about your problem required. Provide more details in programming forum.

  • Creator Team : Request For Additional feature

    Unless i'm missing out something here....
    (Regarding to EA2)
    So far, I couldnt find any method for retrieving selected Option from a list box.
    Currently, in the properties for Listbox
    i can ONLY bind 'selected' to a String[ ]
    binding 'selected' to 'Option [ ]' fails to work
    Scenario:
    I have 2 listboxes, ListBoxA and ListBoxB
    ListBoxA is filled with something Option objects
    ListBoxB is empty
    Now i want to pass some Option objects over to ListBoxB
    Because 'selected' can only be bind to String[ ],
    i've to manully check the String [ ] of Option's value
    with those that are in ListBoxA, to get the respective Option's Label,
    in order to display them in ListBoxB
    I hope i'm not too confusing
    If anyone know an easier method in achieving the same goal,
    please reply
    thanks

    Hi,
    Please post messages related to Creator 2 EA at the feedbacks programs portal. The URL is:
    https://feedbackprograms.sun.com/login.html
    Thanks,
    RK.

  • How many people are there in the Creator team?

    Can it be made available that how many people are working for deveolping this IDE? How many softwate engineers and developers? How many managers?
    thanks.

    No, we can't give you that level of detail. Resource staffing at Sun, like most companies, is strictly company confidential information.

  • Updates for Creator 1

    Hi Creator Team:
    Are we going to see a new set of updates for Creator 1? Its been 6 months and lots of bugs reported since Update 7

    I find this response quite distrubing for a number of reasons.
    1] Many of us are committed to Creator 1 for a product lifecycle. Bugs in the JSF framwork (such as unclosed rowsets etc.) place our projects at significant risk.
    2] There is no "smooth transistion" to Creator 2 as existing pages cannot be upgraded and therefore, exising Creator 1 bugs remain in the framework.
    3] Creator 2 is not available and no release date has been set.
    4] There are significant architecture changes in Creator 2's framework which are not compatible with Creator 1.
    I don't know about the rest of the community but I find Sun's abandonment of Creator 1 extremely annoying, shortsighted and insulting to those of us who have supported Sun. I am now considering moving our application off the platform and onto more dependable technology managed by a company with more sensitivity to those who, in retrospect, mistakenly, choose to rely on Sun.
    Thank you Creator Team!!!!

  • SUN TEAM: Bugs in update and delete a record with long query

    Creator Team,
    In my opinio there is a bug issue with update and delete a record with a complex sql query. I�m using oracleXE and ojdbc14.ar with tomcat
    In just two page I�m receving the following msg (I have 12 pages doing the same thing with less complex queries)
    * Number of conflicts while synchronizing: 1 SyncResolver.DELETE_ROW_CONFLICT row 2 won't delete as values in database have changed: 2006-11-29
    * Cannot commit changes: Number of conflicts while synchronizing: 1 SyncResolver.UPDATE_ROW_CONFLICT row 0 values changed in database
    when i tried to delete or commit the updated changes in the register...
    The interesting is that this code function with jdbc of jsc...
    My query is bellow:
    SELECT ALL PATRIMONIO.TB_BEM.INCODIGOBEM,
    PATRIMONIO.TB_BEM.VATOMBAMENTO,
    PATRIMONIO.TB_BEM.VAMATERIAL,
    PATRIMONIO.TB_BEM.INCODIGOSETOR,
    PATRIMONIO.TB_SETOR.VANOME AS NOMESETOR,
    PATRIMONIO.TB_BEM.INCODIGOFORNECEDOR,
    PATRIMONIO.TB_FORNECEDOR.VANOME AS NOMEFORNECEDOR,
    PATRIMONIO.TB_BEM.DACHEGADA ,
    PATRIMONIO.TB_BEM.DASAIDAPREVISTA,
    PATRIMONIO.TB_BEM.DASAIDAEFETIVA,
    PATRIMONIO.TB_BEM.VAMARCA,
    PATRIMONIO.TB_BEM.VAMODELO,
    PATRIMONIO.TB_BEM.VADESBAIXABEM,
    PATRIMONIO.TB_BEM.INCODIGOTIPOAQUISICAO,
    PATRIMONIO.TB_TIPOAQUISICAO.VANOME AS NOMETIPOAQUISICAO
    FROM PATRIMONIO.TB_BEM , PATRIMONIO.TB_TIPOAQUISICAO, PATRIMONIO.TB_SETOR, PATRIMONIO.TB_FORNECEDOR
    WHERE PATRIMONIO.TB_BEM.INCODIGOTIPOAQUISICAO = PATRIMONIO.TB_TIPOAQUISICAO.INCODIGOTIPOAQUISICAO
    AND PATRIMONIO.TB_BEM.INCODIGOSETOR = PATRIMONIO.TB_SETOR.INCODIGOSETOR
    AND PATRIMONIO.TB_BEM.INCODIGOFORNECEDOR = PATRIMONIO.TB_FORNECEDOR.INCODIGOFORNECEDOR
    AND PATRIMONIO.TB_BEM.INCODIGOBEM LIKE ?
    AND PATRIMONIO.TB_BEM.VATOMBAMENTO LIKE ?
    AND PATRIMONIO.TB_BEM.VAMATERIAL LIKE ?
    AND PATRIMONIO.TB_SETOR.VANOME LIKE ?
    AND PATRIMONIO.TB_FORNECEDOR.VANOME LIKE ?
    ORDER BY PATRIMONIO.TB_BEM.VATOMBAMENTO ASC
    Why this problem is happing? Did you had some solution for that? Is the problem because the query is too long?!
    please help me!
    Gustavo Callou

    Hello people,
    I�m doing this to try to solution that bug:
    This code is working fine... but I do not understand why I�m receiving the nullpointer exception!??!!?
    // create a new rowset
    CachedRowSetXImpl pkRowSet = new CachedRowSetXImpl();
    try {
    RowKey rk = tableRowGroup1.getRowKey();
    if (rk != null) {
    // set the rowset to use the Patrimonio database
    pkRowSet.setDataSourceName("java:comp/env/jdbc/Patrimonio");
    String query = "DELETE FROM TB_BEM WHERE INCODIGOBEM = "+tb_bemDataProvider.getValue("INCODIGOBEM", rk).toString();
    pkRowSet.setCommand(query);
    pkRowSet.setTableName("TB_BEM");
    // execute the rowset -- which will contain a single row and single column
    pkRowSet.execute();
    pkRowSet.next();
    info("Apagado");
    } catch (Exception ex) {
    log("ErrorDescription", ex);
    error(getApplicationBean1().trateException(ex.getMessage()));
    } finally {
    pkRowSet.close();
    Please someone help me!!!
    Gustavo Callou

  • Perform transaction in creator [SetAutocommit(false) and commit()]

    Hi,
    I've finished one application with the Sun Java Studio Creator 2 but I've 2 technicals problems. One problem is about manage transactions.
    In a validate button, I've to perform update with 2 tables for example (orders and orders_details).
    My code:
    ordersDataProvider.getCachedRowSet().acceptChanges();
    orders_detailsDataProvider.getCachedRowSet().acceptChanges();
    It works but when I've an error in the 'orders_detailsDataProvider.getCachedRowSet().acceptChanges();', the orders's changes into the database are not rollback.
    I try the following:
    try{
    Context ctx=new InitialContext();
    DataSource ds=(DataSource)ctx.lookup("java:comp/env/jdbc/moduleachat");
    //Get a connection
    conn=ds.getConnection();
    /* Begin the transaction */
    conn.setAutoCommit(false);
    //update orders
    ordersDataProvider.getCachedRowSet().acceptChanges();
    //update order details
    orders_detailsDataProvider.getCachedRowSet().acceptChanges();
    /* Commit transaction */
    conn.commit();
    return "confirmPage";
    }catch(Exception ex){
    log(ex.getMessage(), ex);
    //Rollback transaction
    try{
    conn.rollback();
    }catch(SQLException esql){
    log(esql.getMessage(), esql);
    return null;
    it doesn't work. When errors occurs in the orders_details's update, the orders's update is not still rollback. it seems like the connection I get is not in the same context of orders and orders details rowset context.
    Can anyboby gives me a solution. It very important for a professional application

    I don't understand why nobody has solutions about my problems.
    To creator team:
    Tell us if it's a bug or not. I've try with 'acceptchanges(Connection conn)' but it doesn't work.
    Yesterday i've searched for many hours solutions on internet and I've found that others guys have the same problem and in the CachedRowSet implementation there is a property called 'COMMIT_ON_ACCEPT_CHANGE'. This property is final and set to true. i don't see where we can set it to false. So every time we call acceptchanges(connection), even if connection is in setAutoCommit ( false ), the acceptchanges commit all changes directly. Is it a bug or not? I hope no because manage transactions must be one feature of Java Studio Creator's CachedRowSet.
    Thanks

  • MD5 and rowsets

    Just a simple question... how do I something like this with rowsets:
    INSERT INTO table SET username='piet',password=MD5('bla');

    Hi,
    The short answer is you don't do this with rowsets. Rowsets are ResultSets. As such, you add rows by:
    // make sure the rowset has been executed.
    myRowSet.moveToInsertRow();
    myRowSet.updateString("username", <username-value>);
    myRowSet.updateString("password", <password-value>");
    myRowSet.insertRow();
    myRowSet.commit();
    If you want to use insert instead, you can -- but not via a rowset:
    import javax.naming.InitialContext;
    import javax.naming.Context;
    import javax.sql.DataSource;
    import java.sql.Connection;
    import java.sql.Statement;
    Context ctx new InitialContext();
    DataSource ds = (DataSource)ctx.lookup(myRowSet.getDataSourceName());
    Connection conn = ds.getConnection();
    Statement stmt = conn.createStatement();
    int updateCount = stmt.executeUpdate(<your-sql-insert-statement-here>);
    conn.commit();
    Lastly, if you are going to be doing lots of inserts, you might want to use a PreparedStatement instead of a Statement:
    import javax.naming.InitialContext;
    import javax.naming.Context;
    import javax.sql.DataSource;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    Context ctx new InitialContext();
    DataSource ds = (DataSource)ctx.lookup(myRowSet.getDataSourceName());
    Connection conn = ds.getConnection();
    PreparedStatement ps = conn.prepareStatement(<your-sql-insert-with-question-marks-for-username-and-password>);
    //for each insert
    ps.setString(1,<username-value>);
    ps.setString(2,<password-value>);
    int updateCount = stmt.executeUpdate();
    // end of for each insert
    conn.commit();
    Thanks John Kline for sharing the above information.
    Regards,
    Creator Team.

  • What is your most-used Sun Java Creator feature/widget/key sequence

    As I am learning about the IDE and using it to develop apps, I wonder about the most commonly used features that I have yet to learn about. Especially the key sequences that could save me time.
    What features do you find yourself using the most? What features do you rely on as productivity enhancers?

    Hi,
    Thanks for your interest in Sun Java Studio Creator.
    Apparently the Studio Creator offers drag-and-drop, RAD approach to J2EE development. Java Studio Creator blends together technologies such as JSF, JDBC Rowsets, and the Web Services APIs to give J2EE developers a brisk-start when it comes to building web applications. The developers without being tied to proprietary technologies, developers can work with and within Creator or easily take their code with them to a number of development platforms.
    Requirement of more sophisticated technologies to meet user demands, enterprise developers can incorporate EJB's.
    Please have a walkthrough of the IDE features in the following links.
    http://www.sun.com/software/products/jscreator/features.xml
    http://developer.sun.com/prodtech/javatools/jscreator/
    Keep looking for new features and updates of the iDE.
    Cheers :)
    Creator Team.

  • Using Creator with Cloudscape.

    Anyone managed to use the CLoudscape database with Creator on Linux yet?
    I have followed the advice in Lance Andersens blog
    http://weblogs.java.net/blog/lancea/archive/2004/11/using_apache_de.html
    and put derby.jar,derbynet.jar,db2jcc.jar,db2jcc_license_c.jar in /Creator/SunAppServer8/domains/creator/lib/ext
    and created a .tpersistence.properties file in /Creator/SunAppServer8/domains/creator/config
    I created a datasource as in the tutorial Creating Database Server Types and Data Sources. Testing the connection sometimes works and sometimes fails. Every attempt to use the Cloudscape database with a program created using Creator with the embedded driver gives the following error
    SQLException: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: Failed to start database '/home/johlan/CSSystemHome/testDB'.
    Trying to create a datasource for a network connection seems impossible as testing the connection gives the message
    wrong driver:com.ibm.db2.jcc.DB2Driver but this is the correct driver.
    Thanks in advance for any suggestions on how to get Creator to use the Cloudscape database.

    Thanks for the reply. I had looked at that thread while trying to get a connection before.
    What I have found is that using the normal Creator procedure of dragging a table onto the jsp page to produce a datasource and rowsets does not produce a working connection to Cloudscape as it does with Pointbase. I also wanted to use CachedRowSets, which does not seem easy in Creator.
    I have found I can connect to databases using the Cloudscape network server with connections made using DriverManager. Even so while I can read from the database using ResultSet and CachedRowSet these fail when trying to write to the database. Writing to the database from Creator produced web pages can only be done using Statements.
    As Cloudscape is written in Java I would have thought it worthwhile for the Creator team to make it easier for developers to use it with Creator.
    A quick working example is listed below. Any improvements welcomed. Don't forget to start the network server.
    John.
    package nodsattainnet;
    import javax.faces.*;
    import com.sun.jsfcl.app.*;
    import com.sun.rowset.CachedRowSetImpl;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.util.GregorianCalendar;
    import javax.faces.component.html.*;
    import javax.sql.rowset.CachedRowSet;
    public class Page1 extends AbstractPageBean {
        // <editor-fold defaultstate="collapsed" desc="Creator-managed Component Definition">
        private int __placeholder;
        private HtmlForm form1 = new HtmlForm();
        public HtmlForm getForm1() {
            return form1;
        public void setForm1(HtmlForm hf) {
            this.form1 = hf;
        private HtmlOutputText outputText1 = new HtmlOutputText();
        public HtmlOutputText getOutputText1() {
            return outputText1;
        public void setOutputText1(HtmlOutputText hot) {
            this.outputText1 = hot;
        private HtmlCommandButton button1 = new HtmlCommandButton();
        public HtmlCommandButton getButton1() {
            return button1;
        public void setButton1(HtmlCommandButton hcb) {
            this.button1 = hcb;
        private HtmlOutputText outputText2 = new HtmlOutputText();
        public HtmlOutputText getOutputText2() {
            return outputText2;
        public void setOutputText2(HtmlOutputText hot) {
            this.outputText2 = hot;
        private HtmlCommandButton button2 = new HtmlCommandButton();
        public HtmlCommandButton getButton2() {
            return button2;
        public void setButton2(HtmlCommandButton hcb) {
            this.button2 = hcb;
        private HtmlMessages messageList1 = new HtmlMessages();
        public HtmlMessages getMessageList1() {
            return messageList1;
        public void setMessageList1(HtmlMessages hm) {
            this.messageList1 = hm;
        // </editor-fold>
        //database is located in /home/johlan/CSSystemHome
        private static String DBNAME = "mydb";
        //Cloudscape network server port
        private static int SERVER_PORT = 1527;
        //DB2 JDBC Universal Driver
        private static final String UNIVERSAL_DRIVER = "com.ibm.db2.jcc.DB2Driver";
        //URL to connect to Cloudscape network server using the DriverManager.
        private static final String CS_NS_DBURL = "jdbc:derby:net://localhost:"+SERVER_PORT+"/"
        +DBNAME+";retrieveMessagesFromServerOnGetMessage=true;deferPrepares=true;";
        //the username
        private static final String username = "myusername";
        //the password
        private static final String password = "mypassword";
        // </editor-fold>
        public Page1() {
            // <editor-fold defaultstate="collapsed" desc="Creator-managed Component Initialization">
            try {
            } catch (Exception e) {
                log("Page1 Initialization Failure", e);
                throw e instanceof javax.faces.FacesException ? (FacesException) e: new FacesException(e);
            // </editor-fold>
            // Additional user provided initialization code
        protected nodsattainnet.SessionBean1 getSessionBean1() {
            return (nodsattainnet.SessionBean1)getBean("SessionBean1");
        protected nodsattainnet.ApplicationBean1 getApplicationBean1() {
            return (nodsattainnet.ApplicationBean1)getBean("ApplicationBean1");
         * Bean cleanup.
        protected void afterRenderResponse() {
        public String button1_action() {
            // TODO Replace with your code
            Statement stmt = null;
            Connection conn = null;
            ResultSet rs = null;
            CachedRowSet crs;
            try {
                Class.forName(UNIVERSAL_DRIVER).newInstance();
                conn = java.sql.DriverManager.getConnection(CS_NS_DBURL,username, password);
                crs = new CachedRowSetImpl();
                try {
                    stmt = conn.createStatement();
                    String command = "SELECT lastname from users WHERE user_id = 1";
                    rs = stmt.executeQuery(command);
                    crs.populate(rs);
                finally {
                    rs.close();
                    conn.close();
                crs.first();
                outputText2.setValue(crs.getString("lastname"));
            catch (SQLException se) {
                // log error
                error("SQLException: " + se);
                log("Get Lastname SQLException: " + se);
            catch (ClassNotFoundException cnfe) {
                error("cnfe: " + cnfe);
                cnfe.printStackTrace();
            catch (InstantiationException ie) {
                error("ie: " + ie);
                ie.printStackTrace();
            catch (IllegalAccessException iae) {
                // log error
                error("IllegalAccessException: " + iae);
                log("Get Lastname IAException: " + iae);
            return null;
        public String button2_action() {
            // TODO Replace with your code
            Statement stmt = null;
            Connection conn = null;
            try {
                Class.forName(UNIVERSAL_DRIVER).newInstance();
                conn = java.sql.DriverManager.getConnection(CS_NS_DBURL,username, password);
                try {
                    PreparedStatement ps = conn.prepareStatement("INSERT INTO answers VALUES(?,?,?,?,?)");
                    ps.setInt(1, 2);
                    ps.setInt(2, 3);
                    ps.setInt(3, 4);
                    ps.setString(4, "MYAN");
                    ps.setDate(5, new java.sql.Date((new java.util.GregorianCalendar()).getTimeInMillis()));
                    ps.executeUpdate();
                finally {
                    conn.close();
            catch (SQLException se) {
                // log error
                error("SQLException: " + se);
                log("Answer Insert SQLException: " + se);
            catch (ClassNotFoundException cnfe) {
                error("cnfe: " + cnfe);
                cnfe.printStackTrace();
            catch (InstantiationException ie) {
                error("ie: " + ie);
                ie.printStackTrace();
            catch (IllegalAccessException iae) {
                // log error
                error("IllegalAccessException: " + iae);
                log("Get Lastname IAException: " + iae);
            return null;
    }

  • [CREATOR 2.1] : pb with browser

    HI everyone
    I have installed Creator 2.1 and I can compile project but when I want to execute
    , Creator doesn ' t open the web browser choosen. Moreover if I want to access forul throught "Help->Forum" menu, I can not.
    Can anyone help me ?
    Thanks in advance,
    -R�gis

    iana2401,
    Umm, silly question, but I have to ask. What browser do you use and does it work OK outside the IDE?
    You can check our rel-notes to see if your browser is supported:
    http://developers.sun.com/prodtech/javatools/jscreator/reference/docs/2/Installation_ReleaseNotes.html
    Anyway, let me know what works and what doesn't.
    Sandeep J
    --Creator Team                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How is open new jsf project in Sun Java Studio Creator 2

    when i decide to open new project,all of time give this error :javax.xml.transform.TransformerConfigurationException:could not compile stylesheet

    Hi erceng,
    Can you give us the reproducible steps along with the full error message from the logs, so we can investigate?
    Thanks.
    Sandeep
    --Creator Team                                                                                                                                                                                                                                                                                                                       

  • Creator and image databases

    I'm trying to create an application that uses a database to store pictures along with other info. My question is, how can I retrieve the images from the database and show them in a paging setup like the Data Table component? So far I have been able to store and retrieve images in the database, but only able to retrieve them to a file. I have not been able to figure out how to show a picture retrieved from the database to the page itself. Any help would be greatly appreciated.

    Hi,
    This forum thread may also help you:
    http://swforum.sun.com/jive/thread.jspa?threadID=46410&start=10&tstart=0
    Thanks,
    Creator Team.

Maybe you are looking for

  • 10g Installation on WindowsXP

    Hello, I recently downloaded the 10g Database CD and burned it on a CD. When I try to install it to my WindowsXP-machine the Installation stops with the following error-message: "Error in writing to directory 'c:\documents and settings\tschmale\local

  • My iphone 4s doesn't work after iOS 6 updated

    I just updated iOS 6 then the phone was shut down. Now I can't turn on my iphone. What can I do now?

  • Binary file encryption

    Hi friends, i am tryin to encrypt binary file using secret key. When i decrypt the it seems taht it is damaged. I write this code :   Cipher cipher = Cipher.getInstance("DES");       cipher.init(Cipher.ENCRYPT_MODE, secretKey);       CipherOutputStre

  • Does com.evermind.sql.DriverManagerDataSource provide connection pooling?

    Hi, The class defined in default data-sources.xml file is com.evermind.sql.DriverManagerDataSource. In Oracle9i JDBC Developer's Guide and Reference Release 1 (9.0.1) documentation's chapter 15, Oracle encourages to use this emulated data source for

  • Forms 9i URL problem

    I have developed an application comprising of about 25 Forms. I have fully configured FormsWeb.cfg file and the application is running fine on the local intranet. BUT THE PROBLEM IS that I have been unable to set an easy to understand URL to my appli