The amazing adventures of Doug Hughes

SitePoint recently published an article of mine about developing Rich Internet Applications with ColdFusion 8.

SitePoint is a repository of tons of tech-related articles. From what I understand, they will be releasing more ColdFusion related articles in the future.

What are you waitng for? Go check it out.

Comments on: "Easy Rich Internet Applications With ColdFusion 8" (12)

  1. Michael White said:

    in regard to setting up the datasource. I never set up the apache derby datasource before so I didn’t know you needed the driver class (org.apache.derby.jdbc.EmbeddedDriver) and the schema for the tables is APP so I modified the query to say APP.USERS instead of users.

    Like

  2. Scott Stroz said:

    @Michael – In ColdFusion 8, you should not need to worry about the driver class, it _should_ be handled automagically. Also, when I set up the code and database, I did not need to use APP. for the query.

    Like

  3. Scott Krebs said:

    Hi Scott,
    I gave a quick run last night at “following along at home” with your article on SitePoint, and I get why Michael was having trouble following your instructions on how to set up the Derby DSN. This instruction:
    6. On the next screen, you’ll be asked for the absolute path to the database folder. Set your path to the following: {path to web root}/RIA/database/RIA.

    I had trouble deciphering where we’re supposed to enter the path. CF on Windows asks for a JDBC URL, along with Driver Class, Driver Name, User name, Password, and Description; nothing about path. I tried both absolute path and URL path in the JDBC URL field, but that wasn’t getting me anywhere. I tried adding the driver class Michael mentioned but that didn’t get me anywhere either. Like him and probably most other people, I haven’t used Derby before and so am not familiar with the ins and outs.

    OK, CF uses Derby for the example apps like the cfartgallery DSN, so by examining those DSNs I figured out that I needed to set as so:

    CF Data Source Name: ria
    JDBC URL: jdbc:derby:C:InetpubwwwrootClientsmydomain.comwwwrootRIAdatabaseRIA;create=false
    Driver Class: org.apache.derby.jdbc.EmbeddedDriver

    Obviously DSNs require a name, but both the URL and Class are also required (although the create=false part probably isn’t). I think things are different because I’m looking at a Windows CF install and you are looking at a Mac. I found a screen shot in this blog post which shows what you were probably looking at: http://fusecf.blogspot.com/2007/08/coldfusion-8-and-derby-db-create-and.html
    But that’s not what us Winders folks are going to see, so the DSN creation step may cause more than one non-Mac person who is unfamiliar with Derby a bit of consternation. (Not sure what’s required for Linux, the power supply on my Fedora box is on the fritz at the moment so I can’t fire it up to see.)

    I liked the article and code samples, nicely done!

    Like

  4. Scott Stroz said:

    @Scott – On 3 CF8 instances I have access to, when I choose ‘Apache Derby Embedded’ from the list of data source types, on the resulting page I have a form that has the following form fields:

    -CF data source name (text)
    -Database folder (text) with a button that opens a new window and allows you to browse to the folder you are using)
    -Create Database (checkbox)
    -Description (textara)

    There are no fields for JDBC URL.

    It should be noted that I am using CF8 Multi-server installation. One instance is Enterprise edition and the others are developer edition, all running on Windows (either Server 2003 or XP).

    Like

  5. Scott Krebs said:

    And my installation is the standard server configuration. Maybe that’s the difference, rather than Mac vs Windows?

    Like

  6. Sam Detweiler said:

    Very nice sample, easy to use and extend. I’ve mapped it onto my database already..(on Windows, CF on Tomcat, Eclipse as the Dev platform)

    As a relative CF beginner, how do you assimilate all the language special info (like the cfgrid special variable names to make the paging code work), and the combination of the CFC and the cfgrid.
    (still have trouble with formatting the data in the html grid, dates and data alignments)..

    also, one thing never shown, and not talked about that I can see, is how to recognize if a user changes the column order or column size, and how to make that persistant..

    thanks again tho.. amazing what a small piece of code can do.

    Sam

    Like

  7. Charlie Arehart said:

    I know I’m a little late to this party (of comments from March), but to Scott (Krebs) who was having problems with the DSN creation asking for a JDBC URL, I would bet you were choosing “Apache Derby Client”, rather than “Apache Derby Embedded”. The former is for when one sets up Derby to use a network server for communicating to a Derby DB. The latter is when one is happy to just use the embedded Derby engine within CF.

    It’s an unfortunate source of frequent confusion. When Scott (Strox) mentions how easy it should be, with just the 4 fields, he’s referring to the Embedded version of creating a DSN. Hope that helps.

    Like

  8. Charlie Arehart said:

    Just an update, and perhaps a correction to my last comment. Scott, I see you said you were prompted for a JDBC URL. That would suggest you were seeing the form for an “Other” datasource type, rather than the Derby Client datasource type. My bad.

    Well, I found someone who reported a problem like that, where (on a Linux box), when they created an embedded Derby DSN, the CF admin jumped instead to creating an “other” driver. Don’t know if it may happen on other platforms. Maybe something makes it happen for some but not all.

    The other blog entry is at http://www.mkville.com/blog/index.cfm/2008/4/1/Apache-Derby-Embedded-datasource-in-ColdFusion-on-Linux

    Like

  9. Scott Krebs said:

    Charlie,
    I was able to verify with Service Capture that I really was being redirected to the “Other” datasource template on Win2K3 CF8 Standard operating out of C:ColdFusion8. I was able to verify that I was getting the “as-advertised” behavior on a Win2K3 Enterprise J2EE install running out of C:JRun4.

    I posed the question in a couple of forums but no one was ever able to adequately explain the difference, and quite frankly since there was a simple enough work-around, I didn’t find it compelling enough to research further.

    My *guess* is that it is a J2EE thing, as every place I have seen or heard about it behaving as-advertised CF has been deployed under a Java app server (i.e. CF inside JRun). Every place I see the “Other” behavior CF is deployed stand-alone (i.e. JRun “inside” CF). But that’s based on observation and not explanation so may not be accurate.

    Like

  10. Charlie Arehart said:

    Ah, ok. Well, in case this stands for a long time as something that others read, I think it makes sense to be as clear as possible. You use the term “stand-alone” in a way that I think some may misinterpret. (I think you’re using it to refer to a J2EE deployment, but some use it to refer to the more typical Server configuration.)

    So to be clear, you’re saying that you suspect things will be fine if one has deployed CF 8 Standard, or CF 8 Enterprise Server configuration, or CF 8 Enterprise MultiServer configuration (what some call multiple instances).

    But you think the problem is when one has deployed CF 8 Enterprise J2EE configuration. I can confirm that it works fine for all but the J2EE deployment (just don’t happen to have one deployed at the moment that I can easily test.)

    Can anyone else confirm what Scott’s observing?

    Like

  11. Scott Krebs said:

    Sorry to be unclear. Allow me to rephrase. On Windows, I see the “Other” behavior on installations in C:ColdFusion8 (where Java Home is C:ColdFusion8runtimejre) and I see the documented as-advertised behavior in installations in C:JRun4 (where Java Home is C:JRun4jre). Hopefully that is a little more clear. Again, not thoroughly researched.

    Like

  12. Charlie Arehart said:

    Just a follow up to this discussion from last year, on the issue of how trying to add a Derby embedded DSN sometimes takes one to the “Other” DSN page, I have an answer. The problem is a bug in CF 8 Standard. That’s why Scott wasn’t seeing it in his Enterprise multiserver and Server deployments. I just blogged with more detail at:

    http://www.carehart.org/blog/client/index.cfm/2009/3/2/bug_with_derby_on_cf8_standard

    I’m really bummed I didn’t connect the dots back when we had the discussion above. Re-reading things now, across the various comments where there was some potential confusion, it does seem we had confirmed it was a Standard-only thing. We just didn’t recognize it at the time. (I came back to add this comment today because I do recall we had had this extended discussion here on the topic, and knew others may find it in the future.)

    Like

Comments are closed.

Tag Cloud

%d bloggers like this: