I should specify username and password for each request?

I've been using Coldfusion since version 5 and this time, I've always chosen to not include the user name and password when configuring my datasource in CFAdmin. Instead I included it in any of my questions:

< cfquery datasource = 'MyDataSource' username = "MyUsername" password = "MonMotpasse" >

I started using CF9 and I am wanting to use the "new query" script method in my components, but I don't want to have to include the user name and password each time:

< cfscript >

local.myQuery = new query();

local.myquery.setDatasource ('MyDataSource');

local.myquery.setUsername ('MyUsername');

local.myquery.setPassword ('MyPassword');

.....

< / cfscript >

I wonder if there are security concerns to set the username and password in my datasource in CFAdmin? I also wonder if I YOU set them before or not?

Depends on a number of things:

What version do you use? Standard or Premium?

If Enterprise, you use sandbox?

It is your own server, or a shared server?

Personally, I'm not defining them (with the exception of the ORM, when I have no choice) for several reasons.

If you are using a server that is shared with no sandbox layout, anyone on the box can use and manipulate your data. I need no more, he said.

If you are running Enterprise from a tray to sand which is just beautiful, save your password in CFAdmin. However, if you move a shared area? What to do if your boss won't pay for an upgrade of the company to move the standard? You're either leave you wide open to a cut or your code won't work. For these reasons, I would never store the details in CFAdmin.

How about you create yourself a little feature support like this and put it somewhere useful (including file, field of Application etc.):

var q = new query();

q.setDatasource (APPLICATION. DB.getDatasource ());

q.setUsername (APPLICATION. DB.getUsername ());

q.setPassword (APPLICATION. DB.getPassword ());

Return to q;

So rather than the code you posted, you could just do:

myQuery = newQueryWithDetailsAlreadySetAndACatchyName();

myQuery...

This way, you get the best of both worlds - do not need to store your data and you don't end up repeating your code.

O.

Tags: ColdFusion

