Sunday Sep 07, 2008

http://kenai.com - Developer Collaboration Platform Released!

  • Checkout http://kenai.com - Developer Collaboration Platform just released!
  • Built using JRuby, Deployed on Glassfish V2, using MySQL - all on Sun Technologies and Products
  • Email me, if you would like an invite to be able to create projects there
  • It can house subversion and Mercurial repositories for your projects
  • You can have bugzilla, mailing lists, forums and wiki's for your project
  • You could use your Sun Developer Network account to login there
  • You could email to users@help.kenai.com and or post your comments/issues you might have at: http://kenai.com/projects/help/lists
  • Wednesday Jul 09, 2008

    want to know more about kenai.com?

    Checkout Tim Bray's Q&A with Nick Sieger at http://www.tbray.org/ongoing/When/200x/2008/09/09/Project-Kenai

    Friday Jul 04, 2008

    Installing MySQL gem gives OutofMemory Error

    dhcp-umpk16-82-199:~ sakthivelgopal$ gem install mysql -- --include=/usr/local/ lib Bulk updating Gem source index for: http://gems.rubyforge.org Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at java.nio.ByteBuffer.wrap(ByteBuffer.java:350) at java.lang.StringCoding$CharsetSD.decode(StringCoding.java:187) at java.lang.StringCoding.decode(StringCoding.java:228) at java.lang.String.(String.java:405) at org.jvyamlb.ScannerImpl.into(ScannerImpl.java:1432) at org.jvyamlb.ParserImpl$11.produce(ParserImpl.java:292) at org.jvyamlb.ParserImpl.parseStreamNext(ParserImpl.java:823) at org.jvyamlb.ParserImpl.peekEvent(ParserImpl.java:774) at org.jvyamlb.ComposerImpl.composeNode(ComposerImpl.java:111) at org.jvyamlb.ComposerImpl.composeNode(ComposerImpl.java:167) at org.jvyamlb.ComposerImpl.composeNode(ComposerImpl.java:148) at org.jvyamlb.ComposerImpl.composeNode(ComposerImpl.java:167) at org.jvyamlb.ComposerImpl.composeNode(ComposerImpl.java:167) at org.jvyamlb.ComposerImpl.composeNode(ComposerImpl.java:167) at org.jvyamlb.ComposerImpl.composeDocument(ComposerImpl.java:100) at org.jvyamlb.ComposerImpl.getNode(ComposerImpl.java:76) at org.jvyamlb.BaseConstructorImpl.getData(BaseConstructorImpl.java:97) at org.jruby.RubyYAML.load(RubyYAML.java:221) at org.jruby.RubyYAMLInvokerSload1.call(Unknown Source) at org.jruby.runtime.callback.FastInvocationCallback.execute(FastInvocationCallback.java:49) at org.jruby.internal.runtime.methods.SimpleCallbackMethod.call(SimpleCallbackMethod.java:81) at org.jruby.evaluator.EvaluationState.callNode(EvaluationState.java:568) at org.jruby.evaluator.EvaluationState.evalInternal(EvaluationState.java:207) at org.jruby.evaluator.EvaluationState.orNode(EvaluationState.java:1459) at org.jruby.evaluator.EvaluationState.evalInternal(EvaluationState.java:339) at org.jruby.evaluator.EvaluationState.eval(EvaluationState.java:164) at org.jruby.internal.runtime.methods.DefaultMethod.internalCall(DefaultMethod.java:135) at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:79) at org.jruby.evaluator.EvaluationState.fCallNode(EvaluationState.java:1023) at org.jruby.evaluator.EvaluationState.evalInternal(EvaluationState.java:253) at org.jruby.evaluator.EvaluationState.blockNode(EvaluationState.java:531) at org.jruby.evaluator.EvaluationState.evalInternal(EvaluationState.java:201) dhcp-umpk16-82-199:~ sakthivelgopal$ which ruby /usr/local/bin/ruby dhcp-umpk16-82-199:~ sakthivelgopal$ ruby -v ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.8.2] dhcp-umpk16-82-199:~ sakthivelgopal$

    Monday Apr 28, 2008

    Exciting time at MySQL Conference!

    It was quite an exciting time to be at the MySQL conference and i could experience the upbeat in the land of MySQL. Here is my quick comments on few of the sessions i liked:
  • Best Practices for Database Administrators
      Sheeri from Pythian, covered a great deal of DB Admin practices around Monitoring services, Backup/Restore, Documentation, Trouble Shootiong. Overall the session was very entertaining with all her cartoons and style of preso.
  • DTrace and MySQL
      This sesssion was even cooler. Just with a few simple lines of dtrace scripts, you could watch what queries are being processed by mysql daemon
  • Best Practices for Deploying MySQL on the Solaris Platform
      Solaris and MySQL - the combo looked like theey are made for each other for production deployments. The 64bit support and SMF service on Solaris for MySQL makes it easier and robust. Dtrace Chime tool looks good too.
  • Just-In-Time Scalability: Agile Methods to Support Massive Growth
      Excellent case study where IMVU started with a small setup and worked on it iteratively to build an architecture with which they could scale as well work on HA setup."
  • Performance Guide to MySQL Cluster, Helping InnoDB Scale on Servers with Many CPU Cores and Disks
      These sessions on Performance benchmarking and MySQL Cluster that were really good and very informative.
  • Friday Jul 27, 2007

    Deploy Ruby onto Glassfish and Experience the magic in performance yourself!

    Check out the Sun & Joyent sponsored event:
    JRuby on Rails: Power plus simplicity.
    https://events-at-sun.com/hackday/
    When: August 8, 2007, 2:30-8:00pm
    Where: Axis Cafe, 1201 8th St, San Francisco, CA 94107

    You can bring you laptop and deploy ruby application onto Glassfish and experience 500% performance increase!!

    Thursday Dec 07, 2006

    Missing Library References for Embedded Component Libraries

    How to resolve missing library references for Embedded Component Libraries?
    NetBeans Visual Web Pack 5.5 has built in Sun Web UI components. It is also possible for users to download and Import external component Libraries. When using such non-bundled component libraries in Visual Web project, those component libraries are included in the project (not references). When opening up such project built from Sun Java Studio Creator or built by someother developer, you get a message saying :
    Just click OK and Open a page, it should render fine.
    • If it still shows "Missing Library References" for those Embedded Component Library, Right click on the project node and choose Properties. In the project properties dailog, choose "Libraries" under catgeories, and click 'Remove' after selecting the warning-badged missing library reference. Remove the missing library reference in Build> Packaging category too.
    • If you get class missing in designer for references in the embedded component library, remove the EmbeddedComponent Library in projects Window under "Component Libraries" and re-add it using right Context action 'Add Component Library'.

    Friday Dec 01, 2006

    Understanding Scope and Managed Beans

    Check out this project which uses managed beans in Application, Session and Request Scope : Visual Web Project built using Understanding Scope and Managed Beans Tutorial

    Tuesday Nov 21, 2006

    Webinar: Simplifying Data Access using Netbeans Visual Web Pack

    Learn how to rapidly build visual applications that read, display, and update databases, browse and edit database schemas, data, and commands, and access databases using a variety of JDBC drivers. https://sunmeetings.webex.com/sunmeetings/onstage/g.php?AT=VR&RecordingID=300219071 ON Monday the 27th

    Friday Aug 25, 2006

    Our First Cut on Performant Creator!

    Get Improved Performance with Hotfix 2!
    The HotFix2 update for Creator 2 update 1 is available via UpdateCenter. We have tested this with large apps and are excited with big improvements!

    • Note:If your web application is more than medium sized, having more than 25 pages, we recommend increasing the default memory settings. This will enable Creator to give a comfortable designtime experience while building the project. Increase the maximum Java heap size from the default 384MB to 512MB or more, depending on the size of your application and the available physical memory on your computer.
      To do this, edit your $creator_install/etc/creator.conf file, changing:
      "-J-Xmx384m" to "-J-Xmx512m" or more
    • Check out this forum thread:
      http://swforum.sun.com/jive/thread.jspa?threadID=105441
      Please post your comments, feedback and suggestions in there to make this product better!

    Friday Jun 23, 2006

    How to use Oracle Sequence for auto increment column

    While reading through this thread http://forum.sun.com/jive/thread.jspa?threadID=99306 I had to check out how to invoke sequence.nextval for new row being appended.


    Here's how i did achieve this:

    1. Created a Sequence and a Table:
    CREATE SEQUENCE userid_seq MINVALUE 1 START WITH 1 INCREMENT BY 1 NOCACHE;
    create table user_seq_test ( seq_col int not null primary key, char_col char(10) );

    2. Creating a Page to append rows into this table:
    Add a datadource (say ora9i) to access this database table in Servers Window. Create a New Project, drag and drop user_seq_test table onto page. Dropa text field and bind it to user_seq_test.char_col. Add a button for "Append Row". Add a message group to be able to see the error messages on the page, when it happens.

    In the prerender, append a row to the dataprovider and get the sequence value for the new row and set it:
    try {
        RowKey rk = user_seq_testDataProvider.appendRow();
        user_seq_testDataProvider.setCursorRow(rk);
                
        Connection conn = null ;
        Statement sqlStatement = null ;
        ResultSet rs = null ;
                
        javax.naming.Context ctx = new javax.naming.InitialContext() ;
        DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/ora9i") ;                      
        conn = ds.getConnection() ;                        
        // setup the connection             
        conn.setAutoCommit(true) ;                         
        // execute the query            
        sqlStatement = conn.createStatement() ;
        rs = sqlStatement.executeQuery("select userid_seq.NEXTVAL from dual" ) ;
        rs.next() ;
        int nextvalue = rs.getInt(1) ;
        user_seq_testDataProvider.setValue("seq_col", new Integer(nextvalue));
        rs.close();
        sqlStatement.close();
        conn.close();
            } catch (Exception ex) {
                error(ex.getMessage());
                log("Error Description", ex);
            }
    
    In the append Row Button action:
    try {
                user_seq_testDataProvider.commitChanges();
                user_seq_testDataProvider.refresh();
            } catch (Exception ex) {
                log("Error Description", ex);
                error(ex.getMessage());
            }
    

    So, when we want to use Sequence.NEXTVAL, you need to fetch the value and set this value on the auto-increment column in the appended row.

    We could use similar technique for calling functions and stored procedures.

    Wednesday Jun 14, 2006

    How to Track JDBC Calls with DataDirect Spy



    You could track the JDBC calls made using the Sun JDBC Driver (rebranded DataDirect Connect for JDBC Driver) using DataDirect Spy included with the Sun JDBC Driver.

    To use the DataDirect Spy with Sun Java Studio Creator:
    • You need to add new Database Server Type. Call it 'OracleSpy', Choose smbase.jar, smutil.jar, smoracle.jar & smspy.jar from $creator_installdir/rave2.0/core/ directory, click Suggest to get the DriverClassName, Enter the JDBC url like: jdbc:sun:oracle://#HOSTNAME:1521;SID=#DATABASE;SpyAttributes=(log=(file)C:\\\\temp\\\\spy.log;linelimit=80;logTName=yes;timestamp=yes)");
    • Add a datasource using the newly added server type
    • View the log file C:\\\\temp\\\\spy.log for JDBC calls being tracked
    • With every operation in the IDE (like Adding datasource, consuming tables in project via drag and drop, opening query editor on a rowset, deploying/running the project) JDBC calls would be made and all those tracking information will be routed to this spy.log

    Both at design time and runtime, Creator and CreatorApps make jdbc calls to fetch data and metadata. When query editor on a rowset is opened for the firsttime after the project is opened, it fetches the metadata, so it is likely to make a little more time for the first time. Sucessive opening of the rowset in query editor could be faster (as long as the project is opened).

    For more info on using DataDirect Spy refer: http://media.datadirect.com/download/docs/jdbc/jdbcref/diagnostics.html#wp615221

    Wednesday Jun 07, 2006

    Fast Track (3 days) Learning - WebApps and Portlets Development using Java Studio Creator

    If you are craving to get started or understand deeper with Java Web Application and Portlet Development, this Threee Day Fast Track Course will be the awesome event for you!

    • You will get this Field guide.
    • This workshop is loaded with lots of exerices with explains building web applications and portlets very quickly.
    • Building Web Applications with Creator using JAX Components is the HOT thing!
    • This will give you indepth understanding of various technologies like JavaServer Faces, JDBC rowsets, dataproviders.

    Friday Apr 07, 2006

    How to bind checkbox to non-boolean datatype?

    CheckBox has two properties -- selected and SelectedValue

    selected property is used purely for display purpose i.e, selecting/deselecting the checkbox being displayed

    selectedValue is returned by checkbox1.getSelected(), when the checkbox is selected i.e, checkbox1.isSelected() returned true.

    checkbox works intuitively/easily when bound to a [Bb]oolean data type i.e, w/o additional wiring/coding.

    When it needs to be bound to a non-boolean datatype (like Integer, or String), we need to explicitly create a boolean property and bind the checkbox to that property. This property should have getter (isPropertyname) and setter (setPropertyname).

    Suppose that you have TRAVEL.PERSON.FrequentFlyer is of type SMALLINT. So,

    0. Drop a table and drop this database table TRAVEL.PERSON onto it (which has FrequestFlyer as smallint)

    1. we add/create a property, named frequentFlyer, in page with type\* boolean\* (use primitive type boolean and not Object type Boolean) i.e, Right click on $ProjectNode in Projects> Source Pakcages> $DefaultPackage> Page1.java. Choose Add> Property. Enter name as frequentFlyer, type as _boolean_ and click OK

    2. Modify it's gettter (in Page1.java) as in: public boolean isFrequentFlyer() {
    Object value = getValue("#{currentRow.value['PERSON.FREQUENTFLYER']}");
    if(value != null){ Integer freqFlyer = (Integer) value; return freqFlyer.intValue()==1? true : false ; }
    return false; }

    3. Modify it's setter as in :

    public void setFrequentFlyer(boolean frequentFlyer) { if(frequentFlyer){ setValue("#{currentRow.value['PERSON.FREQUENTFLYER']}", new Integer(1)); }else{ setValue("#{currentRow.value['PERSON.FREQUENTFLYER']}", new Integer(0)); }; }

    4. Modify the table layout to display FrequentFlyer column as checkbox and bind the selected property of the checkbox (using property bindings) to this FrequentFlyer boolean property in the PageBean and Run Project to see it working!

    These little extra steps are needed to bind checkbox to a non-boolean type database column.

    Tuesday Mar 07, 2006

    CRUD Project in Portlet Environment

    While exercising the CRUD Tutorial (Performing Inserts, Updates and Deletes) in a Portlet Project, I have learnt that Portlet Life Cycle is little different from that of a normal Creator WebApplication.

    Unlike a normal web application page, a portlet page can't assume that the page being rendered in the Render Response phase is the same page that was built in Restore View. If a portlet wants to maintain state across repeated render requests, the portlet must use the session bean to store stateful information.

    The prerender code in this CRUD Portlet tutorial is little different from the one used in normal webapplication(as suggested in the tutorial). It uses a sessionbean property personId to persist the current personId selection or its change and then uses the same for passing as the parameter to the tripRowSet.

    Here's the Creator Project built, InsertUpdateDelete_Portlet.zip, that works fine with the bundled Pluto w/ SunAppserver. Download this project, Open it in IDE and Choose Run project to deploy this to the bundled container.

    Wednesday Feb 22, 2006

    Flavors of CRUD Tutorial projects against all Supported Databases

    The purpose of this blog item is to share the Creator 2 projects built while exercising the Performing Inserts Updates and Deletes Tutorial against all of the supported databases using the bundled Sun JDBC Drivers. Check out the Creator 2 system requirments for Supported Database Servers and JDBC Drivers.

    Note: You will need to setup the travel schema on your database and add a datasource for it in Servers window. You could use the exported_datasources_travel_sample.xml for importing/creating your datasource. Change $hostname, port# and validation table appropriately.

    Database Type Schema/SQL files, Creator 2 Project
    PointBase 5.2 (bundled)

    $Creator_install/rave2.0/startup/samples/ create-schema-travel.sql and create-Travel.sql

    DataSource Name: Travel

    InsertUpdateDelete_PointBase.zip

    MySQL 5.x/4.x

    create-Travel-MySQL.sql

    DataSource Name: mysql_travel

    InsertUpdateDelete_MySQL.zip

    Oracle 9i/10g

    OraCreateTravelDB.sql

    DataSource Name:ora10g_travel

    InsertUpdateDelete_Oracle.zip

    MS SQL Server 2000

    create-Travel-SQLServer.sql

    DataSource Name:mssql_travel

    InsertUpdateDelete_MSSQL.zip

    Sybase ASE 12.5

    create-Travel-Sybase.sql

    DataSource Name: sybase_travel

    InsertUpdateDelete_Sybase.zip

    IBM DB2 8.1

    create-Travel-DB2.sql

    DataSource Name:db2_travel

    InsertUpdateDelete_DB2.zip


    About

    sakthi

    Search

    Archives
    « April 2014
    SunMonTueWedThuFriSat
      
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
       
           
    Today