sakthi's blog
http://kenai.com - Developer Collaboration Platform Released!
http://kenai.com - Developer Collaboration Platform Released!
Posted at 11:35PM Sep 07, 2008 by sakthi in Sun |
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
Posted at 12:17AM Jul 10, 2008 by sakthi in Creator |
Installing MySQL gem gives OutofMemory Error
Posted at 06:36PM Jul 04, 2008 by sakthi in Creator |
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:
Posted at 01:46PM Apr 28, 2008 by sakthi in MySQL |
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!!
Posted at 10:12AM Jul 27, 2007 by sakthi in JRuby, Rails |
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.
Posted at 04:38PM Dec 07, 2006 by sakthi in NetBeans |
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
Posted at 11:35AM Dec 01, 2006 by sakthi in NetBeans |
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
Posted at 09:57AM Nov 21, 2006 by sakthi in Creator |
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!
Posted at 02:21PM Aug 25, 2006 by sakthi in Creator |
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.
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.
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.
Posted at 04:01PM Jun 23, 2006 by sakthi in Sun |
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:
Posted at 04:07PM Jun 14, 2006 by sakthi in Creator |
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!
Posted at 11:39AM Jun 07, 2006 by sakthi in Sun |
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() {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.
Posted at 10:07AM Apr 07, 2006 by sakthi in Creator |
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.
Posted at 11:55AM Mar 07, 2006 by sakthi in Creator | Comments[2]
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 |
Posted at 11:47AM Feb 22, 2006 by sakthi in Creator |