dans.blog


The miscellaneous ramblings and thoughts of Dan G. Switzer, II

Installing the DBEdit Eclipse Plug-in For Use With MS SQL 2000...

I installed the Eclipse DBEdit Plug-in today in order to try to save some development time. The plug-in looks pretty cool, but took some time to install. I first tried to see if I could use the Macromedia JDBC drivers that were on my box, since I already have CFMX 7 installed. Turns out you get an "Restricted Access" message when trying to use the Macromedia drivers when you're not using a Macromedia product. This lead me to installing the Microsoft SQL Server JDBC drivers.

Here's what I had to do to get DBEdit installed. I think many good open source projects go unused because often there's a complete lack of instructions for getting the project installed and getting it operational. So if you're using SQL Server 2000 and Eclipse and want to get DBEdit running, you've come to the right place!

  1. You'll need to download Microsoft's SQL Server 2000 Driver for JDBC.
  2. You'll want to download is the mssqlserver.tar file. You're only worried about the specific class files that Java needs, so no need to download the entire installer.
  3. Create a folder to install the JDBC drivers to. I installed them into my "Microsoft SQL Server" folder into a directory called "jdbc".
  4. You'll need to extract 3 files which are actually inside the msjdbc.tar file which are inside the mssqlserver.tar file. The files can be found in the "lib" folder of the msjdbc.tar file. The files are:
    • msbase.jar
    • mssqlserver.jar
    • msutil.jar
    NOTE:
    If using WinRAR, you should be able to open up "mssqlserver.tar" and then open up the "msjdbc.tar" and browse to the "./lib" folder without extracting all the .tar files.
  5. Extract those files into the JDBC folder you created in step 3.
  6. Download the Eclipse DBEdit plug-in.
  7. Unzip the contents of the into your Eclipse folder.
  8. Start Eclipse.
  9. Go to "Window > Open Perspective > Other".
  10. Select the "DBEdit" perspective and click "Ok".
  11. You'll know need to create a Connection.
  12. Go to the "Classpath" tab and click the "Add Archive" button. You'll need to add each of the files you extracted to your JDBC folder one at a time.
  13. Click back on the "Common" tab.
  14. You should see a select of "JDBC Drivers" if you select the drop down. The driver you want to use is the "com.microsoft.jdbc.sqlserver.SQLServerDriver" driver.
  15. Next enter the "Server URL". You'll want to enter:
    jdbc:microsoft:sqlserver://127.0.0.1:1433
    NOTE:
    If you want to specify database other than the default database for the user you're logging into, you can specify the database to log into by default, by adding the databaseName argument to the URL string. (Where XXX is the name of the database.)

    jdbc:microsoft:sqlserver://127.0.0.1:1433;databaseName=XXXX
  16. Now enter the log in creditials for the database.
  17. You'll probably want to change the name of the Database Bookmark to something more useful. You can change this by editing the "Name" field above the tabs.
  18. Finally, click "Connect" or "Reconnect" button, which ever is there.

more…


Thunderbird - Removing Entries From "To:" Autocomplete...

Ever had an e-mail address that keeps popping up in your autocomplete field in Thunderbird? If you've used other e-mail clients in the past, usually you can select the entry using the keyboard and hit either [DELETE] ( or [SHIFT]+[DELETE] like you can in Firefox.)

Apparently Thunderbird compiles the autocomplete list not from a cache, but from e-mail addresses in your Address Book or by guessing for users in your domain. So why is that rogue invalid entry in there you ask? Well, perhaps it was added to your Address Book automatically under the "Collected Addresses" section. That's what happened to me.

All of the sudden a name started appearing in the drop down list that was invalid. It was causing me problems because it was always popping up as the first choice when trying to e-mail my boss. So, if you're seeing some invalid e-mail addresses showing up in your autocomplete list in Thunderbird, do the following:

more…


CFMX: Execute Code Based Upon Debug IP Addresses...

