How to create a variable < sql:setDataSource > database password

Hello

I hope someone can enlighten me on that.

I am trying to create a jsp page that uses JSTL to access the database. Regulations in my company requires me to use the password for the encrypted database.

Here is an excerpt of my codes. The error I get is the password = "${decryptedPassword}" never work. However, it can print the password correctly from "System.out.println ("password is"+ decryptedPassword);" How can I pass the variable 'decryptedPassword' in the password?

Thank you very much!

Steve

< %
System.setProperty ("oracle.net.tns_admin", "C: / NEW PC BACKUP/oracle/product/10.2.0/client_1/NETWORK/ADMIN");
System.setProperty ("oracle.net.tns_admin", "/ usr/local/oracle/10.2.0.3/network/admin");
String decryptedPassword = "";

Logger.info ("PLANNER_REPORT_EDOW_PSWD_ENCRYPT_KEY = <" + keyAlias + ">");
Logger.info ("PLANNER_REPORT_EDOW_PSWD_KEY_STORE = <" + keyStoreFile + ">");

FStore FileBasedKeyStore = new FileBasedKeyStore ("/ usr/local/scripts/keystorefile/key.dat", null);
If (fStore == null) System.out.println ("keystore is null");
Key = fStore.getKey ("cities") (Key);
If (key == null) System.out.println ("key is null");
decryptedPassword = new String (CryptoUtil.decryptFromBase64 ("OIC/n5asIP6CDR01WwvXtw is", key));
System.out.println ("password is" + decryptedPassword);
% >

< sql:setDataSource var = 'snapshot' driver = "oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@cngd" user = "citosapp" password = "${decryptedPassword}" / > "

A variable in the Java code is not available as magically as a variable JSTL. You will need to add it to the requestScope for example (request.addParameter ()).

Your confusion is proof enough that it is a very bad idea to put the Java code in your JSP pages. It leads to unreadable code. You should learn how to combine JSPs & servlets to separate the logic of the other Java and JSP code model.

Tags: Java

