Friday April 17, 2009
GlassFish and NetBeans at MySQL Users Conference 2009

What is open source, production-quality, supported by a large vibrant
community, and comes with full enterprise support ? - GlassFish and MySQL.
Did you know that GlassFish ...
| When: | April 21, 2009 (Tuesday), 3:05 pm |
| Where: | Ballroom A |
Posted by Arun Gupta in General | Comments[6]
|
|
|
|
|
Wednesday April 08, 2009
TOTD #78: GlassFish, EclipseLink, and MySQL efficient pagination using LIMIT
EclipseLink
JPA replaces TopLink
Essentials as the JPA implementation in GlassFish v3. One
of the benefits of using EclipseLink is that it provides efficient
pagination support for the MySQL database by generating
native SQL statements such as "SELECT ... FROM <table>
LIMIT <offset>, <rowcount>".
The MySQL LIMIT clause definition
says:
The
LIMIT clause can be used to constrain the number of rows returned by
the SELECT statement. LIMIT takes one or two numeric arguments, which
must both be non-negative integer constants (except when using prepared
statements).
With two arguments, the
first argument specifies
the offset of the first row to return, and the second specifies the
maximum number of rows to return. The offset of the initial row is 0
(not 1):
SELECT * FROM tbl LIMIT
5,10; # Retrieve rows 6-15
So instead of fetching all rows from the database and then filtering
from row 6-15, only rows 6 through 15 are fetched.
This TOTD (Tip
Of The Day) explains how to
create a JPA Persistence Unit for sakila
(MySQL sample database) using NetBeans,
use EclipseLink as the Persistence Provider, and then write a JPA query
to leverage the pagination support - all on GlassFish v3.

| <properties> <property name="eclipselink.logging.level" value="FINE"/> </properties> |
| ./asadmin create-jdbc-connection-pool
--datasourceclassname
com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource --property
user=duke:password=glassfish:ServerName=localhost:portNumber=3306:databaseName=sakila
jdbc-mysql-pool |
| ./asadmin create-jdbc-resource --connectionpoolid jdbc-mysql-pool jndi/sakila |
| @PersistenceUnit EntityManagerFactory emf; |
|
EntityManager em = emf.createEntityManager(); response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); try { int startRow = Integer.valueOf(request.getParameter("start_row")); int howMany = Integer.valueOf(request.getParameter("how_many")); Query q = em.createNamedQuery("Film.findAll"); q.setFirstResult(startRow); q.setMaxResults(startRow + howMany); for (Object film : q.getResultList()) { out.print(((Film)film).toString() + "<br/>"); } } finally { out.close(); } |