I've been working with a lot of code recently that I didn't write and the code flow is very hard to follow. A lot of times there's no clear execution path flow and I'm finding fixing problems is very time consuming because I'm having to jump around to a bunch of seemingly unrelated files to find where the problem actually is.

One of the things I seem to be having to do a lot is dump out either little "I'm here" messages or having to output the SQL statements that are getting executed so I can run them in SQL Query Analyzer to find out what the results are and what the query really should be.

I've found myself writing a lot of <cfif cgi.remote_addr EQ "my.ip.addr.ess"> lines in order to only output that data to myself. This morning I decided I should just write a tag that checks the CF Admin for a list of valid Debugging IPs and uses that to decide if code should be excuted.

more…


Thunderbird v1.0.5 Released... Fixes Security Bugs...

The Mozilla group has released Thunderbird v1.0.5. This release is supposed to fix some stability issues and it also addresses a number of security issues.


Firefox v1.0.5 Released... Fixes Security Bugs...

The Mozilla group has released Firefox v1.0.5. This release is supposed to fix some stability issues (I've had Firefox crashing on occasion for me when opening a pop-up window, but I think this may be related to an Extension I have installed) and it also addresses a number of security issues.


See How The ColdFusion Team's Facilities Have Changed Since 1999...

Damon Cooper blogged about the ColdFusion 10th Birthday Party celebration and posted a link to a photo gallery of the ColdFusion MX 7 Team's facilities in Newton, MA.

This reminded me that I have some photos in my photo album on the Allaire Facilites at One Alewife Center that I took on a trip to Boston in 1999. Mike Nimer took myself and Cameron Childress on a tour through the building and then we walked down to this good little Greek restaurant for lunch.


CFMX Generating Vague "java.lang.NullPointerException" Errors...

I tend to use <cfscript> a lot in my coding, but there are times I find I need to refactor some code portion back to using a tag-based syntax, in order to to use a native CF tag. Yes, I know I could build CF wrapper functions for those tags, but sometimes it's just easier to change the code back.

Usually converting back to a serious of <cfset> tags is no big deal, but occassionally I get some really strange error when I re-run the template. There error gives me almost no detail on the problem, just a very obscure "java.lang.NullPointerException" with no reference to a line number. The full error message is:

The system has attempted to use an undefined value, which usually indicates a programming error, either in your code or some system code.

more…


ColdFusion MX 7 Cumulative Hot Fix 3 Released...

Macromedia has release the ColdFusion MX 7 Cumulative Hot Fix 3 today. Download the hot fix here.


ColdFusion Bug: ValueList() Will Not Except Dynamic Column Names...

I came across what is apparently an old Macromedia ColdFusion "bug" today in the valueList() function. The valueList() function will only accept a value where both the queryName and columnName are static values in the form: queryName.columnName.

It appears it'll throw an error if you try passing any other combination of equally valid syntax. For example, all of the below will throw an error, even though they are all valid references to a query and column.

valueList(queryName["columnName"]);
valueList(queryName[dynamicValue]);
valueList(evaluate("queryName.#dynamicValue#"));
valueList(evaluate("queryName.columnName"#));

more…


Subclipse Eclipse SVN Plug-in: Emulate TortoiseSVN Labelling...

I'm really digging Eclipse. There's very little I don't like about v3.1—about the only thing I don't like out of the box is the Find/Replace dialog box. I'd like to see something a little more like HomeSite+ Extended Find/Replace dialog box. The good news is, I'm sure I can probably find a plug-in that will do pretty much what I want.

Anyway, what I'm really digging is Subclipse, which is a SVN plug-in for Eclipse that plugs right in to the "Team" context menu. The one thing I didn't like about Subclipse out of the box was it's re-labelling in my Navigation Pane. It adds a bunch of information that some users will probably want (last user to edit a file, date/time it was edited, etc) but I really don't generally care. If I do, I can just view the document in the Resouce History pane and I'll get all the details I want about the file.

Fortunately, Subclipse allows you to edit the labelling. I really like the way TortoiseSVN labels things in Windows Explorer, so I set up Subeclipse to basic emulate that labelling (while as close as you can with just text.) Anyway, here's a screenshot of my setup:

more…


qForms v2.0 - Real-time Server Validation Using xmlHttpRequest()

The buzzword "AJAX" is becoming all the rage these days. While the concept surely isn't new, the method of delivery has changed. A comment by Oguz Demirkapi over on Mark Kruger's "Client Side and Server Side Validation - a case for both" blog post got me thinking about AJAX and qForms. Oguz said:

and we use also Ajax for server side checks. As an example: while registering for our website our Ajax code check whether entered e-mail address has already been in database or not. And than show error msg directly as client side action.

It is a really great option to check availibility etc.

With all the changes I've made to qForms, I figured it would be pretty easy to throw together a little example form that used AJAX techniques to validate a field against live server data. Instead of using a validation method, were instead going to check the value onblur (so that we can then query the server while the user is interacting with the rest of the form) and then we'll display an error is the user has selected a user name that's already being used.

more…


Hiding Files/Folders From Eclipse Projects Using Filters...

After watching Rob Rohan's CFEclipse Intro Videos, I decided to give Eclipse another go around. I've played around w/Eclipse several times before, but I've always gone back to HomeSite+. Rob's video showed me a few key features (such as the Bookmarks and To-Do list) that are very intriguing to me. Following Rob's directions, install was simple and I was up and runing within minutes of downloading Eclipse.

One thing I ran into though, is I wanted to hide my .svn and .project entries from showing up in my Navigation bar. In order to hide those files/folders from showing up, you need to turn on the ".*" filter. Here are step-by-step instructions for turning on that filter.

  1. Click on the "Navigation" pane.
  2. Press [CTRL]+[F10] or click on the "View Menu" icon (which looking like an upside down triangle.)
  3. Click on the "Filters..." option.
  4. In the Navigation Filters, find the ".*" option and click in the checkbox just to the left of the label.
  5. Click "OK".

more…


New Method Idea for qForms--Conditional Processing...

Last night I was thinking about the changes I had made to the createDependencyTo() method and started thinking that there might be times when you'd want to do something similiar, but instead of having one field affect another in some manor you'd define a rule for a field if it meets a given condition.

My basic thought would be to add a new method you could call. I've been tossing around the idea of setActionRule(), setConditionAction() or setConditionalRule(). Something along those lines. The idea would be that if the value of the field this method was attached to equal a condition supplied, a function would be triggered.

oForm.format.setActionRule(
    function (sValue){
        alert("You have selected to recieve the newsletter in " + sValue + " format.");
    }
);

more…


qForms v2.0 - Overriding the Default Dependency Mechanisms

When I was looking through my demo templates, I came across an example that showed some features in qForms v2.0 that I had forgotten I implemented, but it's something that's very cool and provides a lot of flexibility. What is this code you ask? Well, it deals with the createDepedencyTo() method.

For those of you who aren't familiar with this method, in a nutshell the createDependencyTo() method is used to build rule logic into your forms. For example, maybe you only want to require a user to enter their e-mail address if they've actually selected to have something e-mailed to them. You could do that like this:

oForm.email.createDependencyTo("EmailNewsletter", "yes");

more…


Highlighting the user's position in the form using qForms...

I was doing some surfing today and came across a cool effect on the w3compliler Contact Us form. When you're focused on a form field, the field's label style will change to give you a better visual representation of where you're at on the form. I thought to myself, that's pretty cool--I bet I can do that with just a coupe of lines of code in qForms v2.

In the w3compiler Contact Form, they're using tables to layout the form, but I wanted to do something using strictly CSS and HTML. So I decided to use the actual <label> tag as the field label—this allows you to click on the label to set the focus to the form field. Check out my version:

qForms v2 Demo - Field Focus DHTML