How to print PreparedStatment object in console

Dear All
i am using PreparedStatment for inserting data into a table, in my local system it is working fine, but after deploying in JBoss(Server) it is throwing "invalid column type" error. In order to check i tried to print in the JBoss console but i am unable print in the console, kindly help me regarding this.
The code which i used is:
PreparedStatement stmtPrep = conn.prepareStatement(sql);
try {
stmtPrep.setObject(1, number);
stmtPrep.setObject(2, (String) passList.get("PlantCode"));
stmtPrep.setObject(2, (String) passList.get("PlantExt"));
stmtPrep.setObject(3, ls_per_ord_qty_ind);
stmtPrep.setObject(4, ls_price);
stmtPrep.setObject(5, (String) inList.get(4));
stmtPrep.setObject(6, (String) List.get("txtStoreLoc"));
stmtPrep.setObject(7, (String) List.get(1));
h = (String) List.get("Price");
float unit = Float.valueOf(h.trim()).floatValue();
stmtPrep.setFloat(8, unit);
System.out.println(">>>Query is>>>>>"+stmtPrep);
Can any one guide me how to print in JBoss console this stmtPrep and check all the values that i am passing r correct r not.
but it is throwing like this:
15:16:30,686 INFO [STDOUT] >>>Query is>>>>>org.jboss.resource.adapter.jdbc.Wrap
pedPreparedStatement@1056bdd

sasikrishna wrote:
Dear All
i am using PreparedStatment for inserting data into a table, in my local system it is working fine, ok.
but after deploying in JBoss(Server) it is throwing "invalid column type" error. That would seem to be a database problem to me. Schema specifically.
In order to check i tried to print in the JBoss console but i am unable print in the console, Why does it matter since it will not help you?
Your code specifically details the object types that you are setting.
Presumbly the 'sql' is just a hard coded value.
Consquently the conclusion is that the database on your local box versus the deployment is different. And nothing that you print in JBOSS will help you discover what the difference is. You need to look at the 'sql' and determine the entities from that and then compare them in the schema for both places.
check all the values that i am passing r correct r not.As noted if that isn't a security violation for your application then you are left with the following.
- Drivers do not necessarily create SQL.
- If they do AND the driver is up to date then there is a method (look for it in the javadocs) that will return it
- If not you should use a jdbc wrapper proxy that consumes the data for you. This might be better even if the driver does it.

Similar Messages

  • How to print from XSJS to Console

    Hello Experts,
    I have some code in XSJS to populate/Update my Hana DB based on some conditions. I am looking for a mechanism where I can print few comments to console or to some log file.
    I know i can use console.log(); for normal javascript on web browser but it does not work on XSJS. Some other implementation of Server Side JS like node.js gives echo command. Is there something similar for XSJS ?
    Thanks in advance.

    Thanks for this information. I tried a very simple xsjs to test this but its not working for me. Could you please tell me what am I doing wrong here ?
    my test.xsjs
    function testTrace () {
         $.trace.info('My name is Raghuveer');
    testTrace();
    my .xsaccess file
        "anonymous_connection": "<package name>::incognito",
        "authentication" : null,
        "cors" : [{ "enabled":true }],
        "cache_control" : "must-revalidate",
        "exposed": true
    Then I hit the URL in a web browser to execute this xsjs.
    I looked at the server trace logs by going to location: <servername>:<port>/sap/hana/xs/ide/trace/ and then clicked on both the trc logs corresponding to my server name and tried searching for 'Raghuveer' as a keyword but no result was returned.
    Then I went to <servername>:<port>/sap/hana/xs/security/ to verify my permissions. I am attaching the screenshot of all the permission i have for this user. I have the debugger role assigned also but still i dont see the trace to print anything in the log.
    Could you please suggest what am I missing ?
    Thanks in advance.

  • How to print "selected objects" in InDesign CS4?

    I have a large calendar in ID CS4. I want to print and view some of the text in its actual size. My printer can only print A4 documents. How can I print only selected texts and objects in its actual size in this application?
    Although copying and pasting the text in another A4 sized document (IDCS4) would do it but there is no native support of "printing selection" but Microsoft's "Word' has!

    I think the layer option is best.
    Select what you want then open the layers panel and create a new layer. Select the objects you want to print, then in the layers panel you will see a small square to the right of the layer name. Alt Drag that to the new layer to copy the items, you can then turn off the visibility to the other layer and just print out the new layer.
    Then switch the visibility of the layers around to view the original artwork.

  • How to print script objects?

    Some of the examples supplied as part of LiveCycle have fairly elaborate scripts. Is there a way to print a script out so I can review it?
    Seems like a pretty newbie question, but I seached and didn't find an answer . . . .
    Bill Bain
    Atlanta

    There is nothing provided for that. You could hit Ctrl-A in the editor (which will take all of the script) and copy it a Text Editor ...then print from there.

  • Printing java object in the method

    How to print the object that has called the method in the method itself.
    class abc{
    public method1()
    S.o.p("Print the object that has called this method")
    psvm(string a[])
    abc aa=new abc();
    aa.method1();
    Thanks
    Sir

    Or make a new exception and parse the stack trace.
    This has a performance penalty, though.That wont get the object that's making the call (the 'this' of the method that's making the call), but only the class and the method

  • How to print console output

    Hi, I have a JSP page and I would like to print STDOUT to the page. Is this possible?
    I've seen a few methods and none work for me:
    BufferedReader reader = new BufferedReader(System.out);
    String input = reader.readLine();
    out.println(input);*** Error: Type BufferedReader was not found.
    FileOutputStream out;
                    PrintStream ps; // declare a print stream object
                    try {
                     // Create a new file output stream
                    out = new FileOutputStream("myfile.txt");
                            // Connect print stream to the output stream
                            ps = new PrintStream(out);
                            ps.println ("This data is written to a file:");
                System.err.println ("Write successfully");
                            ps.close();
                    catch (Exception e){
                            System.err.println ("Error in writing to file");
                    }*** Error: Duplicate declaration of local variable "out".
    *** Error: The type of the left-hand side in this assignment, "javax/servlet/jsp/JspWriter", is not compatible with the type of the right-hand side expression, "java/io/FileOutputStream".
    *** Error: No match was found for constructor "PrintStream(javax.servlet.jsp.JspWriter)".
    So what's next?
    How can I call the console without writing to a file first?
    I would like AJAX to show console output in real-time.

    Thanks for your help.
    The reason I have the script to write to a file is because it's the closest I could find to what I want. Ideally, I would be able to run a script that prints to the console but I want to grab the system.out going to the console and display it on the page.
    Basically, I want the page to act as a console but not redirect the output (I want it to still go to the console) and I don't want it in a text file that the page reads.
    So for example, the page loads and while that is occurring, the server grabs the console output and prints to the page. Then I run a function on the page that prints to the console and on the refresh, print the updated output. Ideally, I would restrict the output that was relevant to the page's functions and ignore every output to the console but I'm not (trying to be) picky.
    So how would that work?
    Pseudo-code:
    for (int i=0;i < System.out().length(); i++) {
            String grabbedtext += System.out().toString();
    }out.println(grabbedtext);

  • How to print Integrity sql in the preparedstatement?

    How to print Integrity sql in the preparedstatement?
    Connection conn = null;
    String sql = "select * from person where name=?";
    PreparedStatement ps = conn.prepareStatement(sql);
    ps.setObject(1, "robin");
    ps.executeQuery();
    i'm wants print Integrity sql.
    For example:select * from person where name='robin'
    How should I do?
    thanks a lot!

    PreparedStatement doesn't offer methods for that. You can write your own implementation of PreparedStatement which wraps the originating PreparedStatement and saves the set* values and writes it to the toString().
    If needed, myself I just print the sql as well as the values-being-set to the debug statement.Logger.debug(query + " " + values);

  • How to print the properties in an object

    I have the following method that is meant to print all the details in a hashmap (allStudents). this hashmap contains references to objects of different students.
    what i need is to be able to print each object stored in allStudents, and each of those objects properties....
    Please show me the light!!!
        public void printAllStudents()
        for (Integer eachStudent : allStudents) //for each loop
             System.out.println(eachStudent);// prints out every element in set
        }

    Hi Kaj,
    So when I overide the toString method, and then call
    another method that prints out the contents of the
    objects held a Map, the toString formatted text is
    used? If so.. how does that work?For objects (as opposed to primitives), System.out.println() calls the toString method.

  • How to print an output stream on console.

    Hi,
    I am new to JAVA. I am trying to execute a command in runtime and I want to print the output on console and also redirect the output to a file.
    Could anyone please help me?
    This is what I wrote :
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec("cmd /c ipconfig");I am getting an output stream by : proc.getOutputStream(). I dont know how to print it on console and also how to redirect it to a file.
    Could anyone please help me.
    Thanks in advance.
    Basav

    You can do it this way :-
         public static void main(String args[]) throws Exception {
              ProcessBuilder builder = new ProcessBuilder("ipconfig", "/all");
              Process process = builder.start();
              BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
              FileWriter writer = new FileWriter(new File("C:/ipconfig.txt"));
              String str;
              while ((str = reader.readLine()) != null) {
                   System.out.println(str);
                   writer.write(str + System.getProperty("line.separator"));
              writer.close();
              reader.close();
         }Let me know if it works for you.

  • How to print the receipt details both on the console and on receipt

    Hi All
    In ORPOS, Can anybody know how to print the sale transaction details on receipt and console as well
    After configuring with printer we can print only on receipt, if we want both on receipt and console as well
    Appreciate your suggestions and ideas
    Regards
    Ramakrishna

    Hi Rama
    This would not be any configuration change
    You can print receipt in both pinter and console by adding a sysout just before string is sent for printing
    Regards
    Saurabh
    [email protected]

  • Bought a new Canon MG7540 printer to replace the old HP A618. When printing vector objects from Illustrator, they look like graphics from dandy (8 bits) ... no smooth, all cubes ... if do raster than print perfectly.  Who knows how to treat it? No well to

    Bought a new Canon MG7540 printer to replace the old HP A618. When printing vector objects from Illustrator, they look like graphics from dandy (8 bits) ... no smooth, all cubes ... if do raster than print perfectly.  Who knows how to treat it? No well to rasterize vector before each printing. OS - MacOs 10.10.

    Have you read the User's Guide for that printer?  Odds are you will get reasonable prints.  However, it is a photographic printer.  That said, it should print excellent quality photographic files.  To get smooth lines in Illustrator, try Preferences > Use Anti-Aliased Artwork.  That will smoothen the output.  If, for some reason, that does not work, try Print > Save As PDF > open PDF in Reader and print from there.  Check the User's Guide for media sizes available for your particular printer.  Setup your artboard to the size page you want the image to print on.  Use View > Show Page Tiling ( to see where the page's printable area lies.  Align the page with the artboard using the Page tool.

  • How to print the image data stored in object of 'java.io.File' Class in jsp

    I have created a file object for the image file in the system temporary directory.Now I want to display it in my page. please tell,How to print the image data stored in object(in my program it is imgr) of 'java.io.File' Class in jsp

    Create a servlet which gets an InputStream of the file and writes it to the OutputStream of the response and call this servlet in `src` attribute. That's basically all.
    Here's an example which covers the most of the minimum needs: [http://balusc.blogspot.com/2007/04/imageservlet.html].

  • Please help : How to print a matrix from the console...

    Hi..
    Please help:
    How to print a matrix on the console , but i want to take all the input from the console.. like...
    if the matrix is of size...
    mxn
    where
    m : row
    n : column
    and the all the elements of the matrix from the console it self... .
    Please help...

    Thanks...
    I am able to print the elements of the array but i am not able to assign those values to the array ....
    How to do that...
    I just did a little change in my code...
    import java.util.Scanner;
    public class CreatingAMatrix {
        public static void main(String[] args) {
         // TODO Auto-generated method stub
         System.out.print("Enter the number of rows: ");
         Scanner scanner1 = new Scanner(System.in);
         int m = scanner1.nextInt();
         System.out.print("Enter the number of coulmns:");
         Scanner scanner2 = new Scanner(System.in);
         int n = scanner2.nextInt();
         System.out.println("The size of the matrix is : " +m+" x "+n );
         int[][] a = new int[100][100];
         for(int i=0;i<=m;i++)
             for(int j =0; j <= n; j++)
              Scanner scanner3 = new Scanner(System.in);
              int o = scanner3.nextInt();
             System.out.println();
         for(int i=0;i<=m;i++)
             for(int j =0; j <= n; j++)
              System.out.print(a[i][j] + "\t");
             System.out.println();
    }I am getting an output as this
    output:
    Enter the number of rows: 2
    Enter the number of coulmns:1
    The size of the matrix is : 2 x 1
    1
    2
    1
    2
    3
    5
    0     0     
    0     0     
    0     0     
    how should i assig those input values to my array..
    Please help

  • How to print to console with out using system.out.print

    Hi All
    Is it possible to print the text to console with our using System.out.println(). i done as follows but i does not worked
    import java.io.*;
    import java.util.*;
    public class myclass
         public static void main(String[] args)
              BufferedWriter br = null;
              try {
                   br = new BufferedWriter(new OutputStreamWriter(System.out));
                   br.write("Myclass123",0,10);
              } catch (Exception io) {
                   io.printStackTrace();
    so it will be appretaible if any body helps me in solving this question

    i am using sysstem.out to specify that out put
    generated should be pumped to console inted of file.
    i mean system.out will lead to the console. thats why
    i used that. as Either I have no idea what you are talking about, or you have no idea what I am talking about when I refer to writing to File "con".
    suystem.in means keyboard.Actually, it means "the system's standard input stream, wherever it may come from".

  • How to print/download scorecard,strategic tree,objectives in OBIEE 11g?.

    Hi All,
    Has anyone worked in Scorecards in obiee11g.If yes could you please let me know if is there any way to downloading/printing scorecards,objectives,strategic tree etc?..
    We are in OBIEE 11.1.1.5.0 version.
    Regards,
    Veeresh Rayan

    Hi Dpka,
    I don't see anything like page options button to the left of ? icon.Could you help me in locating that?.Page options is available only to the dashboards but not for scorecard..
    Regards,
    Veeresh Rayan
    Edited by: 937868 on 09-Aug-2012 06:02
    Edited by: 937868 on 09-Aug-2012 06:02

Maybe you are looking for