Remove TAB character from SQL statement in ColdFusion 11 JDBC

In my coldfusion code, I have a standard cfquery statement with properly formatted SQL.  This segment of code is tabbed (indented) in my page to make the code more readable.  It seems that coldfusion is passing those TAB characters along in the SQL statement.  This is not a problem via ODBC, but it causes a problem with the same database's JDBC driver.  Is there a way to prevent  or filter out the TAB charaters prior to passing the SQL to the database?
paragonfoodsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

_agx_Commented:
EDIT:

Can I ask why you think tabs are the issue? I use tabs in jdbc queries all the time and haven't had any problems with it, ie

<cfquery ....>
{tab}SELECT{tab} COLUMN_NAME
{tab}FROM {tab}  TABLE_NAME
{tab}WHERE{tab}COLUMN_NAME = 1  
</cfquery>


filter out the TAB charaters prior to passing the SQL to the database?

If the tabs are part of the source code (like the example above), you must do a find/replace in your IDE.  If they're contained within a variable string, you can use the replace() function, ie

                 <!-- replace tabs chr(9) with blank space chr(32) --->
                 <cfset newText = replace( oldText, chr(9), chr(32), "all")>
0
paragonfoodsAuthor Commented:
I find that tabs are the issue given that, when removed, the query works fine.  I was hoping to use some sort of wrapper/filter to remove the tabs when the query is passed so I can keep the page indentations/formatting easily readable.  I may just need to replace the tab character with the equivalent # of spaces, as these do not cause a problem.
0
_agx_Commented:
AFAIK, there's no extra "filtering" options for cfquery. CF simply evaluates whatever text is within the tags and sends it to the db. The best you could do is use a regex find/replace on the source, assuming your IDE offers that option.

Out of curiosity, what db are you using? I'm curious because I've always used tabs and it's never caused problems with sql server+jdbc.
0
paragonfoodsAuthor Commented:
It's an older non-transactional database called DB/C FS.  The ODBC driver works fine with my code as-is, but the JDBC driver is not liking the tabs.  I think a JDBC wrapper that can reformat the SQL between CF and the DB is my next direction...
0
_agx_Commented:
Ah, that explains it.  

> a JDBC wrapper that can reformat the SQL between CF and the DB is my next direction.

I had a brief look around, but couldn't find their drivers. Guess they're propertietary? Anyway, not sure how their JDBC driver is implemented, but I imagine wrapping the methods of their Connection class, like Connection.prepareStatement, might work.  Though obviously it'd require creating a custom driver jar.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ColdFusion Language

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.