Cold fusion SQL reference to var
Here's what I'm trying to do
<cfscript>
j=createobject("java", "java.net.InetAddress");
m=createobject("java", "java.net.NetworkInterface");
a=j.getLocalHost();
mac=m.getByInetAddress(a).getHardwareAddress();
</cfscript>
<!--- Get all records from the database that match this users credentials --->
<cfquery name="qVerify" datasource="ABCD">
SELECT *
FROM MobileUsers
WHERE Mac = '#mac#'
</cfquery>
-- and I get:
ByteArray objects cannot be converted to strings
I've tried to convert mac to a string and it does without error but them my mac var turns into what looks like binary data. There has to be a more simple way that works
Eddie
18 Views
Tags (edit):
Have you posted this on Monster? You may get a few bites
here, but I know there are a lot of CF devs that watch Monster.
Just a suggestion.
Similar Messages
-
SQL server with Cold Fusion?
Hi everyone,
I am supposed to write a website, that its database is SQL
server and about 80,000 - 100,000 records in there.
is it OK to go with cold fusion? OR better to go with .NET
for faster and more reliable speed?
I would appreciate your help.The app server generally doesn't care so long as it supports
the DB driver. If the database is designed properly, the DBMS will
be doing most of the "grunt" work.
Any enterprise level app server can process a large database,
so go with your strengths, and SQL server will do you just fine.
I also wouldn't say .NET is faster ... I've seen my share of
sites using .NET that are slow as molasses. Your server
configuration will determine that more often than the app server,
so long as it is an enterprise level app server ... both of which
.NET and CF are.
We run a SQL server for many clients and all are on CF ...
one table alone has over 250,000 records in it. What and how you
output will determine the speed between the 2, not how many records
it can handle. -
SQL Server 2008/2008 R2 compatiblity with Cold Fusion 5.0
Our Cold Fusion Server is on Version 5.0 and database server is running SQL 2000. DBA's like to upgrade SQL Server to 2008/ R2. Is there any known issues in running or upgrading from Cold Fusion 5.0 with SQL Server 2008/R2 ?
Please let me know.
Thanks
Suresh KumarIf you're looking at spending thousands on a SQL licence, has no-one considered buying a CF9 license? You'd save yourself a whole world of pain, and could then have a full 64-bit environment for your application which is tried and tested.
-
How not to use Cold Fusion and Java
Overview
This write up is intended to give java developers that are
developing ColdFusion applications some beneficial information:
things that are not documented.
Scenario
The company builds enterprise class web application software
for fortune 500 companies. It had purchased a CF 7 based product,
had and existing proprietary J2EE based product, and needed to
integrate the two while meeting a host of new requirements. These
requirements were based on delivering a better user experience,
faster / cheaper integration, increased flexibility /
configuration, useablily, decreasing maintenance costs, the ability
to deploy in either install or ASP models. An initiative was
started to create a new framework that integrated the best of each
technologies. Tactically, this meant that we were to build a hybrid
CF and java application: one that used building blocks (decoupled /
cohesive components) that would allow applications to be rapidly
assembled, configured and deployed. This made sense on several
levels, the team was composed of Java and CF developers, the CF
rapid application development was very productive, there is great
functionality delivered in the CF platform and initial performance
tests showed no cause for alarm
The agreed upon design, based on requirements, and analysis
by both the CF and Java staff has us using CF in the presentation
layer, using a CF based MVC, use of CF based web services. The MVC
was deployed using CFC inheritance for model objects and views made
use of CF custom tags. The internals of the application, used a
rules engine, some proprietary java, ORM, and other J2EE
technology. The initial performance of the system was reasonable.
We pushed on with product implementation.
Then it was time to load test the application, and tune it.
Under load the response times were orders of magnitude slower,
sometimes the pages even timed out.
Armed with our profiler, oracle execution plans and we
charged ahead addressing issue after issue. Note that we took
meticulous care in tweaking the active thread pool and ensuring
that our CF setup was tuned for our application. None of the
observations here are a condemnation of the language; rather they
are aspects that, when considered together, not conducive for
building integrated java and CF frameworks that use a structured /
OO programming practices. Further detail can be provided on
request.
CFC inheritance should be avoided - resolution of variable
scope is expensive even if properly declared.
Since CF creates a class per method under the covers call
stacks become very large, especially if used in a loop. This is
nominally exacerbated by CF calls necessary to set up for the
method call (String.toUpper()).
Nesting of loops and if statements should be kept to a
minimum - the conditional for each lookup of logical operator like
LT, GT are synchronized. Under load this results in thread waits.
Jrun has as single thread pool - both http and web service
requests use the same pool. Under load this leads to thread
deadlock. There are work arounds, but they are painful.
Recursion should be avoided - we had a few recursive routines
and these had to be rewritten.
Custom Tags - should be used sparingly - each custom tag
makes a synchronized call to the license server - (This may be
fixed in CF 8)
Summary
In the end we got the performance to reasonable numbers, but
we ended up moving some code to java (Custom Tags) and getting rid
of 'good programming' practices (Inheritance, loops, etc), mandated
proper variable scoping for those things left over. We prototyped a
sans cold fusion implementation and had an order of magnitude
improvement in performance and number of requests served per
second.
The lesson? Use Coldfusion in its sweet spot: make a query,
iterate over the results and format for display. Extensive use of
structure programming techniques or OO CFCs should be avoided: they
will work but under load - but are better as a prototype. Building
frameworks in CF? Think twice, no three times, and, if you must, be
minimalist.
Textinteresting aslbert123,
Not that I doubt you, but could you answer some questions
about your implementation that was so slow:
1.) Did you put your CFCs in the application or server scope?
2.) Were you initializing your CFCs, via CreateObject or
<cfinvoke>, on every request?
3.) Are you sure that you were properly Var'ing every
variable in your methods? (people typically forget about query
names and loop iterator variables)
4.) Could you give examples of how your inheritence was set
up?
5.) For CustomTags, did you call them the old <cf_tag>
way or the newer, better-performing <cfimport> way?
6.) How did you connect CF to Java exactly?
Thanks,
Aaron -
I'm unable to connect to database thru cold fusion
I'm unable to connect to database thru cold fusion. it
sometiems give me an error that your uname is undefined , soemtimes
it gives ur index page not found so i created index page also but
still im unable to connect to database n update my records..plz
help me out..im a fresher in cold fusionI am having a similar problem having CFMX 7.02 verify my SQL
Server 2005 Data Sources.
I am using the sa account for CF to access the db's. But i
get the following error:
Connection verification failed for data source: myDatabase
java.sql.SQLException: [Macromedia][SQLServer JDBC
Driver]Error establishing socket. Connection refused: connect
The root cause was that: java.sql.SQLException:
[Macromedia][SQLServer JDBC Driver]Error establishing socket.
Connection refused: connect
Every role in SQL Server has the sa grantor Grant enabled. I
can also login to SQL Server with the sa account w/o a hitch.
I don't know what else to do. The server information is set
to the ServerName port 1433, datasource name and database name are
the same as the database name in sql server, and the username and
password are set for the sa account.
Thanks! -
Flashbuilder and Cold Fusion (using application/session variables)
I would like to know if anybody uses Flashbuilder with Cold Fusion?
Since Cold Fusion has lots of different scopes of variables (application, session, client, form, url, etc...) how do you manage this in Flex/Flashbuilder?
Are there forums or groups specifically for using Flex3/Flashbuilder with backend server side technologies such as Cold Fusion?.
The only server side technology that I have interest in is Cold Fusion. I've seen basic tutorials and videos using Cold Fusion CFC's and data binding with Flex. I haven't seen or heard anything using a Cold Fusion application, session, or client variable in Flex.
Hopefully some of you have some experience on this topic.
Thankshey popster,
i too had this question some time ago. my entire app was built on CF with HTML before i started integrating Flex 3 with it. i found that i needed to create cookie variables for all my session variables i was using in order to maintain and remember who the user was in my CFC calls. i also found that after i compiled a flex app, i changed the .html to .cfm (the file that loads the compiled SWF file). by doing this i was able to pass CF session variables into the flex app and you can refer to these anywhere in Flex by using Application.application.parameters.{variable name here}
add the CF variable in the FlashVars line to pass it into Flex (see the last line of code). this will create a variable (in my case i'm passing session.employeenumber). then in your flex app you can reference it by using Application.application.parameters.emplid:
AC_FL_RunContent(
"src", "Request",
"width", "100%",
"height", "87%",
"align", "middle",
"id", "Request",
"quality", "high",
"bgcolor", "#869ca7",
"name", "Request",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer",
"wmode","transparent",
"FlashVars","emplid=<cfoutput>#session.employeenumber#</cfoutput"
A little trick I learned (does Adobe really expect us to re-engineer how our apps have been working by no longer using sessions for Flex?). Then in your CFCs if you also create cookies for every session variable you can maintain the variables based on user login. HOPE THIS HELPS!
-Matt -
Cold Fusion Application Server
Hello all,
I'm having the weirdest issue with our CF server. They do not
run. However when I start Cold Fusion Application Server, I cannot
login to any of my backend admins. I suspect that it is because it
tries to set an application variable. Then I check for to see if
there the app var is set, if not it redirects to the login page.
I am guessing that the app var is not being set. If I stop
Cold Fusion Application Server, everything works fine.
I don't want to have reinstall CF 5 (on Windows 2000 srv).
Any ideas???
thanksDettCom,
I had a similar problem to this, but I don't know if you have
the same configuration (it was on CF 6.1). I don't know a whole lot
on CF 5.
I was storing client variables in the cdata/cglobal tables,
and one variable's string ended up longer than I had planned for
(although it was, in fact, correct). I had to increase the size of
the "data" field in CDATA.
Also, anything in the logs? (I know you probably would have
mentioned if there were).
- Mike -
Use JQuery Datepicker in Cold Fusion
How can I use jquery Datepicker in a cfm application that used iframe? where should I link css and script reference?
It might be nice if you tell people you've already asked this on Stackoverflow (http://stackoverflow.com/questions/15756532/use-jquery-datepicker-in-cold-fusion).
This question has nothing to do with ColdFusion. JQuery runs on the client browser, and does not interact with the ColdFusion server.
You would use the datepicker in exactly the same way you would on a flat HTML page.
Adam -
Cold Fusion/Flex Application Wizard crippled in Trial Version?
Hi,
I am using the 60 Day trial version of Flex Builder
3/Eclipse.
I wanted to try out the much vaunted Cold Fusion/Flex
Application Wizard, mainly because I could not get my head around
access from Flex to an existing CFC from the documentation alone.
So, I followed the directions:
Click the plus sign (+).
In the Name: text box, enter the name for the page.
Select the page type (master, detail, or master/detail).
Click Edit Master Form or Edit Detail Form, depending on the
type of form you are creating.
The Visual Query Builder starts.
But for me, when I click on 'Edit Master Form' the Visual
Query Builder does not start.
Now I have checked and confirmed that my RDS is working, and
that I can access the database via RDS in the Eclipse RDS browser
window. The RDS concerned is on another PC.
The PC on which Flex Builder is installed is a Vista
Ultimate/32 and the database is MS SQl server 2005 (running on the
other PC). Cold Fusion 8 is installed on both PC's.
So, my question is 'Is the CF/Flex Application wizard
deliberately hobbled/crippled in Flex 3 Trial version, or is there
something wrong with my installation.?
If this works for everyone else, then how do I debug my
installation ?
Thanks,
Bryn Parrottin addition, I can say that I installed the same flex builder
trial on an XP machine, using its own local RDS, and found that the
wizard worked just fine.
So what is the variable here, why is the wizard not working
on the vista PC ?
Is it Vista ?
Is it the fact that I'm trying to use RDS against a remote
server and not the local one ? -
Integration of Cold Fusion and Adobe Livecycle form
I created a adobe dynamic xml form and I also created a sample cold fusion script which reads all the fields from the pdf and populates them in to a structure.
<cfpdfform action="read" source= "FORM PATH" result="formData" />
<cfdump var="#formData#" label="formData" />
When I run this script the structure shows me blank fields.
Cold fusion version is 8.
Please share your thoughts on this.
Many Thanks,
Nav.Hi,
I'm thinking of possible reason for your problem.
Check these solutions, maybe they can help you.
http://blogs.adobe.com/dmcmahon/2011/02/01/livecycle-designer-flowed-layout-in-headerfoote r-subforms-incorrect/
http://blogs.adobe.com/dmcmahon/2011/10/10/lc-forms-es-text-overlapping-on-page-break-usin g-nested-subforms/ -
I want to find out whether coldfusion can talk with SVN ,the reason is I should be able to download the component from SVN to my local system modify and then add it again to back to SVN or directly upload a new component from my local system to SVN. Basically my cold fusion application sholud be able to talk with SVN to perform the above functions.
This is some dude named Dan's Prior Art, His site is dead but google gave a cached page... I can imagine all kinds of mods and uses for something like this...
Cool ColdFusion and Subversion integration
December 5th, 2007 Dan Skaggs Leave a comment Go to comments
I recently decided to outsource my souce code management to CVSDude. I had been running SVN on my VPS that I have at Slicehost and that had been running okay. However, I’m only good enough at SVN administration to get the server up and running and create a few repositories and there were other things that I needed to do with SVN that I frankly didn’t have time to learn how to do.
One of the things that I’d heard talked about that made life much easier was using Subversion’s various hooks to automate some things around different SVN events. I emailed tech support asking how we could configure the “post-commit” hook to update the files on my VPS each time I made a commit into the SVN module. The tech told me that they do this by configuring an HTTP call to a page (or script etc) on your server. That page then triggers an SVN update of the specific module.
After hearing this, I began thinking about how to use CFEXECUTE to trigger the SVN update and was actually surprised how simple it was. My VPS runs on Fedora Core 6, so, like any *nix operating system, you need to make sure permissions on the files are set so that the user which runs ColdFusion can write to the directories. Once that was accomplished, all it took was a few lines of code and we’re ready to start receiving HTTP callbacks from CVSDude’s servers.
CVSDude structures their SVN URLs in the format http://username-svn.cvsdude.com/modulename (or https://). All my modules are named in reverse domain order for the web site that it is for (for example, this one is ws.skaggsfamily.dan). I had already checked out all my modules into a specific directory.
The HTTP callback from CFSDude’s server has 4 URL parameters that they send over: root (full path to module), author (user), revision and date. So all I really had to do was grab the URL.root value and extract the name of the module, pass that to the CFEXECUTE tag and, voila, automatic updating of the module immediately after the commit.
There were only 2 gotchas that I had to figure out:
Put the full path to the svn executable
Add in your username and password to the string in the arguments attribute of CFEXECUTE
The code that I used is below. I’m sure there’s more that I could have done with it, but this is a good start I think.
<cfif structKeyExists(URL, “date”) AND URL.date NEQ “” AND
structKeyExists(URL,”author”) AND URL.author NEQ “” AND
structKeyExists(URL, “revision”) AND URL.revision NEQ “” AND
structKeyExists(URL, “root”) AND URL.root NEQ “”>
<cfset module = replaceNoCase(URL.root, “http://username-svn.cvsdude.com/”, “”)>
<cfexecute name=”/usr/bin/svn”
arguments=”up /var/sites/#module# –username yourUserName –password yourPassword”
timeout=”300″
variable=”result”>
</cfexecute>
<cflog log=”Application”
type=”information”
text=”#URL.author#:#URL.root#:#URL.revision# – #result#”>
<cfmail to=”[email protected]”
from=”[email protected]”
subject=”Server updated successfully”>
The server has been successfully updated with your lastest changes.
Details of the update are below:
Date: #URL.date#
Module: #URL.root#
Revision: #URL.revision#
Results:
#result#
</cfmail>
</cfif> -
I have site on a Cold Fusion MX Version: 6,1,0,hf45343_611
running on A Windows 2000 server and IIS5 using a Microsoft SQL
2000 Cluster in the backend. When ever the cluster fails over the
websites fail. I then have to restart the 3 Cold Fusion Services
and do an IIS reset. Is there a setting that I can use to avoid
having to reset the services on the webserver?Hi Upen,
Thanks for your response. It is a 64 bit machine and the setup is also 64 bit.
I would like to mention some points related to my deployment scenario:
We have a Windows server 2008 R2 Standard edition on Server machine.
I have a .net website appliaction deployed and running on this.
One of our third party vendor is developing Cold fusion application.
This Cold fusion application will be integrated in our .net website.
Deployment and configuration of Cold Fusion application and server wil be done by Third Party vendor.
I need to install Cold fusion and give access to Third party.
Issue when I install cold Fusion using default settings, my .net Website does not get loaded.
In Mozila and Chrome Browser I get blank Page with only Background image given in Body tab of page is getting displayed.
In IE Browser Page with background image given in Body tab of plus this text ' <script> src="" 'is getting displayed.
Regards,
Sarfaraj Shaikh -
Cold Fusion / developer edition
hey guys
sorry to ask you this but it has been hanging over my head
for a long period of time.
I have been unable to get my mind around the concept of "the
developer edition of Cold Fusion". from what i have learnt , i can
use it locally only. Does that mean that i wont be able to transfer
my cold fusion files onto a webhosting that supports ColdFusion??
Am i expected to present "my license to ColdFusion" to my web
provider every time I upload a website onto a webhosting?
Please someone explain to me what happens when i upload my
coldfusion-based website onto a webhosting. Will it stop working or
will my code get corrupted??
Cheers
MarosHi Maros
There are a few of things you will need to be aware of when
you move to the
server. First, be sure the mapping on the server is the same
as it is
locally, this especially concerns CFCs. In Dreamweaver if you
drag a CFC
function onto a page Dreamweaver will map the dot path to the
CFC including
the folder your site is in within the ColdFusion8\wwwroot
folder, naturally
this folder doesn't exist on your server since the entire
site is directly
in your root folder. Be sure to address this before going
live.
Also, make sure you move your database to the server and set
up the DSN,
using the exact same DSN name you used locally.
Finally, make sure your host supports the same version of CF
as you have
locally as well as the database if you are using MySQL or SQL
Server. If you
are using Access, be sure your host server is a Windows
sever.
Doing this should make for a smooth transition.
Lawrence Cramer *Adobe Community Ace*
Cartweaver.com
ASP, PHP, and ColdFusion Shopping Carts For Dreamweaver -
Problems with Cold Fusion Forms
Hey Everybody -
Pretty new to these forums and cold fusion in general. I
created a number of forms in cold fusion for a school. They sign up
for classes and when they fill out ALL text fields they
successfully submit the form and they see a success page. Sounds
great right? well kind of.
If a user doesnt fill out the entire form, and submits it
gives them an error with coldfusion errors. So I am faced with a
few choices. I can either: have the form forward them to an error
page instead of the coldfusion error, or if there's a way I can
fill in the null values so that there isnt a problem with nulls. I
want to have validation but I want it in a seperate page since I
dont have the room to add errors in the form itself.
Any help would be great. Thanks in advance.I always do ALL my form validations with a client-side JS
**and** with server-side CF.
I don't use <cfform>, I know <cfform> is
dependant on the java version the user has installed on their end.
I know I came across quite a few issues where on one machine the
<cfform> worked fine, and on another it konked out.
Anways, this is one of my most basic forms:
=============================================
PAGE1.cfm
<html>
<head>
<script>
function validate() {
var IA = document.ContactUs;
var errorMSG = "";
if(IA.FullName.value == "") {errorMSG += "Full Name\n";}
if(IA.Email.value == "") {errorMSG += "Email\n";}
if(errorMSG != "") {
alert("The following fields are required:\n\n" + errorMSG);
return false;
</script>
</head>
<body>
<form name="ContactUs" action="page1_x.cfm" method="post"
onSubmit="return validate();">
<table>
<tr>
<td align="right">Name: </td>
<td align="left"><input type="text" name="FullName"
maxlength="50" size="25"></td>
</tr>
<tr>
<td align="right">Email Address: </td>
<td align="left"><input type="text" name="Email"
maxlength="50" size="25"></td>
</tr>
<tr>
<td align="right">Comments: </td>
<td align="left"><textarea name="Comments"
cols="20" rows="5" id="comments"></textarea></td>
</tr>
<tr>
<td colspan="2">
<input type="submit" name="SubmitContact"
value="Submit">
<input type="reset" name="Reset" value="Reset">
</td>
</tr>
</table>
</form>
</body>
</html>
=============================================
=============================================
page1_x.cfm
<cfif isdefined("FORM.SubmitContact") and FORM.FullName
NEQ "" and FORM.Email NEQ "">
<!--- is all is OK, do whatever it is you want to do.
--->
<cfelse>
<!--- if the submit button was no clicked, fullname and
email (required fields) not filled out, send them back to the form
--->
<cflocation url="page1.cfm?status=1" addtoken="no">
</cfif>
=============================================
Now, there is sooooo much more you can here for a full blown
error-proof script. You can also check if the e-mail is a valid
e-mail (server side), and if the field is a numeric field (like zip
code, phone number, etc) then check if that field is valid, etc.
This is just a run-of-mill simple form and validation
submission using both client-side JS and server-side code. -
Need to dial a phone number from Cold Fusion
My boss asked me if there was any way that a phone number
could be dialed from Cold Fusion. We have a website where at some
point we want to just click a button and dial that phone number. My
guess is that the conversation will then be carried through the
computer's microphone and speakers and using the computer's modem.
Let me know if there is a way, or what would be the easiest
way to accomplish this, even if it has to be using VOIP, since
that's an option for this project.
Thanks!Is this an internal site or an public-facing site? If you are
talking about using this tool in your intranet and you have a
modern phone system in place, there may be an API to interfacing
with your phone system. We use a TAPI interface to create a phone
dialer so our callcenter agents can dial a phone number on their
phone just by clicking on a link. I'm pretty sure there are a bunch
of freeware/shareware TAPI COM objects you can use floating around
the interwebs (If your phone system supports TAPI).
If you are talking about a public-facing website, then I'm
afraid I can't offer much advice other than to check out the Java
Communications lead that Ted gave you.
Maybe you are looking for
-
A "HP Twain Scan" function in the "Print and Scan Doctor" app - Solution?
Frustration!! Why can't I get the scanning portion of subject printer to work on my laptop Windows 7 (64-bit)!?? I've tried the Print and Scan Doctor several times, and the same dysfunction says "HP Twain Scan" whatever that means or is? I've pulled
-
How to configure firewall access for ASA 5510
Hi, This is my first time to use the Cisco ASA 5500 family. I have a request from a user to create an access rule, to allow all LAN traffic to Destination IP address 165.241.29.17, 165.241.31.254 with Destination TCP port 5060,5061,5070 and UDP port
-
HP Recovery media creation troubles-C​an't run
Hi, I have a hp pavilion dv6 notebook, operation with windows 7 64bits. I'm trying to create a recovery media with a usb drive, i followed the recovery instructions given by HP support. The creation began and everything was fine, till the step of dev
-
How to setup iTunes in Cambodia?
Hello Community, iTunes required my credit card payment address in Vietnam or Singapore or other country. Why not Cambodia? How to install apps if I am based in Cambodia? Regards/Rithy
-
Html export with embedded video won't play on ipad
Keynote 6.0 for Mac - when you export a keynote as html, if there is embedded video, the video will not play on an ios device.