JSF Actions and ActionListeners with Tiles and forms

I�m having a problem trying to use the Tiles functionality in Struts 1.1 with JSF and was wondering if anyone could help me.
I have defined a very simple header, menu, content Tile that doesn�t involve nesting of tiles (ExampleTile_content1Level.jsp).
I have 3 JSP pages, the first testHarness.jsp is NOT built using Tiles and is just used to load some test data into a session scoped bean using an actionListener and then forward to a Tile generated page (ExampleTile3.jsp) using a hard-coded action �applicationSummary� when a commandLink is pressed. This works fine for both the action and actionListener.
ExampleTile3.jsp contains another commandLink that is meant to forward to another tile ExampleTile2.jsp. This also works until I try to add the <h:form> � </h:form> tag around the outside of the <h:panelGrid> tags in ExampleContent1.jsp when the action and actionListener then fail to fire and I get an �Error on Page� message in Explorer the detail of which says �Error �com_sun_rave_web_ui_appbase_renderer_CommandLinkRendererer� is null or not an object�.
However I need a form so that I can bind UI controls to data from the bean stored in the session scope. This is only a problem when I use Tiles to define the pages. Does anyone know what I am doing wrong?
Any help would be much appreciated.
Tiles.xml
   <definition name="example3" path="/pages/exampleTile_content1Level.jsp" >
          <put name="headerClass" value="someStyle"/>
          <put name="menuClass" value="someStyle"/>
          <put name="contentClass" value="someStyle"/>
          <put name="header-title" value="/pages/exampleHeader.jsp" />
          <put name="menu" value="/pages/exampleMenu.jsp" />
          <put name="content" value="/pages/exampleContent1.jsp" />
   </definition>
   <definition name="example2" path="/pages/exampleTile_content1Level.jsp" >
          <put name="headerClass" value="someStyle"/>
          <put name="menuClass" value="someStyle"/>
          <put name="contentClass" value="someStyle"/>
          <put name="header" value="/pages/exampleHeader.jsp" />
          <put name="menu" value="/pages/exampleHeader.jsp" />
          <put name="content" value="/pages/exampleContent2.jsp" />
   </definition>ExampleTile3.jsp
<f:view>
     <h:form>
          <tiles:insert definition="example3" flush="false" />
     </h:form>
</f:view> ExampleTile2.jsp
<f:view>
     <h:form>
          <tiles:insert definition="example2" flush="false" />
     </h:form>
</f:view> Faces-config.xml
<navigation-rule>
    <from-view-id>/pages/testHarness.jsp</from-view-id>
       <navigation-case>
            <from-outcome>applicationSummary</from-outcome>
            <to-view-id>/pages/exampleTile3.jsp</to-view-id>
          <redirect/>
       </navigation-case>
</navigation-rule>
<navigation-rule>
    <from-view-id>/pages/exampleTile3.jsp</from-view-id>
       <navigation-case>
            <from-outcome>nextPage</from-outcome>
            <to-view-id>/pages/exampleTile2.jsp</to-view-id>
            <redirect/>
       </navigation-case>
</navigation-rule> ExampleTile_content1Level.jsp
<tiles:importAttribute scope="request"/>
<h:panelGrid columns="1" >
     <f:subview id="header-title">
          <tiles:insert name="header-title" flush="false" />
     </f:subview>
     <f:subview id="menu">
          <tiles:insert name="menu" flush="false" />
     </f:subview>
     <f:subview id="content">
          <tiles:insert name="content" flush="false" />
     </f:subview>
</h:panelGrid> ExampleHeader.jsp / ExampleMenu.jsp
<tiles:importAttribute scope="request"/>
<h:panelGrid columns="1" columnClasses="someSyle">
     <h:outputFormat value="This is the {0}.">
          <f:param value="Header / Menu as appropriate "/>         
     </h:outputFormat>
</h:panelGrid> ExampleContent1.jsp
<tiles:importAttribute scope="request"/>
<h:form>     <----- Fails with this tag included but works without it.
<h:panelGrid columns="1" >
          <h:outputFormat value="This is the {0}.">
               <f:param value="Content on the FIRST page"/>
          </h:outputFormat>
          <h:commandLink action="nextPage" immediate="false">
               <h:outputText value="Click to go to next page"/>
          </h:commandLink>
</h:panelGrid>
</h:form> ExampleContent2.jsp
<tiles:importAttribute scope="request"/>
<h:panelGrid columns="1" >
     <h:outputFormat value="This is the {0}.">
          <f:param value="Content on the SECOND page"/>
     </h:outputFormat>
</h:panelGrid>

jezzica85 wrote:
Hi everybody,
I want to overload a method so it can take either 2 Actions, 2 ActionListeners, or one of each. The issue with this is that I'd have to make 4 overloaded signatures and almost identical methods, like this:
method( action, action )
method( action, listener )
method( listener, action )
method( listener, listener )
Well, if you want to support that then you are just going to have to do suffer through it, the only shortcut I can recommend is that your method(action, listener) and method(listener, action) are the same so you only have to implement 1 and just use the other as a entry point to call the one you wish to contain the code.