| [#|2009-04-07T14:01:12.815-0700|FINE|glassfish|org.eclipse.persistence.session.file:
/Users/arungupta/tools/glassfish/v3/b43/glassfishv3/glassfish/domains/domain1/applications/Pagination/WEB-INF/classes/-PaginationPU.sql|
_ThreadID=15;_ThreadName=Thread-1;ClassName=null;MethodName=null;|SELECT
film_id AS film_id1, special_features AS special_features2, last_update
AS last_update3, rental_duration AS rental_duration4, release_year AS
release_year5, title AS title6, description AS description7,
replacement_cost AS replacement_cost8, length AS length9, rating AS
rating10, rental_rate AS rental_rate11, language_id AS language_id12,
original_language_id AS original_language_id13 FROM film LIMIT ?, ? bind => [1, 11]|#] |
| [#|2009-04-07T17:00:34.210-0700|FINE|glassfish|org.eclipse.persistence.session.file: /Users/arungupta/tools/glassfish/v3/b43/glassfishv3/glassfish/domains/domain1/applications/Pagination/WEB-INF/classes/-PaginationPU.sql| _ThreadID=15;_ThreadName=Thread-1;ClassName=null;MethodName=null;|SELECT film_id, special_features, last_update, rental_duration, release_year, title, description, replacement_cost, length, rating, rental_rate, language_id, original_language_id FROM film|#] |
Posted by Arun Gupta in web2.0 | Comments[8]
|
|
|
|
|
Tuesday March 31, 2009
ISV & OEMs Webinar Replay: GlassFish- and MySQL-Backed Applications with Netbeans and JRuby-on-Rails
I presented a webinar for ISV and OEMs on "Developing
GlassFish- and MySQL-Backed Applications with NetBeans and
JRuby-on-Rails" last
week.

The slides and a complete recording
of the webinar are now available here.
Technorati: webinar
glassfish
mysql netbeans
jruby rubyonrails
Posted by Arun Gupta in web2.0 | Comments[3]
|
|
|
|
|
Tuesday March 24, 2009
Here are some quotes from a recent
article talking about Oracle's
maintenance and support fees:
Before Oracle acquired
BEA earlier this year, the company charged 18% to 20% for support and
maintenance. Oracle increased those fees to meet its own structure and
also raised list prices on most BEA products.
That didn't sit well.
and
One Java-centric VAR,
who spoke on the condition of anonymity, said some of his BEA WebLogic
customers are moving to alternative application servers just to get
away from Oracle.
and
"What company comes in
this climate and not only jacks up prices but support prices as well?"
asked one frustrated BEA customer, who spoke on the condition of
anonymity.
and
"Many SAP and Oracle
customers intend to push back their maintenance fees," he said.
"Customers seek an option to just pay for tax and compliance updates
without paying for future innovation. They are willing to pay for
future modules when that time comes. If they can't access such options,
they would prefer third party options like Rimini Street for Oracle
[E-Business Suite] and SAP's applications."
Have you been bitten by Oracle's price raise ?
Interested in an industry-grade, highly performant, feature-rich, and
open source alternative ?
GlassFish and MySQL together provide an excellent
choice - give it a try!
Technorati: glassfish
mysql
opensource
sun oracle
Posted by Arun Gupta in General | Comments[1]
|
|
|
|
|
Monday March 23, 2009
This is a re-run of an earlier
webinar.
Would you like to know how JRuby,NetBeans, GlassFish, and MySQL can power your Rails
applications ?

This informative
technical webinar explains the fundamentals of JRuby and how
the NetBeans IDE makes developing/debugging/deploying Rails
applications on GlassFish quick, fun and cost-effective.
The webinar starts 10am PT on Mar 31st, 2009 and can be accessed from a
browser.
Register here.
Technorati: jruby
rubyonrails
glassfish
netbeans
mysql webinar
Posted by Arun Gupta in web2.0 | Comments[2]
|
|
|
|
|
Thursday February 05, 2009
Webinar Replay Available: GlassFish and MySQL-backed applications with NetBeans and JRuby-on-Rails
I presented a webinar on "Developing
GlassFish- and MySQL-Backed Applications with NetBeans and
JRuby-on-Rails" last
week.

The slides and a complete recording
of the webinar are now available here.
Technorati: webinar
glassfish
mysql netbeans
jruby rubyonrails
Posted by Arun Gupta in web2.0 | Comments[1]
|
|
|
|
|
Monday January 26, 2009
Would you like to know how JRuby,
NetBeans, GlassFish, and MySQL can power your Rails
applications ?

This informative
technical webinar explains the fundamentals of JRuby and how
the NetBeans IDE makes developing/debugging/deploying Rails
applications on GlassFish quick, fun and cost-effective.
The webinar starts 10am PT on Jan 27th, 2009 and can be accessed from a
browser.
Register here.
Don't miss out, it's going to start in less than 12 hours!
Technorati: jruby
rubyonrails
glassfish
netbeans
mysql webinar
Posted by Arun Gupta in web2.0 | Comments[2]
|
|
|
|
|
Tuesday January 20, 2009
Sun Tech Days 2009, Singapore - Welcome Reception
Follow up from Part
1.
Attended "What Developers should care about MySQL ?" by Colin and
"Groovy and Grails" by Chuk-munn
Lee.
I enjoyed both the talks for different reasons. Colin's talk explained
the pluggable
storage engine architecture that is unique to MySQL
(pronounced my-ess-kew-ell,
not my-sequel).
It was interesting to know that the different storage engines can be
picked a la carte
based upon the requirements. The performance comparison for INSERTs was
5x between MyISAM, InnoDB and Archive storage engines. But then InnoDB
provide transactions and other goodies. Multiple performance tuning
tips such as using negative unsigned int instead of BIGINT and
partitioning databases if the number of records grow more than 1 billion were good! Keep an eye
on his blog
for slides.
Chuk's talk introduced Groovy, Grails,
showed several samples of NetBeans
and Grails
integration. A Grails application can be deployed as a WAR file on
GlassFish. Alternatively you can download the Grails module from GlassFish v3 Update
Center and use the standard "run-app" command to run your
Grails application using the embedded GlassFish v3 instead of Jetty.
This
is explained nicely in the screencast below:
Posted by Arun Gupta in General | Comments[3]
|
|
|
|
| Sun Tech Days 2009, Singapore - Day 1
The Sun Tech Days
Singapore started earlier this morning - over 1100
developers, an outstanding audience!!!
The kick off had a good local flare when the Gods of
Longevity, Fortune, and Prosperity (Fu Lu Shou) showed up to
start the event ;-) The build up to their appearance was really
exciting as evident from
the video below:
This particular event will also be recorded in Singapore
Book of Records for the largest numbers of Sun developers
playing
a rattle together :) Here are some pictures from the event:
| glassfish/bin/asadmin start-domain --verbose |
| INFO: GlassFish v3 Prelude startup time : Felix(1732ms) startup services(1091ms) total(2823ms) |
Posted by Arun Gupta in General | Comments[4]
|
|
|
|
|
Wednesday January 14, 2009
TOTD #65: Windows 7 Beta 1 Build 7000 on Virtual Box: NetBeans + Rails + GlassFish + MySQL
Microsoft released Windows 7
Beta 1 - the next major version of Vista, download
here. There are tons
of improvments mostly centered around making the content
easily & intuitively accessible. But hey, Mac OSX already
serves
that purpose well for quite some time ;-)
But I still want to make sure that our Rails stack (NetBeans,
GlassFish,
and MySQL) work fine on it. And it very well do, without any issues, as
you'll realize at the end of this blog :)
Lets first get started with installing Windows 7 Beta as a Virtual Box
image. Few points to note here:











