How to store multiline string literal in to java bean shell variable

Hello Experts
How to store multiline string literals in java bean shell like we use triple quote for jython variable
Using Jython
str=""" helllo
welcome to my world"""
above syntax is working but not for java bean shell like below
String str=""" hello
welcome to my world""";
So how to do this in java bean shell. I came to this scenario while storing logs to a variable. I believe there is no solution for storing multiline strings to java bean shell variable.
<@
String str="<%=odiRef.getPrevStepLog("MESSAGE")%>";
@>
Any suggestion will be highly appreciated.
Thank You.

maddythehunk wrote:
Im trying this but its not working...
while(billingQueryParamsItr.hasNext()) {
     billingQueryParam = (BillingQueryParam) billingQueryParamsItr.next();
     System.out.println("****** Param Name-->"+billingQueryParam.getParamName());
     String[0] name = billingQueryParam.getParamName(); // giving error ; expected
     //billingItemActionForm.setParamName(billingQueryParam.getParamName());
Declare the array outside of the loop. Fill the array as you iterate. And stop putting your error messages inside of comments in the code.

Similar Messages

  • How to store jython variable to java bean shell variable

    Hello experts.
    I have one procedure. here is the details
    1st step is with java bean shell techonolgy and one variable.
    <@
    String testv=" ";
    @>
    Second step is jython technology.
    str3='storing some value as per my logic'
    <@testv@>=str3 // here I am getting error because i want to store jython variable to java bean shell variable
    Once it will be stored , I will use in query as SELECT '<@=testv@>' from dual. If this is not possible is there any way to get the jython variable in side refreshing query
    how to achieve this please suggest.
    Thank you.

    Hello experts. Any suggestion on this. How to store jython variable value into java bean shell variable.
    Thank You.

  • How to Store word doc in oracle  using java

    hi
    toall
    can any one tell me how to store word doc in oracle9i using java
    bye

    Please refer to
    http://www.databasejournal.com/features/oracle/article.php/3305771

  • How to call a .jar file from a java bean?

    any body knows how to call a .jar file from a java bean?

    Crosspost!
    http://forum.java.sun.com/thread.jspa?messageID=4349619

  • How to store a RSA pair key in Java Key Store (jks) and VS

    Hi Everyone ,
    I have generated a RSA pair key . now I need to store my public key in a Java Key Store (.jks file) . and then I need to read this .jks file in another application and get this public key to use for verification .
    I'll appreciate it if anyone could help me with this matter with a sample code for import/export public key to/from a java key store file or any hints.
    Best Regards,
    Vivian

    I don't think this makes sense. How have you generated an RSA key pair and where is the result stored?

  • How can I insert a record through a java bean

    Hi everybody,
    I'd some problem when I insert a record using java bean. When I want to insert a record. The result in executeUpdate must return 0. Would you please tell me what's wrong in my code?
    java bean
    package miniproj;
    import java.sql.*;
    public class Register{
         private String sql;
         private String username;
         private String usertype;
         private String password;
         private String blocknum;
         private int floornum;
         private String owner;
         private int rows;
         private String s;
    // set parameter to database
         public int setMember(){
              try{
    //load database driver
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    // Get a connection to the database
                   Connection sqlConn = java.sql.DriverManager.getConnection("jdbc.odbc:WFBS");
    // Get a statement from the connection
                   Statement sqlStmt = sqlConn.createStatement();
                   sql = "INSERT INTO USERS(user_name, password) VALEUS ('aaa', 'aaa')";
    //               sql = "INSERT INTO USERS(user_name, password) VALEUS (" + user_name + "," + password + ")" ;
                   rows = sqlStmt.executeUpdate(sql);
    //               sqlRst.close();
                   sqlStmt.close();
                   sqlConn.close();
              catch(SQLException se){
              catch(Exception e){
              return rows;
    // set user name method
         public void setUsername(String name){
              username = name;
    // set passwrod method
         public void setPassword(String pwd){
              password = pwd;
    // set block num mehtod
         public void setBlockNum(String block){
              blocknum = block;
    // set floor num method
         public void setFloorNum(int floor){
              floornum = floor;
    // set owner method
         public void setOnwer(String own){
              owner = own;
    // get user name method
         public String getUsername(){
              return username;
    // get password method
         public String getPassword(){
              return password;
    jsp code
    <%@ include file="Header.jsp" %>
    <%@ page errorPage="Error.jsp" %>
    <jsp:useBean id="register" class="miniproj.Register" />
    <jsp:setProperty name="register" property="*" />
    User name : <%=register.getUsername()%><br>
    Password : <%=register.getPassword()%><br>
    <%
         int i = register.setMember();
         out.println(i);
    %>
    Thanks a lot
    Chris

    Correct the spelling of Values
    sql = "INSERT INTO USERS(user_name, password) VALUES ('aaa', 'aaa')";

  • How to store the string scanned by the scanner class

    try {
           Scanner scanner = new Scanner(new File("D:\\textfile.txt"));
           String sb;
           scanner.useDelimiter("\\t");
           while (scanner.hasNext()== true)
           System.out.println(scanner.next());
              scanner.close();
           catch (FileNotFoundException e)
           e.printStackTrace();
         }Output i get is
    Hi
    how
    are
    you
    I would like to store each word in a different string.What changes do i need to make in the code given above?

    warnerja wrote:
    But what if the text file contains "Trolls are annoying"? Then your solution fails.No warnerjav - this is not so.
    Solution still nearly works but assigns "Trolls" to variable 'hi', "are" to variable 'how' and "annoying" to variable 'are'.
    But you are right to point out that we must now trap exception for call to
    String you = scanner.next();in order to fix the javs for the sentence you suggest because there will be no more words in the scanner darkly.
    Best thankyou for you pointing this out to me for the hlep of us all learning more about the Javs we love.
    Best greetings,
    Bob Gateaux.

  • How to write multiline String in a JLabel

    How can i write a string that is shown in many lines in a JLabel. Or is there any orher way to write them?
    Also, similarly how to write tooltip text that spans across many lines. Not just one line

    import java.awt.*;
    import javax.swing.*;
    public class UseThisTheNextTimeYouFeelLikePostingEelops {
        public static void main(String[] args) {
            String str = "This is \nmy example \nof a multi-line \nJLabel";
            JLabel strLabel = new JLabel (str);
            display(strLabel, "Hmmm...");
        public static void display(JComponent comp, String title) {
            JFrame f = new JFrame(title);
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(comp);
            f.pack();
            f.setLocationRelativeTo(null);
            f.setVisible(true);
    }

  • How to store a string in VARCHAR2

    hi,
    i am having problems in storing following string in a varchar2(300) column:
    the string is: “&’igiy’yuiyuiyui””&&&uyutyu”””’’’’“&’igiy’yuiyuiyui””&&&uyutyu”””’’’’“&’igiy’yuiyuiyui””&&&uyutyu”””’’’’“&’igiy’yuiyuiyui””&&&uyutyu”””’’’’“&’igiy’yuiyuiyui””&&&uyutyu”””’’’’“&’igiy’yuiyuiyui””&&&uyutyu”””’’’’“&’igiy’yuiyuiyui””&&&uyutyu”””’’’’“&’igiy’yu
    now when i try to store it ,,it ask me abt the value of uyuuuu etc.
    pl tell me way to store it.
    regards
    Muhammad Umar Liaquat.

    Issue the following command before storing it.
    set define off

  • How to Store Encrypted String into OracleDatabase Column(vacrchar2)

    Hi..
    I encountered an error while inserting a Encryted String into oracle column.. Error "Quoted String Doesn't terminated properly"
    But i wrote Query string correctly and using Datatypes as String and vacharchar2(2000) in java and oracle respectively..
    what i need to do?

    Hi,
    if your code compose the sql programmatically without bind variables i.e.:
    String sqlInsert="insert into table A(encrypted_column) values ('" + encryptedValue+ ')");
    then if the string encryptedValue contains a ' character you end up with a wrong sql statement
    if you encryped values is something like AAABB#??£££'AAA the corresponding sql is
    insert into table A(encrypted_column) values ('AAABB#??£££'AAA')
    which is not correct becaus of the ' in the middle of the string.
    Giovanni

  • How to put a String(date) into Date (java.util.date)??

    hi there
    I got a GUI here and I need to read some JMaskedTextFields from it. I put them all into Strings. Now I need to pass them to the search-function, but one of the search arguments is not string. Its Date. I tried to initialize Date with Date(String s) but he doesnt take it. Now Im asking how can I do this the easiest way?
    The String has only digits and a . betwenn them, like this: 12.02.1978 and I want to pass this into the Date.
    thx for helping :-)

    thx
    Now I got it so far, it looks like this:
    String datumVon = suchen_kriterien_datVon_JMaTextFeld.getText();
    String datumBis = suchen_kriterien_datBis_JMaTextFeld.getText();
    SimpleDateFormat formatter = new SimpleDateFormat ("dd.MM.yyyy");
    ParsePosition pos = new ParsePosition(0);
    Date datVon = formatter.parse(datumVon, pos);
    Date datBis = formatter.parse(datumBis, pos);
    System.out.println(datVon);
    System.out.println(datBis);
    The Problem is that he only makes the first print when both dates are given. If I only give him the first, so he prints the first. If I give him only the scond, so he prints the second. But when I give him both, he only prints the first!!! why?

  • How to encode a string to base64 in java ?

    Hi, I want to send my user name to my SMTP server encoded in base64 .
    How do I do this ??
    Ramesh

    Ok I wait for you.
    I guess the following covert a string to base 8
    String userName ="Ramesh"
    byte[] strBytes = userName.getBytes("UTF-8");
    I do not know about base64.
    I need this urgently because I am sending my user name and password to my SMTP server and they should be encoded in base64.
    Please help.
    Ramesh

  • How to display subvi string to main FP by using global variable??

    Attach with my vi's here.
    Any help here.
    Thanks in advance.
    regards,
    Simon
    Attachments:
    test.vi ‏15 KB
    subvi.vi ‏31 KB
    Global.vi ‏5 KB

    You could add an independent while loop in the main VI that reads the global every second (or so) and displays it in the indicator.
    (Still, there are probably better ways to do all this ...)
    LabVIEW Champion . Do more with less code and in less time .

  • How Insert the input parameter to database through Java Bean

    Hello To All..
    I want to store the input parameter through Standard Action <jsp:useBean>.
    jsp:useBean call a property IssueData. this property exist in
    SimpleBean which create a connection from DB and insert the data.
    At run time when I click on submit button servlet and server also show that loggging are saved in DB.
    But when I open the table in Access. Its empty.
    Ms-Access have two fields- User, Pass both are text type.
    Please review these code:
    login.html:
    <html>
    <head>
    <title>A simple JSP application</title>
    <script language=javascript>
    function f(k)
    document.forms['frm'].mykey.value=k;
    document.forms['frm'].submit();
    </script>
    <head>
    <body>
    <form method="get" action="tmp" name="frm">
    Name: <input type="text" name="User">
    Password: <input type="password" name="Pass">
    <input type=hidden name="mykey" value="">
    <input type="button" value="Submit" onclick="f('submit.jsp')">
    <input type="button" value="Issue" onclick="f('issue.jsp')">
    </form>
    </body>
    </html>LoginServlet.java:import javax.servlet.*;
    import javax.servlet.http.*;
    public class LoginServlet extends HttpServlet{
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException{
    try
    String User=request.getParameter("User");
    String Pass=request.getParameter("Pass");
    co.SimpleBean st = new co.SimpleBean();
    st.setUser(User);
    st.setPass(Pass);
    request.setAttribute("User",st);
    request.setAttribute("Pass",st);
    RequestDispatcher dispatcher1 =request.getRequestDispatcher("/"+request.getParameter("mykey"));
    dispatcher1.forward(request,response);
    catch(Exception e)
    e.printStackTrace();
    }SimpleBean.java:package co;
    import java.util.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.util.*;
    public class SimpleBean
    private String User="";
    private String Pass="";
    private String s="";
    public SimpleBean(){}
    public String getUser() {
    return User;
    public void setUser(String User) {
    this.User = User;
    public String getPass() {
    return Pass;
    public void setPass(String Pass) {
    this.Pass = Pass;
    public String getissueData() //method that create connection with database
    try
    System.out.println("Printed*************************************************************");
    getUser();
    getPass();
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    System.out.println("Loading....");
    Connection con=DriverManager.getConnection("jdbc:odbc:simple");
    System.out.println("Connected....");
    PreparedStatement st=con.prepareStatement("insert into Table1 values(?,?)");
    System.out.println("~~~~~~~~~~~~~~~~~~~~");
    String User=getUser();
    st.setString(1,User);
    String Pass=getPass();
    st.setString(2,Pass);
    int y= st.executeUpdate();
    System.out.println(y);
    System.out.println("Query Executed");
    con.commit();
    con.close();
    s=  "Your logging is saved in DB ";
    System.out.println("Your logging is saved in DB *****************");
    return this.s;
    catch(Exception e)
    e.printStackTrace();
    return "failed";
    }submit.jsp:
    This is Submit page
    <html><body>
    Hello
    Student Name: <%= ((co.SimpleBean)request.getAttribute("User")).getUser() %>
    <br>
    Password: <%= ((co.SimpleBean)request.getAttribute("Pass")).getPass() %>
    <br>
    <jsp:useBean id="st" class="co.SimpleBean" scope="request"/>
    <jsp:setProperty name="st" property="User" value="request.getParamaeter("Pass")"/>
            <jsp:setProperty name="st" property="Pass" value="request.getParamaeter("Pass")"/>
       <jsp:getProperty name="st" property="issueData"/>
    <% st.getissueData(); %>
    </body></html>web.xml:<web-app>
    <servlet>
    <servlet-name>one</servlet-name>
    <servlet-class>LoginServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>one</servlet-name>
    <url-pattern>/tmp</url-pattern>
    </servlet-mapping>
    <jsp-file>issue.jsp</jsp-file>
    <jsp-file>submit.jsp</jsp-file>
    <url-pattern>*.do</url-pattern>
    <welcome-file-list>
    <welcome-file>Login.html</welcome-file>
    </welcome-file-list>
    </web-app>Please Help me..

    Dear Sir,
    Accordingly your suggestion I check the SimpleBean class putting the constant values in this bean class.That is Sucessfully Inserted constant values in database.
    Like for example..
    myfirstjavabean.java:
    package myfirstjava;
    import java.io.*;
    import java.sql.*;
    public class myfirstjavabean
    private String firstMsg="Hello world";
    private String s="";
    public myfirstjavabean()
    public String getfirstMsg()
    return firstMsg;
    public void setfirstMsg(String firstMsg)
    this.firstMsg=firstMsg;
    public String getissueData() //method that create connection with database
    try
    System.out.println("Printed*************************************************************");
    getfirstMsg();
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    System.out.println("Loading....");
    Connection con=DriverManager.getConnection("jdbc:odbc:sampleMsg");
    System.out.println("Connected....");
    PreparedStatement st=con.prepareStatement("insert into Table1 values(?)");
    System.out.println("~~~~~~~~~~~~~~~~~~~~");
    String Msg=getfirstMsg();
    st.setString(1,Msg);
    int y= st.executeUpdate();
    System.out.println(y);
    System.out.println("Query Executed");
    con.commit();
    con.close();
    s=  "Your logging is saved in DB ";
    System.out.println("Your logging is saved in DB *****************");
    return this.s;
    catch(Exception e)
    e.printStackTrace();
    return "failed";
    }Vij.jsp:
    <html>
    <body>
    <jsp:useBean id="st" class="myfirstjava.myfirstjavabean" scope="request" />
    <jsp:getProperty name="st" property="firstMsg" />
    <jsp:getProperty name="st" property="issueData" />
    </body>
    </html>These above example sucessfully inserted the Hello World message in database.
    But which value I put user input at run time Its not inserted in database.
    Which is my previous problem that is persist.
    Please Help..

  • How to read the current value of hyperlink java bean in multiple record,

    I have used a java bean for a multi-record block item. On When-new form-instance I m using fbean package as follows
    FBean.Register_Bean(hHyperlink,1,'oracle.forms.demos.beans.Hyperlink');
    FBean.Invoke(hHyperlink,1,'setURL','Abc_Entry');
    FBean.Invoke(hHyperlink,1,'setLabel','Abc Document');
    FBean.Enable_Event(hHyperlink,1,'actionListener',true);
    You can see that I am using the number 1 which is hardcoded,for which I will replace with a incremental loop and remove it. Now when I m using the When-Custom-Item-Event, I want to read the URL for the current instance.
    I m using
    vcEventData := Fbean.Invoke_Char('CONTROL.HYPERLINK',2,'getURL');
    to get the second record value , where in I want to avoid the hardcoded 2 or 1
    Thank you

    I recommend you these forums for your question:
    Forums Home » Oracle Technology Network (OTN) » Products » Database » JVM
    Java in the Oracle Database
    Forums Home » Oracle Technology Network (OTN) » Technologies » Java » Java Server Pages (JSP)
    Java Server Pages (JSP)
    Forums Home » Oracle Technology Network (OTN) » Technologies » Java
    http://forums.oracle.com/forums/index.jsp?cat=24
    Joel Pérez

Maybe you are looking for