Similar Questions

  • How to create a copy of a database thanks al

    How to create a copy of a database.

    Thank you edstevens for details, that thank you

  • Am about to buy DW.  2 quick questions before proceeding.  (1) can I associate a DW created an EXTERNAL SQL Express database for the read/write site?  Can be made safe?  (2) am plans to use Contribute to allow non-technical users to end dry change

    Am about to buy DW.  2 quick questions before proceeding.  (1) can I associate a DW created an EXTERNAL SQL Express database for the read/write site?  Can be made safe?  (2) am plans to use Contribute to allow non-technical end users EASILY change the sections of the web site.  Can this work?  Thank you.

    I would like some ideas.

    A CMS is the standard solution in the industry today. The most common environment is LAMP (LINUX, Apache, MySQL, PHP).

    Some of us to write custom CMS systems for a living. I concentrate on CMS for retirement centers. There are all kinds of solutions CMS available ranging from generalist, off-the-shelf CMS like WordPress, completely custom, with a lot of opportunities in the meantime.

  • How to create unique variables for... in loop? (AS2)

    Hello

    I have a function onEnterFrame controlling all the movie clips in a table. The movement of each of these clips is controlled by a few variables - speed, acceleration, etc - that are changed on every enterFrame. I can't understand how to create unique variables for each element of the array. Now my variables are the same for all elements, and therefore the proposals of each video clip are the same.

    I used this code to add my video clips in the table:

    for (i = 0; i < starNumber; i ++) {}
    duplicateMovieClip (star, "star" + I, i);
    starArray.push (this ["star" + String (i)]);
    }

    I do a similar thing to create unique variables for each? Or is there something I need to do my loop (myClip in myArray) which is contained in my onEnterFrame function?

    I can post my code if that would help (65 lines).

    Creating unique variables is easy way out. Here's the modified code using unique variables that should solve your problem:

    var i: Number;

    var starArray:Array = [];

    var starArray_X:Array = [];

    var starArray_Y:Array = [];

    var mc:String;

    var scale: number;

    var speedXMod:Number;

    var speedYMod:Number;

    var starNumber:Number = 10;

    var minSize:Number = 15;

    var maxSize:Number = 80;

    var speed: number = 0.2;

    var minSpeed:Number = 0;

    var maxSpeed:Number = 1;

    for (i = 0; i< starnumber;="">

    duplicateMovieClip (star, "star" + I, i);

    starArray.push (this ["star" + String (i)]);

    }

    (MC starArray) {}

    starArray [mc] ._x = (Math.Random () * Stage.width);

    starArray [mc] ._y = (Math.Random () * Stage.height);

    scale = (minSize + (Math.Random () * (maxSize - minSize)));

    ._xscale starArray [mc] = scale;

    starArray [mc] ._yscale = scale;

    var startSpeedX:Number = ((Math.pow (-1, (Math.round (Math.random ())) * (minSpeed + (Math.Random () * (maxSpeed - minSpeed)));)))

    var startSpeedY:Number = ((Math.pow (-1, (Math.round (Math.random ())) * (minSpeed + (Math.Random () * (maxSpeed - minSpeed)));)))

    [mc] starArray_X = startSpeedX;

    [mc] starArray_Y = startSpeedY;

    onEnterFrame = function() {}

    (MC starArray) {}

    speedXMod = ((Math.random () * acceleration)-(0,5 * accélération));

    speedYMod = ((Math.random () * acceleration)-(0,5 * accélération));

    If (((Math.abs (starArray_X [mc] + speedXMod)) < maxspeed)="" &&="" ((math.abs(stararray_x[mc]="" +="" speedxmod))=""> minSpeed)) {}

    [mc] starArray_X += speedXMod;

    } else {}

    [mc] starArray_X = speedXMod;

    }

    If (((Math.abs (starArray_Y [mc] + speedYMod)) < maxspeed)="" &&="" ((math.abs(stararray_y[mc]+="" speedymod))=""> minSpeed)) {}

    [mc] starArray_Y += speedYMod;

    } else {}

    [mc] starArray_Y = speedYMod;

    }

    If (((starArray [mc]._x + starArray_X[mc]) > 0) & ((starArray [mc]._x + starArray_X[mc])))<>

    starArray [mc] ._x += starArray_X [mc];

    } else {}

    starArray_X [mc] * = - 1;

    starArray [mc] ._x += starArray_X [mc];

    }

    If (((starArray [mc]._y + starArray_Y[mc]) > 0) & ((starArray [mc]._y + starArray_Y[mc])))<>

    starArray [mc] ._y += starArray_Y [mc];

    } else {}

    starArray_Y [mc] * = - 1;

    starArray [mc] ._y += starArray_Y [mc];

    }

    }

    }

    }

  • How to create an identifier SQL, sql Profiler

    Hi team,

    An application runs for a long time if I want to create the sql for If sql Profiler for the request. Example is my sql f70m2g5rbfvbg code.

    My question is how to create the sql for the best recommendation Profiler and how to import the sql for acccepting Profiler the best profile for improved performance.

    Please suggest

    Hello

    1. you must accept the best plan based on the recommendations of the Advisor tuning

    2. second thing is to import the profile sql - transport to destination db (where you want to import)

    -Pavan Kumar N

  • How to create a variable

    Hello;

    I need to have a variable created to assign to a group. Is it possible to create a variable for the title of the extension of the word beep? I have the impression of seeing a syntax somewhere before (like variable@incontext:varname...), but could not understand how to create? Can you help me?

    Thank you.

    Munshar

    Check this forum thread: http://forums.oracle.com/forums/thread.jspa?messageID=9530049�

    See examples of use of variables in the various blogs here: http://blogs.oracle.com/xmlpublisher/templates/templates_rtf/xslxpath/

    Thank you
    Bipuser

  • How to create Global Variables in Essbase

    Hi gurus,

    In essbase automation, I saw generally the statement below.

    Connection $1 identified by $2 $ 3;

    and of course many other statements also.

    1. now, my question is where and how can we create the variables ($1, $2 and $3).
    2. they are Substitutinal Variables or Environment Variables.

    Pls let me know in detail how to create and define the variables above.


    I tried to create them as variables indirect in environmental assessments, but when you run the maxl order Login $1 $ 2 $3 its saying this $1.. variable cannot find etc.

    They are variable positional parameter and are passed in a maxl script, you can read all about it at:-http://download.oracle.com/docs/cd/E12825_01/epm.111/esb_techref/maxl_syntax_vars.htm#syntax_techref_proj_maxl_ddl_utils_shell_d0e227

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • How to create a variable in a mapping or process_flow

    I am creating a flow where I spend the audit_id of the mapping of a map as input parameters. How to do that.

    I thought create a variable and assign the id verification to this variable and linking this variable mapping that will become the entry for the mapping.

    Thank you

    joining this average assign the variable.

  • How to create the variable diagonal line pattern in CS6?

    Hi guys

    I'm at the edge of madness with the creation of my pattern of diagonal lines. I've tried everything I can think of, but the boss is an absolute mess! I want to create a pattern of diagonal lines, but I want the lines to not be uniform. Basically, I had a group of 3 lines and then a separate line on its own, then repeating this like the image below. I used the function of distributing the distances between the lines is the same everywhere. I then turned the all exactly 45 degrees and aligned with the lines to fit in the bounding box in the mode 'as the motive"as shown. Yet, the resulting model is just a mess of the ugliness of overlap. Can all that I want is the model literally watch as it does in the picture on the left, someone you please tell me how to sucessfully this in CS6? Would be eternally grateful!

    Desired design: pattern problem.png result:ugly pattern.png

    Never create a line pattern obliquely. It is not necessary.

    Create the model at 90 ° angle and then use object > transform > Rotate and check the option "Transform Patterns" and enter the angle you are after...

    Try to get the slanted lines to match a pattern can take a lot of effort. Where as with this method you can create the pattern and turn it in a few minutes. Let the Illustrator to work for you rather than against you. And, you can rotate to any angle, so the model will work in many ways.

  • How to create the schema of the database from an existing TimesTen database?

    Hello everyone,

    I am a newbie to TimesTen database. Before making the complex sql queries, I would get the DB TimesTen database schema. I'm looking for a way extract the database schema (tables, keys, links between tables...). When I was working on another db such as postgreSQL, I could get the sql script of the database (for example, in order to recreate the database in another server). Some software like PowerDesigner has managed to build the model of database of these scripts.

    You know a way to get the same thing with the TimesTen database? Or with another way?

    Concerning

    Hello

    Take a look in the docs at ttSchema, this could do the trick.

    http://download.Oracle.com/docs/CD/E13085_01/doc/TimesTen.1121/e13069/util.htm#autoId27

    Tim

  • How to create unique variables in loops? (AS2)

    Hello

    I wonder if it is possible to create variables in a loop for which uses an incremental number in the name of the variable.

    This is the code I tried (like a long shot) but does not work:

    var i: Number;
    for (i = 1; i < 10; i ++) {}
    var ['number' + String (i)]: number = i;
    }

    trace (number5);

    What I'm trying to create here is a series of variables called "Number 1", "Number2" and 'Number3', etc. Is there another way to do it? I need them to be public (I think that's the word?), so they can be used elsewhere in the script.

    I would appreciate any advice.

    Try this:

    for(var i : Number = 1; i < 10; i++)
    {
        this["number" + i.toString()] = i;
    }
    trace(number1); // will output 1
    

  • How to create a pl/sql function to give the sum of 100 not

    Hai
    If it is possible to create a function to find a sum of the first 100 numbers

    Concerning
    Srikkanth.M

    You needn't PL/SQL for this:

    SQL> select sum(level) sum_100 from dual connect by level <= 100
      2  /
    
       SUM_100
    ----------
          5050
    
    SQL> 
    

    SY.

  • How to create a variables nested within ODI?

    Dear all,

    I am facing problems by assigning a value to the variable value in ODI.

    I try to use the Variable nested... Lets say I have a RootFolder variable, which has a value of c:\ODIIntegration.

    Now, I want to use this value in another ArchiveFolder variable that must be set to RootFolder\Archive (c:\ODIIntegration\Archive).

    When you declare the variable I the value assigned to the variable ArchiveFolder as below, but it doesn't work and I get no error.

    #RootFolder\Archive

    Please guide me to use the variable correctly.

    Pointers would be much appreciated.

    Kind regards

    Manmohan Sharma

    Hello

    Enter your PROJECT CODE when calling the variable.

    In your case
    Variable ArchiveFolder = #. RootFolder\Archive

    If variable RootFolder is a GLOBAL variable then
    Variable ArchiveFolder = #GLOBAL. RootFolder\Archive

    Thank you
    Fati

  • How to create random variable of XML

    Hi guys,.

    Need your help.

    I want to create random objects on the plate and the xml.

    If you are referring to the attached picture. Each circle represents XML data.

    test.jpg

    I want to get generated on the screen randomly to the animation of acceleration.

    Note: circles should have random colors 3-4 as mentioned.

    alorsx in advance.

    -Rigorous

    This isn't all of the AS3, AS2 code.  You must republish in AS3 forum... and understand what you have tried and describe what does not work for you.

  • How to create a variable that gets + 1 or - 1 according to clicks?

    I don't know what to look for.  Is there a way to define an invisible flash variable so as to keep the score?

    The best way I can describe it comes from the BASE language I used to use back in the day, where you can click on x = x + 1 or x = x-3, or what function of the button click you.  And then it would display the score (i.e., just what is the current value of x) in the corner?

    I guess the simplest way that could help me to give me a link or the actual code you EF to a single button that will add or subtract a score displayed in the corner.

    My knowledge of ActionScript is very limited... I know that what I have copy - paste for my purposes of line.

    Thank you!

    However, whenever you plan to display the value you can use...

    textFieldName.text = String (someVariable);

    where textFieldName is any instance name assign you to the TextField object

    Please mark this ad as answered if you can.

Maybe you are looking for