Showing entries 31 to 39
« 10 Newer Entries
Displaying posts with tag: totd (reset)
TOTD #44: JDBC Connection Pooling for Rails on GlassFish v3


TOTD #9 explained how to configure JDBC connection pooling for Rails application deployed on GlassFish v2. There are several benefits of using using the JDBC connection pools:

  • No need to create a new database connection for each Rails instance.
  • No need to specify your password in database.yml or create a hack to hide it.
  • No garbage collection of connection after each use.

And because of the above mentioned (and other reasons) an improved application performance, scalability and efficiency.
The only way to deploy a Rails application on GlassFish v2 is to create a WAR file using …

[Read more]
TOTD #42: Hello JavaServer Faces World with NetBeans and GlassFish

This TOTD (Tip Of The Day) shows how to create a simple Java Server Faces application using NetBeans IDE 6.1. This is my first ever Java Server Faces application :) Much more comprehensive applications are already available in NetBeans and GlassFish tutorials.

The application is really simple - it allows you to create a database of cities/country that you like. You enter the city & country name on a page and click on Submit. This stores the data entered in the backend database and displays all the stored values in a new page. This application demonstrates simple JSF concepts:

  • How to create a JSF application using NetBeans IDE …
[Read more]
TOTD #40: jQuery Autcomplete widget with MySQL, GlassFish, NetBeans

TOTD #39 explained how to create an Autocomplete widget (server-powered autocompleting of text fields, similar to Google Suggest) using Prototype/Script.aculo.us libraries with NetBeans, GlassFish and MySQL. This Tip Of The Day (TOTD) builds upon that project and shows how same functionality can be achieved using jQuery Library.

  1. Use the NetBeans project created in TOTD #39. Right-clicking on the project, select "New", "JSP...", enter the name as "index2" …
[Read more]
TOTD #39: Prototype/Script.aculo.us Autcomplete widget with MySQL, GlassFish, NetBeans

There are several JavaScript libraries that can be embedded in your webapplication to create a visually appealing interface. Script.aculo.us is one of the popular ones and is built on the Prototype JavaScript Framework. The library provides an easy-to-use, cross-browser user interface JavaScripts that allows you to create fancy effects commonly visible on web pages these days.

This blog entry gets you started by using Ajax.Autocompleter that allows for server-powered autocompleting of text fields. Basically, you type a character in a text field and suggestions for possible correct values starting with that character are shown . This is achieved by by sending an Ajax request to the data source on server, passing the typed …

[Read more]
TOTD #38: Creating a MySQL Persistence Unit using NetBeans IDE


This TOTD (Tip Of The Day) shows how to create a Persistence Unit (PU) for a MySQL database using NetBeans IDE. This PU can then be used in any of Java EE artifacts (JSP, Servlet, EJB, ...) for database interaction.

  1. In NetBeans IDE, create a new project
    1. Create a new NetBeans Web project and enter the values ("Autocomplete") as shown:



      and click on "Next".
    2. Choose GlassFish v2 as the deployment server and then click on "Finish".
  2. Set up the database
    1. Start the database as:

      ~ >sudo mysqld_safe --user root
      Password:<YOUR …
[Read more]
TOTD #35: Rails Database Connection on Solaris

Are you deploying your JRuby-on-Rails applications on Solaris (or any variety of Unix) and not able to connect to the database ?

I experienced it last week so thought of sharing the tip here. Luckily it's really simple.

Here is the default generated "config/database.yml"

development:
  adapter: mysql
  encoding: utf8
  database: runner_development
  username: root
  password:
  socket: /tmp/mysql.sock


The only required change is to add "host: 127.0.01" for the required database configuration. The updated fragment is shown below (with change highlighted):

[Read more]
TOTD #31: CRUD Application using Grails - Hosted on GlassFish and MySQL


TOTD #30 explained how to create CRUD application using Grails and hosted using in-built Jetty servlet engine and in-memory HSQLDB database. Jetty and HSQLDB are built into Grails and allows to start easily. You can also use GlassFish and MySQL for deploying your applications in production environment.

This blog entry walks you through the steps of deploying a Grails application on GlassFish and MySQL.

  1. If MySQL is already installed, then download …
[Read more]
TOTD #24: Getting Started with Rails 2.0.x in JRuby 1.0.3 and JRuby 1.1RC1


This TOTD (Tip Of The Day) shows how to install Rails 2.0.x in JRuby 1.0.3 and JRuby 1.1 RC1. Then it describes how a simple Rails application can be created and deployed using WEBrick.

First, lets deal with installing Rails 2.0.x in JRuby 1.0.3 and JRuby 1.1 RC1.

Step 1: How to install Rails 2.0.x in JRuby 1.0.3 ?

  • Download and Unzip JRuby 1.0.3. This creates "jruby-1.0.3" directory.
  • Install Rails by giving the following command in the newly created directory:

    bin/jruby -S gem install rails --include-dependencies --no-ri --no-rdoc
    Bulk updating Gem source index for: http://gems.rubyforge.org
    Successfully installed rails-2.0.2
    Successfully installed activesupport-2.0.2
    Successfully installed activerecord-2.0.2
[Read more]
TOTD #9: Using JDBC connection pool/JNDI name from GlassFish in Rails Application

Using the instructions followed in JRuby Hack Day and taking some help from Nick, I figured out how to use the JDBC connection pools configured in GlassFish using the JNDI names.

All the commands given below are relevant for GlassFish but the same concept will work where ever you deploy your WARed up JRuby on Rails application.

  1. Follow the bullet #1 and #2 from …
[Read more]
Showing entries 31 to 39
« 10 Newer Entries