Posted by Arun Gupta in web2.0 | Comments[8]
|
|
|
|
|
Tuesday January 13, 2009
GlassFish @ University of Essex and Frankfurt - Go Campus Ambassadors!
This blog highlights couple of contributions by Campus
Ambassadors (CA) from
University of Essex
and Frankfurt
towards GlassFish.
![]() |
Jenya Kovalchuk (Campus Ambassador in the University of
Essex, UK) gave a talk
on GlassFish. The pre- and post-conditions of talk are really
compelling: |
![]() |
Igor Geier from University of Frankfurt developed a A MySQL GlassFish application. The application is a work-in-progress but it sure will show the ease-of-use of GlassFish and tight integration with NetBeans. |
Posted by Arun Gupta in General | Comments[3]
|
|
|
|
|
Monday January 12, 2009
TOTD #64: OpenSolaris 2008/11 using Virtual Box
Here is a blog entry that was sitting in my Drafts folder for a long
time
(just because I didn't realize :). Anyway, it shows how to install Open Solaris 2008/11
on Virtual Box.
The original install was done using Virtual Box 2.0.6. I installed
Virtual Box 2.1 this morning and the image was easily recognized by the
updated Virtual Box.
Here are the basic steps.
Create a new VM ...

As part of the previous step, create a new Virtual Disk mapping to the
downloaded Open Solaris image ...

The generated VM settings are shown as below:

Click on "Start" and configure for the first run as:

Boot the Virtual Macine from the LiveCD shows the following GRUB:

Take the default for Language and Keyboard and then the following
screen is shown after the boot:

Click on "Install OpenSolaris" ...

Clicking on "Install" starts the installation ...

And finally the install is completed.

Click on "Reboot", select "Boot from Hard Disk" and press Enter ...

And then select if "full boot" or "text boot" is required as shown:

And the welcome screen is shown as:

Now you can develop your Rails
applications using the NetBeans
IDE and deploy them on GlassFish
and MySQL easily as
explained here.
There are multiple updates to the stack described earlier - JRuby 1.1.6,
Rails
2.2, MySQL
Alpha 6.0.x, GlassFish
v3 Prelude, and Virtual Box
2.1.
So go ahead and develop, deploy, and debug your Rails applications as
described in screencast
#26. You can even manage your Rails applications using JMX as
described in TOTD #61,
#62,
and #63.
Hwo do you follow the latest on each technology:
Posted by Arun Gupta in web2.0 | Comments[9]
|
|
|
|
|
Tuesday January 06, 2009
TOTD #60: Configure MySQL 6.0.x-alpha to NetBeans 6.5
This Tip Of The Day answers the
following comment
on my blog:
How to Configure a MySql database to be able to connect Netbeans6.5.?
I've tried using mysql Server 6 many times, but it fails.
Please, let me know how to fix that problem.
lrwxr-xr-x 1 root wheel 32 Jan 5 14:00 mysql -> mysql-6.0.8-alpha-osx10.5-x86_64 |
| ~ >sudo mysqld_safe 090105 14:20:51 mysqld_safe Logging to '/usr/local/mysql/data/dhcp-usca14-133-38.SFBay.Sun.COM.err'. 090105 14:20:52 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data |




Posted by Arun Gupta in General | Comments[4]
|
|
|
|
|
Thursday November 27, 2008
GlassFish and MySQL Student Contest - Winners announced
GlassFish
and MySQL student contest winners are announced!
Kolli Bharath from Dhirubhai
Ambani Institute of Information and Communication Technology,
India (review,
project)
and Tomas Augusto
Muller, Universidade
de Santa Cruz do Sul, Brazil (review,
project)
won the grand prize of $500 each. There are 7
second prize winners of $250 each.
Congratulations to all the winners!
Meet some of the contest participants here,
here,
here,
and here.
There were lots of great entries and picking one was a tough decision.
But luckily the process was simple and clearly defined for all the
judges. Each submission was assigned numbers between 1-100 in
8 pre-defined criteria and then a winner was picked. Now, don't ask us
about the total marks for each entry or the winning margin ;)
Thanks to all the judges for reviewing the entries!
Here are some guidelines I followed during the review:
Posted by Arun Gupta in General | Comments[9]
|
|
|
|
|
Monday October 20, 2008
CIO published an article
highlighting 5 cheap (or free) software that can be afforded during
financial crisis. Their recommendations are:


Posted by Arun Gupta in General | Comments[7]
|
|
|
|
|
Today's Page Hits: 5863
Total # blog entries: 1004
| « December 2009 | ||||||
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
| 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 | 31 | ||
| Today | ||||||