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$

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!

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

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


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.

Warning:

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.
    CREATE TABLE DEMO_CLOB ( ID_COL INTEGER IDENTITY PRIMARY KEY, CLOB_COL CLOB)
  • 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.

    CREATE TABLE DEMO_BLOB (
    IDCOL INTEGER IDENTITY (1,1) PRIMARY KEY,
    BLOBCOL BLOB)

    • 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.

    About

    sakthi

    Search

    Categories
    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