Similar Messages

  • I am considering buying an iPad 3. I have an iMac with OSX 10.6.8. On the iMac I have many photos and work with iPhoto and Photoshop Elements on the computer. Can I interchange or transfer photos and other work from the iMac to the iPad? How?

    I am considering buying an iPad 3. I have an iMac with OSX 10.6.8. On the iMac I have many photos and work with iPhoto and Photoshop Elements on the computer. Can I interchange or transfer photos and other work from the iMac to the iPad? How?

    velma Monreal wrote:
    I am considering buying an iPad 3. I have an iMac with OSX 10.6.8. On the iMac I have many photos and work with iPhoto and Photoshop Elements on the computer. Can I interchange or transfer photos and other work from the iMac to the iPad? How?
    Yes you can. In iPhoto create a Album with the photos you want in it. You can drag them from your Events folder. In iTunes with your iPad connected go to Photos by cliking on your iPad. You can then select the album or events you want.

  • Share Cinema Display and peripherals with MBP and PC

    Share Cinema Display and peripherals with MBP and PC
    I am about to be forced to use a business network connected PC in my office, but I will continue to bring my personal MacBook Pro to work for my personal e-mail, calendar, internet, etc. (it will be connected to a seperate open DSL network). I am thinking about getting an Apple Cinema display and trying to use this one display for both computers. I would like a way to "switch back and forth" between the two systems, all the while using the same mouse, keyboard, printer and Cinema display.
    Does anyone have any experience setting up what I am wanting to do?
    Also, how does connecting an external display effect a MBP? Can you close the screen on the MBP, turning off the MBP's display but keeping the computer running? I'd like to be able to tuck the MBP out of the way to save deskspace but still be using it via the Cinema display and peripherals...
    Thanks so much!

    You can use synergy (link: http://synergy2.sourceforge.net/) to link the mouse and keyboard across the two platforms.
    If you want to use only one display, you'll need a KVM switch.
    You can run the MBP either with it's own screen open, or shut it and use only the external screen.
    Hopefully this helps a little...

  • I just updated my Firefox browser to Firefox 8. I am a college student and practice with HTML and CSS for class assignments. The fonts in all my html documents are being overwritten online by your script typeface. How do I resolve this issue?

    I just updated my Firefox browser to Firefox 8. I am a college student and practice with HTML and CSS for class assignments. The fonts in all my html documents are being overwritten online by your script typeface. I did not have this issue in the older version. I use an iMAC running OS10.6.8. How do I resolve this issue?

    Starting with this, you have errors in your CSS code.
    body {
      margin-top: 0px;
      margin-right: 0px;
      margin-bottom: 0px;
      margin-left: 0px;
      color: 151515;
      font-family: "Gill Sans", "Gill Sans MT", "Myriad Pro", "DejaVu Sans Condensed", Helvetica, Arial, sans-serif;
      background-color: EFF5F8;
    body {
      margin:0;
      color: #151515;
      font-family: "Gill Sans", "Gill Sans MT", "Myriad Pro", "DejaVu Sans Condensed", Helvetica, Arial, sans-serif;
      background-color: #EFF5F8;
      font-size: 100%;
    Related links:
    Windows Chrome, why do my fonts look so bad? - Lee Green
    css3 - Bad font rendering Chrome - Stack Overflow
    Nancy O.

  • Hi, I would like to copy my photos (from iphoto) and movies (from i movie) from my Mac book air to my imac in which I also have iphoto and imovie with photos and movies. My goal is to have a unique source in my imac for my photos and movies. Thanks .

    Hi,
    I would like to copy my photos (from iphoto) and movies (from i movie) from my Mac book air to my imac in which I also have iphoto and imovie with photos and movies.
    My goal is to have a unique source of photos and movies in my imac.
    Thanks !
    Nicolas

    As  to iPhoto
    Connect the two Macs together (network, firewire target mode, etc)  or use an external hard drive formatted Mac OS extended (journaled) and drag the iPhoto library intact as a single entity from the old Mac to the pictures folder of the new Mac - launch iPhoto on the new mac and it will open the library and convert it as needed and you will be ready move forward.
    For iMovie support please post in the iMovie forum
    LN

  • Retire Oracle Designer development and continue with just using Forms 11

    Hi,
    The company I am working for is taking over responsibility for an Oracle Designer 10 application.
    Due to Oracle Designer is an outdated development environment we are looking for potential solutions how to get rid of Designer without completely redeveloping or replacing the application.
    One options we thought about is to switch off Designer and only continuing to use Oracle Forms 11.
    Do anyone of you have experience in this area which you would like to share?
    Best regards,
    Marco

    There are a lot of case generated (CG$) trigger and procedures used in the Forms. For us the code seems to be very complex and hard to read.
    But, also some of them seems to be never used or it is just the statement "null" in it.
    We thought about SQL Developer Data Modeler to capture most of the Designer stuff. But still there is the technical documentation that is not fully supported by SDDM. Did anyone migrate these Designer documentation to an other tool? If yes, to which one and how? We tried the SDDM Report functionality to capture some of the documentation, but also these reports do not contain everything that Designer could provide.
    There are also "Preference Sets" used in Designer and we are wondering how to migrate these to Forms Builder. Did anyone migrate these preference sets to Forms Builder in the past and has some experiences/examples/recommendations about that? We thought about one "global" form that could contain these preference sets and then inherit them.
    There are also the Functional Hirarchie Diagrams in Designer, could they migrated to Forms or SDDM in any way? Or do we need to maintain these diagrams manually in a tool like Word or Visio?
    If we could capture all the things mentioned above, we would like to continue just with Oracle Forms Builder 11gR2 in combination with other tools like SQL Developer and Data Modeler and if no other solution could be find out with some manual maintained documents.
    For all recommendations and tips we are very interested and we would thank you all very much!

  • About a week before Thanksgiving, all my tiles were removed and replaced with tiles such as Bestbuy, Aliexpress, Macys ect. I can no longer edit these options.

    I can no longer edit my tiles, and if I delete them, after closing out of firefox and re-opening. These tiles re-appear, in addition, Now when I snap to pages on my screen another tab opens. When It has never done so. I have tried every setting and un-installed and re-installed Firefox, to no avail.

    Hello,
    Can you check if this apply :
    [http://malwaretips.com/blogs/superfish-window-shopper-adware/ http://malwaretips.com/blogs/superfish-window-shopper-adware/]
    It looks like window shopper ...

  • JSF vs Struts - both with tiles

    I'm running in the problem migrating from Struts to JSF.
    In struts I have the following fragments:
    jsp (actualy in the resulting html):
    log4j
    struts-config:
    <forward name="log4j-page" path="doc.log4j"/>
    tiles-config:
    <definition name="doc.log4j" extends="doc.mainLayout">
    <put name="body" value="/WEB-INF/html/examples/log4j.jsp" />
    </definition>
    As a result this links the anchor on jsp page to my 'mainLayout' with 'body' replaced with ...log4j.jsp.
    I found no way to replicate this link in JSF.
    I tried <h:commandLink...> with a certain action. It seems that in faces-config fragment: <to-view-id>foo</to-view-id> JSF framework is always looking for foo.jsp.
    I'm wondering if there is any way of pointing in the faces-config to the definition name in tiles-config.

    Hello,
    There are differences between the two and some similarity. A couple of major differences I have noticed is that in using JSF you have much better control over user events and page response to user actions. The reason why is because JSF uses an event-driven model (e.g., you can write ActionListeners, EventHandlers, and event Dispatchers) to respond to any user activity on the page. Also JSF tags are far more programmer-friendly (in my opinion) than Struts. Another thing I would keep in mind (especially if you are a programmer) is that Craig Mc C. was the developer of both (with help from others); How often have you said to yourself after completing a project "given what I know now, If I started over from scratch I would make it so much better by doing... instead of ..."? Having used Struts for both large and small projects in the past, I really see JSF as a "simpler, leaner, smarter, more intuitive Struts than Struts". I think its much easier to learn and maintain than Struts (of course that depends on your coding style), and here is a key point: JSF will soon have visual drag and drop coding editors that both IBM and Sun will provide, and hopefully an open source version will appear as well. Visual design and development is not for everyone but it certainly has its place (in my opinion).
    I suggest you try create a simple app that includes all of the usual form components (checkboxes, lists, radiobuttons, textareas, submit buttons, etc. though not necessarily all on one page) using JSF and then Struts (or vise versa) then you can have a feel for how simple or complex it is using either for the usual web UI development assignment.
    Cheer,
    KamauObasi

  • How can I sync my Address Book and ICal with Mac and PC with Palm Desktop?

    I now have the IPhone and I love it!!! But I have some issues and need help please. I have a PC at work and a Mac at home. In the PC I use the Palm Desktop Version 4.1.4 and I have there all my contacts (more than 1,100), all my date book (since 1998) and all my memos (about 600). I want to see what would be the best way get rid of my Palm Handheld and have only the IPhone, but I have encountered some problems and many steps. Everyday I have to sync the Palm Handheld at work, then sync the Palm Handheld at home with my Mac (using The Missing Sync, but it takes a long time every time), then sync the IPhone. Can you please help me??? How can I sync my data from my PC (Palm Desktop) with the IPhone? Another, thing; I do not want to use Outlook at work because the information that I want to sync (Palm) is my personal data and I want to keep using the Palm software for that.

    aflores48,
    Unfortunately, the iPhone is not designed to sync with Palm software. As stated in the minimum system requirements, the iPhone can sync with Outlook (2003, 2007 or Express) on a PC, or with iCal and Entourage on a Mac. If you do not want to use Outlook on the PC, you can sign up for a free Yahoo account and sync with Yahoo Address Book. Yahoo Address Book can be used to sync from PC or Mac. More information on the minimum system requirements for the iPhone can be found here:
    http://docs.info.apple.com/article.html?artnum=305703
    More information about syncing the iPhone with your computer (including Yahoo Address Book) can be found here:
    http://docs.info.apple.com/article.html?artnum=305741
    Hope this helps,
    Jennifer B.
    Message was edited by: Jennifer_B

  • Many problems and questions with CC and PS CC 2014. HELP!!!

    I'm having way too many problems with this whole Creative Cloud system, and PS CC 2014 in particular.
    The courtesy of a response from a qualified Adobe staff member would be greatly appreciated by this long-time loyal patron of Adobe products.
    1. When and why was my membership downgraded from Single App to Photographer?
         I signed up to Single App CC almost a year ago, and am able to access Typekit, 20GB of cloud storage and all the other features of Individual App membership, but not Market Assets. When I attempt to download any CC Market Assets I get a message stating "Market Assets are a premium feature" and "is only available to paid Creative Cloud members".
          I must still be subscribed to Single App because the subscription payment receipt I received a few weeks ago states: "We received payment for your Creative Cloud single-app membership for Photoshop (one-year) subscription, and your membership will renew on 30-July-2014 (PT)".
         The CC website states that Market Assets are not included in the Individual "Photography" subscription level (which seems to be a relatively new category), but I am clearly paying for Single App membership as indicated on my receipt. However, when I check my account, I'm listed as a Photographer subscriber.
         What gives?
    2. Lightroom 5 is no longer listed as "Installed" in CC Apps window.
         I installed Lightroom 5 at Adobe's invitation last fall. Every time there is a CC update, the CC App widow shows that Lightroom 5 is not installed. So, I reinstall it, and the App list behaves properly until the next "update", which de-installs the app again.
         How do I keep Lightroom 5 installed?
    3. My Extensions are not accessible in PS CC 2014
         I migrated my presets from PS CC to PS CC 2014, but the Extensions are still greyed out (Windows>Extensions). I updated Extension Manager and synced the desktop CC app, which downloaded some plug-ins to CC 2014, but not the Adobe Watermark extension (v2.2.3). Also, because Window>Extension is greyed out, I can't access AdobeExchange via CC 2014 to download any possible updates.
         Why can't I access my extensions in PS CC 2004?
    4. CC Files wont stop syncing
         I thought I'd try uploading something to Creative Cloud to see what this storage feature could offer me. CC has been attempting to sync my files for aver a day now, chewing up bandwidth and seriously slowing down my internet connection to other content-dense sites. How do I stop the syncing process? I can pause it, but not stop it. I only have one file (a jpg image) in my Creative Cloud Files, which has a green check mark, so I don't understand what is being synced and why. I toogle syncing off and on again, but all I get is the spinning wheel. I've now turned off syncing, so this feature is now of no use to me.
         What am I doing wrong?
    5. How do I make the previous version of PS CC the default PS app in Mac OS 10.8.5
         How do I deactivate PS CC 2014 as the default PS app?
         My workflow regularly includes the Oil Paint filter and Adobe Watermark extension to produce the images I am currently marketing. Therefore, I prefer to use PS CC v14.2.1, and not PS CC 2004, as my default PS app. Mac OS10.8.5 want to open all my RAW and PSD files in PS CC 2014. I change the "Open With" preference in the "Get Info" window to PS CC 14.2.1, but it immediately reverts to PS CC 2014.
    I have several other issues with the latest CC platform, but lets see if I can get these ones solved before moving forward.
    This whole Creative Cloud process is becoming very frustrating and overly time consuming, and seems to be much more complex than most users need or want (based on the comments and problems I read in this forum).  I like the ongoing bug-fixes and camera/lens support updates, but the whole multi-app, internet-dependent format has gotten out of control, producing more problems than solutions, at least for me. This 2014 update makes it impossible to follow the workflow I've developed over the past several years. PixelBender is complex and non-intuitive, and does not effectively replace the Oil Paint filter. My extensions don't work. And now, the CC app won't let me access all the features I think I'm paying for. It seem to me these recent "upgrades" are half-baked. I've now spent countless hours trying to fix the problems imposed by CC 2014.
    These "Community Discussions" sometimes take days to produce any sort of assistance, helpful or otherwise, and Adobe does not have the decency to offer direct access to customer service personnel to solve these problems.

    I too, have many of the same problems: constantly reminded to "Install" the apps I have already done so (and paid for); Market Assets asks for me to become a paid member (I am); Adobe Bridge is missing from the apps page. I have reinstalled CC several times. Frustrating is the kindest word I can say--I seem to spend more time reading the "help" and discussion boards rather than working on photos. Dear Adobe, wake up and give us some solutions here! I too, have been using Adobe PS for years and UGH! CC is a mess and truly a bad experience for me! I apologize to the user above (RGMeyer) I could not be helpful, rather I am only adding fuel to your frustration.

  • Syncing contacts and calendar with outlook and gmail - use Exchange or not?

    I need to sync my contacts and calendar between my iphone and Outlook and google on my laptop. Syncing via iTunes is fine as a backup but not as a constant process. I then saw that Gmail would permit an Exchange account to be used to allow immediate syncing so I installed an Exchange account on the iphone. It works but I now have doubled contacts. Is there a better way of doing this to avoid duplicate contacts? If I dedupe the contacts on the iphone do I risk then deleting contacts in Outlook on my PC? Alternatively if I delete the Exchange account on the iPhone is there a simple way of keeping calendars in sync on Iphone, Google and Outlook? (I just have two gmail accounts and do not have a Microsoft Exchange server)
    Grateful for any useful advice on this issue!

    FYI I eventually developed a work around that works better. I have a mac at home and a window pc at work. You can use plaxo to sync contacts between the two and the ipod syncs with the mac as advertised. Also as a bonus you don't have to deal with any issues, problems and pains with multiple itunes locations...

  • Using Places and Faces with iPhoto and Aperture 3

    I have been a long time user of iPhoto, but have recently moved to +Aperture 3+ to use its better editing functionality. Initially I just imported photos for editing in +Aperture 3+.
    I recently decided to "share" the previews with iPhoto and leaving the iPhoto Library in its current location.
    Q. I had assumed that any editing in Aperture would modify the image in the +iPhoto library+. Is this the case or are they duplicates in each separate libraries?
    Q. Aperture also seems to offer easier assigning of Places and/or Faces but this is not being reflected in the +iPhoto library+. Again are these metadata changes not being carries across to the +iPhoto Library+?
    Q. Is there any way to sync and changes from one library to the other?
    I would be grateful for any advice as to how the setup should be altered before I get in a complete muddle.
    Thanks in anticipation.

    Aperture and iPhoto are entirely different applications that work in very different ways.
    The only communication between the two is as follows:
    Aperture is able to parse the iPhoto Library to allow it to import the contents while stacking the Originals and Modifeid versions, preserving metadata and so forth.
    Aperture can share its Previews with the iLife apps, including iPhoto.
    That's it.
    So, specifically, what interaction there is between the two is designed to facilitate migration from iPhoto to the more powerful app. After that, iPhoto has exactly the same relationship to the Aperture Library as, say, Pages or iMovie.
    iPhoto has no knowledge of, and knows nothing of how the Aperture Library works. It cannot read the Aperture library.
    Q. I had assumed that any editing in Aperture would modify the image in the iPhoto library. Is this the case or are they duplicates in each separate libraries?
    This is not the case.
    a: Aperture is designed for a non-destructive workflow and won't change any file anywhere, anytime.
    b: You seem to have confused Aperture with an Editor like Photoshop.
    It's not an adjunct to iPhoto, it's a complete replacement for it - and then some.
    Q. Aperture also seems to offer easier assigning of Places and/or Faces but this is not being reflected in the iPhoto library. Again are these metadata changes not being carries across to the +iPhoto Library+?
    No. See above.
    Q. Is there any way to sync and changes from one library to the other?
    No.
    I would be grateful for any advice as to how the setup should be altered before I get in a complete muddle.
    Pick one or the other to use. They both do the same job, just Aperture is a whole lot more powerful.
    Regards
    TD

  • Username and password with Access and JDBC application

    Hello all,
    I have written an application which accesses a MS Access database. I have created a dialog which asks the user for a username and password. I then include the username and password to connect to the database. I have created groups and users in the Access database and have given each user different privaleges. However, when I run my application, any user can get any privelage. I am missing something. Thanks in advance.

    // ConnectToDatabase.java
    // Copyleft (c) 2001 RatKing
    // ��������������������������������Java Bean
    // E-mail: [email protected]
    // This can use in JSP or Java Application or Applet
    // AFTER you have setup the ODBC source in Windoz.
    package rat;
    import java.sql.*;
    import java.util.*;
    public class ConnectToDatabase{
    private String driverClass = "sun.jdbc.odbc.JdbcOdbcDriver"; // JDBC-ODBC Bridge Driver
    private String dbURL = "jdbc:odbc:yourdbname"; // the name of your ODBC Source's Database
    private String userName = "yourname"; // user ID
    private String password = "yourpassword"; // user password
    private Connection connection = null; // Connection to the Database
    private Statement statement = null; // Statement object
    public ConnectToDatabase () {
    // ������������������
    public Connection getConnection() throws ClassNotFoundException, SQLException {
    if(connection != null) {
    return connection;
    Class.forName(driverClass);
    connection = DriverManager.getConnection(dbURL, userName, password);
    return connection;
    } // getConnection()
    public void closeConnection() throws SQLException {
    if (connection != null) {
    // Makes all changes made since the previous commit/rollback permanent
    // and releases any database locks currently held by this Connection object.
    if (!connection.getAutoCommit())
    connection.commit();
    closeStatement();
    connection.close();
    connection = null;
    } // closeConnection()
    * If not connected to database...connect to database, create a statement,
    * and, return the Statement.
    protected void createStatement() throws SQLException, Exception {
    if(statement == null) {
    Connection connection = getConnection();
    statement = connection.createStatement();
    * This method executes a statement and returns true or false. Any type
    * of Statement may be executed by this command.
    public boolean execute(String sqlString) throws SQLException, Exception {
    if(statement == null){
    createStatement();
    boolean returnValue = statement.execute(sqlString);
    return returnValue;
    * This method executes the statement and returns a ResultSet from
    * execution of the query. Only a SELECT Statemet is applicable here.
    public ResultSet executeQuery(String sqlString) throws SQLException, Exception {
    if(statement == null){
    createStatement();
    ResultSet rs = statement.executeQuery(sqlString);
    return rs;
    * This method executes update statements and returns a count of
    * the updates. Only a INSERTS, DELETES, and UPDATES are applicable here.
    * In addition, SQL statements that return nothing such as SQL DDL statements
    * can be executed.
    public int executeUpdate(String sqlString) throws SQLException, Exception {
    if(statement == null){
    createStatement();
    int returnValue = statement.executeUpdate(sqlString);
    return returnValue;
    * This method closes the Statement.
    public void closeStatement() throws SQLException {
    if(statement != null){
    statement.close();
    statement = null;
    * If it is not connected to database, connect to database and
    * create a statement and returns the Statement
    * @param scrollType should be ResultSet.TYPE_FORWARD_ONLY
    * or ResultSet.TYPE_SCROLL_INSENSITIVE
    * or ResultSet.TYPE_SCROLL_SENSITIVE
    * @param updateType should be ResultSet.CONCUR_READ_ONLY or
    * ResultSet.CONCUR_UPDATABLE ;
    protected Statement getStatement(int scrollType, int updateType)
    throws SQLException, Exception {
    Connection connection = getConnection();
    // for cloudscape to work with scrollable resultsets, the autocommit
    // should be false.
    connection.setAutoCommit(false);
    Statement statement = connection.createStatement(scrollType,
    updateType);
    return statement;
    * If it is not connected to database, connect to database and
    * create a preparestatement and returns the Statement
    * @param sqlString queryString to make a statement
    * @param scrollType should be ResultSet.TYPE_FORWARD_ONLY
    * or ResultSet.TYPE_SCROLL_INSENSITIVE
    * or ResultSet.TYPE_SCROLL_SENSITIVE
    * @param updateType should be ResultSet.CONCUR_READ_ONLY or
    * ResultSet.CONCUR_UPDATABLE ;
    protected PreparedStatement getStatement(String sqlString,
    int scrollType,
    int updateType) throws SQLException,
    Exception {
    Connection connection = getConnection();
    // for cloudscape to work with scrollable resultsets, the autocommit
    // should be false.
    connection.setAutoCommit(false);
    PreparedStatement preparedStatement =
    connection.prepareStatement(sqlString, scrollType, updateType);
    return preparedStatement;
    * this method executes the statement and resuts the resultSet due to
    * execution of Statement.
    * only SELECT Statemet is applied here.
    public ResultSet executeQueryScrollInsensitiveReadOnly(String sqlString,
    Vector values) throws SQLException, Exception {
    PreparedStatement preparedStatement = getStatement(sqlString,
    ResultSet.TYPE_SCROLL_INSENSITIVE,
    ResultSet.CONCUR_READ_ONLY);
    for (int i = 1; i <= values.size(); i++) {
    preparedStatement.setObject(i, values.elementAt(i - 1));
    // Execute a SQL statement that returns a single ResultSet.
    ResultSet rs = preparedStatement.executeQuery();
    return rs;
    * this method executes the statement and resuts the resultSet due to
    * execution of Statement. only SELECT Statemet is applied here.
    public ResultSet executeQueryScrollInsensitiveReadOnly(String sqlString)
    throws SQLException, Exception {
    Statement statement = getStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
    ResultSet.CONCUR_READ_ONLY);
    // Execute a SQL statement that returns a single ResultSet.
    ResultSet rs = statement.executeQuery(sqlString);
    return rs;
    * this method executes the statement and returns the resultSet due to execution
    * of Statement. only SELECT Statemet is applied here.
    public ResultSet executeQueryScrollForwardOnly(String sqlString,
    Vector values) throws SQLException, Exception {
    PreparedStatement preparedStatement = getStatement(sqlString,
    ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
    for (int i = 1; i <= values.size(); i++) {
    preparedStatement.setObject(i, values.elementAt(i - 1));
    // Execute a SQL statement that returns a single ResultSet.
    ResultSet rs = preparedStatement.executeQuery();
    return rs;
    * this method executes the statement and returns the resultSet due to
    * execution of Statement. only SELECT Statemet is applied here.
    public ResultSet executeQueryScrollForwardOnly(String sqlString)
    throws SQLException, Exception {
    Statement statement = getStatement(ResultSet.TYPE_FORWARD_ONLY,
    ResultSet.CONCUR_READ_ONLY);
    // Execute a SQL statement that returns a single ResultSet.
    ResultSet rs = statement.executeQuery(sqlString);
    return rs;
    * Method executeQueryScrollSensitiveReadOnly
    * @param sqlString String
    * @param values Vector
    * @return ResultSet returns ResultSet due to statement execution
    * @throws Exception
    * @throws SQLException
    * @see
    public ResultSet executeQueryScrollSensitiveReadOnly(String sqlString,
    Vector values) throws SQLException, Exception {
    PreparedStatement preparedStatement = getStatement(sqlString,
    ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
    for (int i = 1; i <= values.size(); i++) {
    preparedStatement.setObject(i, values.elementAt(i - 1));
    // Execute a SQL statement that returns a single ResultSet.
    ResultSet rs = preparedStatement.executeQuery();
    return rs;
    * Method executeQueryScrollSensitiveReadOnly
    * @param sqlString
    * @return
    * @throws Exception
    * @throws SQLException
    * @see
    public ResultSet executeQueryScrollSensitiveReadOnly(String sqlString) throws SQLException, Exception {
    Statement statement = getStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
    ResultSet.CONCUR_READ_ONLY);
    // Execute a SQL statement that returns a single ResultSet.
    ResultSet rs = statement.executeQuery(sqlString);
    return rs;
    //////////////Other things maybe useful ///////////////////
    # Refer to Appendix A for more info on configuring the JDBC
    # driver via setting of the DRIVER_CLASS and DATABASE_URL properties
    #JDBC Driver Class
    # for ODBC Driver:
    #DRIVER_CLASS=sun.jdbc.odbc.JdbcOdbcDriver
    # for Oracle Driver
    #DRIVER_CLASS=jdbc.oracle.driver.OracleDriver
    # for CloudScape Driver equipped with J2EE reference implementation
    #DRIVER_CLASS=RmiJdbc.RJDriver
    # for CloudScape Driver equipped with BEA Weblogic Server
    DRIVER_CLASS=COM.cloudscape.core.JDBCDriver
    #Database URL
    # for ODBC URL
    #DATABASE_URL=jdbc:odbc:tShirts
    # for Oracle URL
    #DATABASE_URL=jdbc:oracle:thin:@localhost:1521:ORCL
    # for URL with CloudScape equipped with J2EE reference implementation
    #DATABASE_URL=jdbc:rmi:jdbc:cloudscape:beeshirtsdb
    # for URL with CloudScape equipped with BEA Weblogic Server
    DATABASE_URL=jdbc:cloudscape:D:\\weblogic\\eval\\cloudscape\\beeshirts
    #UserName to connect to database
    UserName=TSHIRTS
    #Password to connect to database
    Password=TSHIRTS
    #otherParameters
    SUB_PROPERTIES=
    #SQL Query
    SQL_QUERY_STATEMENT = SELECT * FROM TSHIRTS.CUSTOMER
    #SQL Update , if you run this program please change the id 129 to different value each time
    SQL_UPDATE_STATEMENT = INSERT INTO TSHIRTS.CUSTOMER VALUES ('129','Sam','Cheng','S','123 Sam St.', 'C3','Baltimore','MD','20222','4104444444' ,'[email protected]')
    #Join STATEMENT
    SQL_QUERY_STATEMENT_JOIN = SELECT TSHIRTS.CUSTOMER.*, TSHIRTS.ORDERS.* FROM TSHIRTS.CUSTOMER, TSHIRTS.ORDERS WHERE CUSTOMER.CUSTOMER_ID = ORDERS.CUSTOMER_ID_FK
    #OUTER JOIN for ORACLE
    #SQL_QUERY_STATEMENT_OUTER_JOIN = SELECT CUSTOMER.* FROM TSHIRTS.CUSTOMER,STATE WHERE CUSTOMER.STATE(+) = STATE.CODE(+)
    #OUTER JOIN for MSACCESS
    #SQL_QUERY_STATEMENT_OUTER_JOIN = SELECT C.* , S.* FROM CUSTOMER C OUTER JOIN STATE S on C.STATE = S.CODE
    #OUTER JOIN for MSACCESS and Cloudscape
    SQL_QUERY_STATEMENT_OUTER_JOIN = SELECT C.* , S.* FROM TSHIRTS.CUSTOMER C LEFT OUTER JOIN TSHIRTS.STATE S on C.STATE = S.CODE
    #SQL Statement with Like for MSACCESS
    #SQL_QUERY_STATEMENT_WITH_LIKE = SELECT CUSTOMER.* FROM CUSTOMER WHERE CUSTOMER.FIRST_NAME LIKE \'*R*\'
    #SQL Statement with Like for ORACLE and Cloudscape
    SQL_QUERY_STATEMENT_WITH_LIKE = SELECT * FROM TSHIRTS.CUSTOMER WHERE FIRST_NAME LIKE '%R%'
    #Prepared QUERY Statement
    PREPARED_SQL_QUERY_STATEMENT = SELECT * FROM TSHIRTS.CUSTOMER WHERE FIRST_NAME = ?
    PREPARED_SQL_QUERY_STATEMENT_VALUES = Roy
    #Prepared Insert
    PREPARED_SQL_INSERT_STATEMENT = INSERT INTO TSHIRTS.CUSTOMER VALUES(?,?,?,?,?,?,?,?,?,?,?)
    PREPARED_SQL_INSERT_STATEMENT_VALUES =130,John,Hiller,Miller,125 S St.,C6,Baltimore,MD,20100,4104444444,[email protected]
    #Prepared Update
    PREPARED_SQL_UPDATE_STATEMENT = UPDATE TSHIRTS.STATE SET STATE_NAME = 'California' WHERE CODE = ?
    PREPARED_SQL_UPDATE_STATEMENT_VALUES =CA
    #Data base schema name
    SCHEMA_NAME =TSHIRTS

  • Replace bzip2 and gzip with pbzip2 and pigz system wide?

    I just now got word of these multithreaded ports and would like to know if theres anyway to replace their single threaded brethren? pigz is already in AUR and it wouldn't take much to put pbzip2 into it either.
    Maybe some global variable should be set?
    Edit: Strike the part about pbzip2. It's already in community
    Last edited by uncholowapo (2010-10-10 23:48:04)

    karol wrote:One thing you may want to check: if you compress a file w/ pbzip2 and send it over to me, will I be able to uncompress it with bzip2?
    I just did some testing by downloading the Linux kernel source, and then using bzip2 and pbzip2 to decompress and recompress it several times.  In another terminal window I monitored the speed of each CPU core by running:
    watch 'cat /proc/cpuinfo | grep MHz'
    What I found out was that yes, the files created by either tool will be able to be decompressed with the other.  However, if you use pbzip2 to decompress a file compressed with the regular bzip2, it will only use one core.  Only when decompressing a file that was compressed with pbzip2 did pbzip2 use both CPU cores.

  • Contacts and Calendar with iCloud and non-iCloud devices

    I have a mix of non-iCloud and iCloud devices and macs, both at work and at home. Calendar has continued to sync correctly between all devices, however contacts is definitely not syncing between iCloud and non-iCloud devices. Bookmarks are also not coming across from iCloud devices to non-iCloud macs. Mail is working fine. I'm surprised that there is such variation in core apps. I would have expected iCal and Address Book to both work (or not work), but this seems not to be the case.
    Keen to know if this is the norm for other uses of mixed environments?

    I have a Macbook. Mac OS X 10.5.8. And an iPhone 4, as well as an iPad 2 - both on iOS 5.
    There is a really really annoying and silly issue with syncing contacts and calendars across my Mac using iTunes (cable) and the iCloud options when my Mac does not support iCloud.
    When I create / amend a contact or an event on my iOS device, if I choose (or more likely than not, the default option) "iCloud" for my contacts / calendar, the creation or amendment does NOT appear in my MAC even when syncing over cable with iTunes.
    I have to choose ONE to edit - either the iCloud version OR the "from my Mac" version.
    This is extremely annoying and silly - so much for Apple's seamless integration of products.
    Of course, the easiest way out (and I am assuming Apple's preferred option) is to
    (1) get a new Macbook Pro / Air that has OS X Lion which has iCloud inbuilt. - but that is just wasteful as my Macbook is still running flawlessly. (until now)
    Or to do the unthinkable and tinker with electronics when you are totally clueless (like I am) and to
    (2) upgrade to Snow Leopard and then to Lion - yeah right... have you friggin read those reviews?!?!
    Is Apple intending to solve these issues for the non iCloud / iCloud group of users and make the Apple experience better again?
    Or just because the company is doing great financially, and selling more products more than ever, and yet still have huge huge markets to conquer, gonna just ignore the above issues and just wait for our patience to wear thin, and do (1) - buy yet another new product.
    OR we could switch to android and samsung and PCs and what have yous... please do not make us make this choice!!!

Maybe you are looking for

  • How to not repeat data in XSL-FO

    Hello, All, Thank you for taking the time to read this.  Hopefully, I can adequately convey to you what the problem is. XSL-FO is 1.0 APEX Listener is 2.0.5 APEX 4.2.4 Altova StyleVision 2014 EE Using Altova StyleVision, I have created an XSL-FO file

  • Hi,about mapping

    where does mapping execute in? we know mapping may be base on java,abap,xslt. furthermor The mapping tool generates Java source code from the graphical mapping description, which is then compiled and packed in a JAR file that the Integration Engine e

  • Want to make a bootable DVD for Grandson to use.

    I picked up a eMac at an auction and want to give it to my Grandson so he will stay off his dad's Powerbook G4. I bought the OSX 10.4 install disks so I can do a legal install. However, I plan on limiting what is installed as a lot is stuff he doesn'

  • I am using firefox 11.0 in windows 7(64 bit) but firefox for windows xp is loading on my computer.

    Firefox 11.0 was working on this computer (windows 7 64 bit) but went into window xp mode.

  • Rip-off apps in the store

    If you do a search on the word "Microsoft" in the store, you will find several apps that are mostly purchased by people who confuse them with actual Microsoft products.  For example, we have "Microsoft(R) Word(R) 2010 -- mastering in 24h(TM)."  The r