Similar Questions

  • Is there a way to force Firefox 4 to offer to remember and to remember usernames and passwords for sites that use the AutoComplete mechanism to block these offers and memories?

    locked by a moderator, 07/02/2012 - has survived its usefulness

    In Firefox 3.6.16 (and probably other earlier versions) could force FF to offer to remember usernames and passwords for many sites by editing the file ...\Mozilla Firefox\components \nsLoginManager.js to ignore site - asked deactivate autocomplete (_isAutocompleteDisabled returns false).

    FireFox 4 does not use this file, or a similar one that I could find.

    The result (FF ignores site trying to disable AutoComplete) is possible in another way or by editing another file?

    This bookmarklet makes the browser ignore autocomplete = "off" temporarily, allows to save passwords even on sites that use autocomplete = "off".

    Don't forget to bookmark password:

    https://www.squarefree.com/bookmarklets/forms.html#remember_password

  • How can I find my username and password for Windows xp media center? don't remember setting but cannot get back in after the restart.

    How can I find my username and password for Windows xp media center? don't remember setting but cannot get back in after the restart.

    Hi Carol_971,

    1. Did you the latest changes on the computer?
    2. You have security software installed on the computer?

    Method 1

    I suggest that you try to start in safe mode and then try to log on to Windows using the default Administrator account and then remove the password for your account, check if it helps.

    A description of the options to start in Windows XP Mode

    http://support.Microsoft.com/kb/315222

    Method 2

    If you are unable to log on to Windows in safe mode, refer to the article below and then try the steps mentioned, check if it helps.

    How to connect to your Windows XP-based computer if you forget your password or if your password expires

    http://support.Microsoft.com/kb/321305

  • should what username and password I use

    Should what username and password I use to open adobe flash player on my mac?

    Hi wallaceh43208042,

    Please check what userid & password I need to install Flash Player?

    Thank you

    Eswar.

  • I forgot my username and password for dreamweaver cs5

    I forgot my username and password for dreamweaver cs5 how do I get the

    Have you been here?

    https://www.Adobe.com/account.edu.html

    To retrieve your password in the defined sites:

    http://www.apptools.com/password.php

  • Default username and password for weblogic 11g (10.3.1.0) weblogic server

    Hello

    can someone help me with the default username and password for weblogic 11g (10.3.1.0) weblogic server.

    Thank you

    The default is system/Passw0rd

    Nicolas.

  • By default the username and password for examples of Packages

    Hello

    What is the default username and password for examples of packages mentioned in this article for all the packaged sample applications?
    http://www.Oracle.com/technology/products/database/application_express/packaged_apps/packaged_apps.html#packaged

    Concerning

    Edited by: user20090209 May 19, 2010 13:37

    Hello

    Try the same username and password that you connect to your workspace.
    Most of the applications use Application Express authentication

    BR, Jari

    Published by: jarola on May 19, 2010 09:06

    And when you have downloaded and installed the application on your workspace, you can always change authentication

  • WRT54G2-Lost username and password for router Web page

    When I type in my router (WRT54G2) Web page he asked me a username and password as usual.  But my problem is that I forgot my username and password.  So, how would I be able to find it or reset it?

    You need to reset the default router by pressing the reset for 30 seconds button... There is no other way if you forgot the password...

  • By default the administrator username and password for the Weblogic Server administration Console

    I have created a new domain Wizard configuration under windows (with config.cmd).
    When you set up the field, I don't check boxes to configure the server administration, server management, cluster...
    Just give the domain name and the location of the home field and clicked on create the domain.
    So automatically AdminServer is created and domain was created successfully.
    Once the domain is created, I started with the administrator of the server with the same configuration Wizard and clicked on fact.

    Now, the administrator of the server is started successfully. But I don't know the username Admin and the password I didn't configure it when creating the domain.

    So how to connect to the administration Console? What will be the default username Admin and password for you connect to the Management Console?

    The Assistant of the STANDARD Config does not have a default password, you must set when you create the domain. It is one of the steps in the config wizard...

    Published by: EramusBlack on April 26, 2012 16:50

  • I recently changed my username and password for Apple... my iCloud did not recognize my new ID! How do I change icloud?

    I recently changed mu user ID and password for my mobile phone to Apple 6... now my iPad did not recognize my new ID... nor has my new ID recognized iCloud!

    can anyone help?

    Ismah42 wrote:

    I recently changed mu user ID and password for my mobile phone to Apple 6... now my iPad did not recognize my new ID... nor has my new ID recognized iCloud!

    can anyone help?

    and you have already entered in iTunes/app store and setting to icloud and made the changes too?

  • LLA network requires a username and password for devices. College. Options!

    I am a new student of college and I want to print wireless.  The network needs a username and password.  The problem is when you set up a wireless network on the printer, that it does not allow this. What are my options to print? Help, please!

    Printer e-all-in-one-HP Officejet 6500

    Printers do not work with networks that require a user name and password to communicate on the network.  I'm sorry.

    The only way you will be able to use the wireless printer is through an ad - hoc connection.  This means that the computer will not an Internet connection when it is connected to the printer's ad - hoc network, unless the computer has two network connections available (wireless or wireless 2 1 and 1 wired).

    The top of the page 138 of the Manualdetails how to connect to the printer's ad - hoc network.

    Let me know what happens.

  • username and password for HP Officejet Pro 8500 has

    Hi I'm trying to put up the 'digital fax to configuration file' I am at the last step and it requires a username and password that I've not used it before. Or if I did it was 4 years ago.  How can I find the username and password

    Try this

    http://www.SevenForums.com/tutorials/288-password-create-user-account.html

  • Vista invites the login screen to enter username and password for folder during the connection

    Hi all
    I have the shared folder on XP. A few days ago I changed the password on the XP machine for the user of Vista, and now I can't connect to the shared folder, because Vista is by using the old password and didn't invite the login user name and password window. Then I try to connect from another PC with Windows7, everything goes well. Even when I change the password on PC XP Windows7 user (just quick Windows7 home screen of the user name and password, so I can enter the same username and the new password to connect successfully). Please, help me to deal with this question, suggestions or something?

    Sirdele

    Try clicking on this link below, it should help you with your problem.

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-networking/Windows-7-asks-enter-network-password-when/2a8e6d6f-74a1-43C7-8530-24e8522ea955

  • Failed to retrieve my username and password for WRT160N... What can I do now?

    Recently, I had problems composed of first accidentally delete the My Documents folder together with the value of the years of information (and shame on me for not have no backup) and then I sufferred a computer who crash a paid technician corrected by me up and running, but he could not say what caused the problem.  The long and short of this is that one of the consequences has been that I can access is no longer my router and controls configuration settings because I don't have a record of my user name and password, and I cannot therefore, among other things, to add my newly acquired smartphone (first ever) at my home network or wifi.

    I contacted Linksys support, but my camera is out of warranty and they will assist me only if I pay for premium support.  What disturbed me even more far, it was the tech rep told me it might take half an hour to guide me through the process to reset my router... really?

    is there anyone in this community who could provide me with a way to reset my router?  (Says the tech rep that could be risky, but then he tried to get me to buy a new 'low price' router... come to think of it, I should probably refer to this chap as a salesman and not a tech support rep.)

    Thanks Chris.

    I looked at your targeted links and I have just one question before proceeding.  I could be wrong, but it appears that I might have to reconfigure my settings entirely after the reset of the router to its default settings.  In addition, it seems to say that the only way to avoid the total reconfiguration is to save my current settings before a reset, but that also seems to require knowledge of my user name and password to access the configuration... page which of course, I've lost.  In essence, interpret this information to say that without a knowledge user name and password, I don't have the option to make a backup of my existing configuration, or do a "reset" and I so I only have the option for a «hard "reset and a complete manual reconfiguration after the reset... am I was right this interpretation?»

  • Default username and password for the workspace Configurator

    I am trying to test a couple of new configurations, each of them send me different errors.

    To check errors given Id like to log in the configurator and look at its newspapers, but I can't seem to find the combo of name of user and password by default for this application (installation has failed to the point of him beign gave a password to me any thoughts?.)

    How you try to connect?  From the GUI or CLI?  If it is a CLI, you can try sshuser / vmware

Maybe you are looking for

  • Trying to create the recovery USB disk

    I am trying to create a usb for my yoga 2 pro recovery disk. I found the instructions of lenovo support page, but when I search "recovery disk", nothing comes. Does anyone know why this might be?

  • Get the VI icon + description (as in help)

  • 1536dnf: cannot scan

    My printer not scan.  I tried to get on the Web site to get instructions, but the page does not load.

  • HP Pavilion dv6 Notebook PC: IDT HD Audio Driver-or-AMD HD Audio Driver

    My father had his laptop repaired, requiring a reinstall of the OS and other... "Technicians" sort of just filled with white, install the drivers and software that did not originally come with the PC. MY QUESTION;  as the title: which driver should I

  • b002au

    I installed Win 7 x 64 on my HP Pavilion sleekbook, model # b002au. I installed all the drivers supplied by HP for Windows 8. Some of them worked, but two USB ports do not work. Also the Bluetooth and Wifi drivers do not work. Please help me where I