Wednesday Jul 09, 2008

want to know more about

Checkout Tim Bray's Q&A with Nick Sieger at

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: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at java.nio.ByteBuffer.wrap( at java.lang.StringCoding$CharsetSD.decode( at java.lang.StringCoding.decode( at java.lang.String.( at org.jvyamlb.ScannerImpl.into( at org.jvyamlb.ParserImpl$11.produce( at org.jvyamlb.ParserImpl.parseStreamNext( at org.jvyamlb.ParserImpl.peekEvent( at org.jvyamlb.ComposerImpl.composeNode( at org.jvyamlb.ComposerImpl.composeNode( at org.jvyamlb.ComposerImpl.composeNode( at org.jvyamlb.ComposerImpl.composeNode( at org.jvyamlb.ComposerImpl.composeNode( at org.jvyamlb.ComposerImpl.composeNode( at org.jvyamlb.ComposerImpl.composeDocument( at org.jvyamlb.ComposerImpl.getNode( at org.jvyamlb.BaseConstructorImpl.getData( at org.jruby.RubyYAML.load( at Source) at org.jruby.runtime.callback.FastInvocationCallback.execute( at at org.jruby.evaluator.EvaluationState.callNode( at org.jruby.evaluator.EvaluationState.evalInternal( at org.jruby.evaluator.EvaluationState.orNode( at org.jruby.evaluator.EvaluationState.evalInternal( at org.jruby.evaluator.EvaluationState.eval( at org.jruby.internal.runtime.methods.DefaultMethod.internalCall( at at org.jruby.evaluator.EvaluationState.fCallNode( at org.jruby.evaluator.EvaluationState.evalInternal( at org.jruby.evaluator.EvaluationState.blockNode( at org.jruby.evaluator.EvaluationState.evalInternal( 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$

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. 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:
    Please post your comments, feedback and suggestions in there to make this product better!

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:

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> Choose Add> Property. Enter name as frequentFlyer, type as _boolean_ and click OK

2. Modify it's gettter (in 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,, 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

MySQL 5.x/4.x


DataSource Name: mysql_travel

Oracle 9i/10g


DataSource Name:ora10g_travel

MS SQL Server 2000


DataSource Name:mssql_travel

Sybase ASE 12.5


DataSource Name: sybase_travel

IBM DB2 8.1


DataSource Name:db2_travel

Thursday Feb 02, 2006

What and Where is IDE's user directory?

For Creator 2, IDE's default user directory is at: $UserHome/.Creator/2_0

$UserHome is
- On Windows, C:\\DOcument and Settings\\$username
- On Unices, it is users home directory

Users can specify their own user directory with an argument while starting IDE like:
On Windows C:\\Sun\\Creator2\\bin> creator.exe -userdir $user_specified_userdir
On Unices, \\home\\$username\\Creator2\\bin\\creator -userdir $user_specified_userdir

IDE's user directory contains changes, configurations and resource additions that user's perform with IDE like
- Adding New JDBC Drivers
- Adding New DataSources
- Adding New WebServices and EJB's for consumption via Servers Window
- Making changes to IDE Options like editor settings, proxy changes

IDE usually uses new user directories across new releases. Some releases might provide a way to import users directories that contain their settings from the previous release.


Purging the userdirectory would be equal to cleaning up all the configuration changes that has been done to the IDE installation by user, like reverting back to the Out-of-the-box state. Corrupt user directories could result in some unexplainable behavior in IDE. In such cases, users are suggested to restart their IDE with a new userdir to see if their problem goes away.

Wednesday Feb 01, 2006

How to upload and retrieve text files to/from Database CLOB column?

This Simple Creator 2 Project zip demos how to upload text files into database CLOB column and retrieve back those files.

How to get the sample app running:

  • Download and extract the project zipfile into a directory
  • Create a table DEMO_CLOB in PointBase Order datasource i.e., Invoke View Data on Order Datasource in Servers window. Copy & paste this SQL into the textarea and click RunQuery button to execute the command. This SQL creates the required table in PointBase sample database PBPUBLIC schema.
  • Open the project in Creator and Click on Run Main Project (aka Green Arrow) tollbar button
  • Click Browse and choose a text file.
  • Click Upload to updload this into database. It also retrieves back all the rows in this database table and displays using in a table component.
  • What's wired in this project:

    • A ClobConverter class. It is declared in WEB-INF/faces-config.xml and the attribute converter="ClobConverter" is added in JSP to the tableColumn bound to CLOB_COL
    • Upload button action fetches the file contents and updates the database

    screenshot - click to see full size

    Friday Jan 27, 2006

    How to upload and retrieve BLOB Datatypes to/from database?

    It is very common among web applications to upload files like Images, PDF’s into database and retrieve them when user needs to view those files. This Creator 2 Project zipfile available here demos this task.

    • Download and extract the project zip into a directory
    • Create a table DEMO_BLOB in PointBase Order datasource i.e., Invoke View Data on Order Datasource in Servers window. Copy & paste this SQL and click RunQuery button to execute the command. This SQL creates the required table in PointBase sample database PBPUBLIC schema.


    • Open the project in Creator and Click on Run Main Project (aka Green Arrow) toolbar button

    • Click Browse and choose an image file. A few sample images files are available in the project at $Demo_Blob/web/sample_images folder

    • Click Upload Button to updload this into database. It also retrieves back all the images in this database table and displays using in a table component.

    What’s wired in this project:

    • DisplayServlet that pulls the image for a given ID.

    • Upload Button action handler inserts a row with the imagefile into database table DEMO_BLOB.

    • Image component in the table uses the DisplayServlet URL to retrieve the image from database

    • Servets and servlet-mappings have been declared in WEB-INF/web.xml

    screenshot - click to see full size

    Navigating through a Large RowSet

    By Default, when database tables are dropped onto a page or a component like Table, it is configured to retrieve all rows on its execution. There are use cases where we don't want to be doing this, particularly, when table has thousands or millions of rows. In such cases, it would be good to set pagesize property appropriately, to limit the number of rows retrieved at a time.

    This Sun Java Studio Creator 2 Sample Project available here demo's how to set up navigation through such large rowsets. It uses cachRowSet.nextPage() and crs.previousPage() to navigate through the rowsets.

    screenshot - click to see full size

    Note: When clicking NextPage button for the first time, it doesn't navigate to the next page.Whereas successive clicks on NextPage works fine. This is a known issue in the product.




    « July 2016