I found the problem. Some time between yesterday morning and yesterday afternoon, the needed driver changed from org.gjt.mm.mysql.Driver to com.mysql.jdbc.Driver. The web host customer service had no clue about this, but I figured that this had to be the culprit when I loaded this script on another server and got the same error. A PHP query I ran had no trouble with connecting to the database. When I did a search for more alternate drivers, I used the latter one I mentioned and it works fine now.

The fact that this is something not under my control, and puts me at the mercy of my web host, is leading me to put together a case to take to my CF administrator to set up a datasource for me to use. Either that, or redo my registration form in PHP. I'll have to see which one will take less time...

This raises a question, which my CF Admin couldn't answer off the top of his head. If he does set up a datasource in the CF server pointing to this, and the web host makes another similar change, will it throw off the datasource definition in our server? Or will it be as stable as it would be in PHP, which doesn't seem to have this problem?

The fact that this is something not under my control, and puts me at the mercy of my web host, is leading me to put together a case to take to my CF administrator to set up a datasource for me to use.

Establishing a proper CF datasource is the way to go for lots of reasons. The way you're doing it now works, but it's non-standard for the language. So it's like swimming upstream. Remember what may be the normal connection method for php isn't the best method for CF. They're different languages. With your current approach you lose out on most of CF's benefits, like the performance boost of CF's connection pooling. Not to mention exposing your db to risky sql.

With hosted sites, you're always at the mercy of the host. If they change or remove files needed by your web application nothing's going to work. Php's no different. Remove the files it needs to connect and it won't work either. You'd far be less likely to encounter problems if you were using the standard connection method ie CF dsn, because that's something the host administers. They'd have a vested interest in maintaining it because the same settings are used on all of their cf sites. So breaking one would break them all and cause tech support headaches.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.