JDBC equivalent of OracleXMLSave.setDateFormat()?

The Orace XSU class OracleXMLSave has a method setDateFormat().
How can I accomplish the equivalent in JDBC?
The NSL_DATE_FORMAT of my server "RRRR-MM-DD HH24:mm:ss"
I have a bunch of ASCII files I'm trying to load which have "MM/DD/YYYY" format.
In PL/SQL and/or Oracle XSU I just set the date format and then execute something like
insert into myfile columns ( mydatecol ) values '01/01/1999' )
However, when using JDBC I haven't figured out how to set the date format for the session/connection/whatever globally.
I know I can use JDBC date escaping BUT that requires I know which columns are dates. If I can just set the format for the session to match the load file I only have to provide columns names and values (as strings).
R.Parr
Temporal Arts

None by default.
You could use REF CURSOR as an OUT parameter of a stored procedureCREATE OR REPLACE PACKAGE myPkgGetCursor IS
    TYPE recSet IS REF CURSOR;
    PROCEDURE getList( recList  OUT  recSet, param1  IN NUMBER);
END myPkgGetCursor;
CREATE OR REPLACE PACKAGE BODY myPkgGetCursor AS
    PROCEDURE getList( recList  OUT  recSet, param1  IN NUMBER) IS
    BEGIN
        OPEN recList FOR <queryStatement>;
    END getList;
END myPkgGetCursor;Use CallableStatement and specify myPkgGetCursor.getList

Similar Messages

  • OCI provides function oerhms. What is the JDBC equivalent?

    How can I get the complete Oracle error message, not just the terse one?

    None by default.
    You could use REF CURSOR as an OUT parameter of a stored procedureCREATE OR REPLACE PACKAGE myPkgGetCursor IS
        TYPE recSet IS REF CURSOR;
        PROCEDURE getList( recList  OUT  recSet, param1  IN NUMBER);
    END myPkgGetCursor;
    CREATE OR REPLACE PACKAGE BODY myPkgGetCursor AS
        PROCEDURE getList( recList  OUT  recSet, param1  IN NUMBER) IS
        BEGIN
            OPEN recList FOR <queryStatement>;
        END getList;
    END myPkgGetCursor;Use CallableStatement and specify myPkgGetCursor.getList

  • Sqlca equivalent in JDBC

    Does anyone know of a JDBC equivalent to the ProC structure called SQLCA?
    I miss the status code and rows inserted/returned information.
    Thanks,
    Bob Scharping
    null

    I seriously doubt adUseClient causes the client to execute SQL. These:
    http://dev.mysql.com/tech-resources/articles/vb-cursors-and-locks.html
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdcstcursorlocationenum.aspcause me to think it's more like CachedRowSet, though I'm not sure.
    That's the way database servers work: they execute SQL. The client can't execute the query because it doesn't have the database's tables or indexes. If it had those ...well, it would be the server then.
    Optimize your query. Index it. Myself, I'd run away screaming if I had a 50+ -join query. Or I'd try very hard to refactor the query - separate selects, client side data caching, ... And get a database that doesn't hang, they aren't supposed to do that(!!)

  • Retrieve new row's auto-increment key from dataprovider

    ** cross posted on SDN JSC Forum and Netbeans J2EE Nabble forum **
    I have a page that is bound to a MySQL table rowset or, alternately, a new (append()'ed) row. The row's Primary Key is a MySQL auto-increment Integer (translates to a Long.) After commit()'ing the the new row to the database, how would I then get the new row's ID (fieldname "ID")? If I refresh() the dataprovider and try to get the value an error is thrown.
    Some background: The dataprovider's backing rowset has a query parameter for the ID field. I set it to "0" if the page is creating a new row or I set it to the unique ID if the page is displaying an existing row. After the new row is committed, I need the new ID set the query parameter and synch up related rows in different tables that are keyed off the ID in this (master) table. I'd like to do this without "guessing" what the ID would be in advance as that method isn't foolproof in heavy usage.
    Additionally, it strikes me as a useful workaround if the unique ID was a UUID (mySQL UUID() function) that does not run the risk of any concurrency issues. Has anyone used this solution in VWP? How would I make the call for the underying DB (in this case MySQL, but could be anything) to generate the UUID? Is the call DB specific or is there a JDBC equivalent?
    UPDATE: never mind the GUID question, I can use the java.rmi.dgc.VMID class to autogenerate unique GUID's for this purpose. Being from a Lotus Notes background, I'm used to the power and flexibility such Unique ID's bring to the app. dev's portfolio.
    Thanks in adv. for any help .
    -Jake
    Message was edited by:
    jakeochs

    JSF together with JBoss Seam offers some real good possibilities to improve developer productivity. Right now, with JSF you can create forms where fields are persistent (saved in a database), but you have to write code to persist fields. In Notes/Domino, every field you drop in the form is automatically set to persist without writing a single piece of code. JBoss Seam aims to provide the missing glue to tie the JSF beans with business logic (EJB) and persistent layer (JPA). I think tools for Seam are still not mature. I would love to see JSC/VWB utilizing Seam. I know there is a NetBean plugin for Seam but it was written for old NetBeans (not VWP or JSC), so it doesn't work with the visual web pack where you can drag and drop JSF components.

  • Oracle portal develpment kit

    Hi every one,
    where can i find the documentation for oracle pdk.
    What are the basic requirements for learning oracle pdk.?
    please suggest me the ways of learning oracle pdk
    Thanks,
    raghav

    In the XML SQL Utility...
    -> OracleXMLQuery works with any JDBC Driver.
    -> OracleXMLSave works only with OracleDriver at present.
    So you can do SQL->XML anywhere, but
    XML->INSERT only on Oracle.

  • Does JDBC have an equivalent to the ADO GetRows method?

    In ADO you can retreive multiple rows at a time use the GetRows method. Is there any way with JDBC to retrieve multiple rows at a time?

    Well, the exact specifics of how the driver works are a little beyond my vision, but here's how I understand it. A stream is like a pipeline. When you make the query the databases begins pushing rows onto the pipeline at a predetermined rate (ie. n at a time).
    As long as you keep reading them with next(), the database keeps pushing more on until there are none left, or until you stop reading them. I think this is the premise behind the traditional database cursor as well. You didn't get the million, you got the first few of the million.
    The efficiency comes because if you get what you need after say twelve rows, you stop calling next. Without calling next, the database stops pushing more "reads" into the pipeline (or stream). This is why its nice to close the result set if you are done with it... it tells the database to stop sitting there waiting to push more rows along the stream.
    ADO does force the database to read all million. JDBC starts reading the million, and if you're done after twelve then the database only read twelve ...plus a few extra left on the stream ... but certainly nowhere near the whole million. Make sense? This is why Oracle, for instance, cannot tell you how many rows are held in a table unless you force it using the count aggregate. Oracle says "if you wanna know ...count em yourself!"
    I hope I have the concepts right here... anyone else is welcome to add their input.
    GumB.

  • Help: Connecting Tomcat to CA-IDMS Using JDBC Type 4 Drivers (JNDI)

    Hi there,
    I have a rather interesting / complex problem......creating a connection to CA-IDMS from Tomcat using JDBC type 4 drivers (CA provide the type 4 driver).
    We have a zSeries 9 IBM mainframe running CA-IDMS r16.1, and I need to connect to the IDMS from Tomcat (running on Linux) using the JDBC Type 4 drivers provided by CA.
    At this stage I am struggling with the actual setup and configuration of Tomcat’s server.xml and web.xml files. These are the files where the JDBC configuration is set (I think). I have to setup the CA-IDMS part of the configuration, but that is a different problem. Basically there is a TCP/IP listener on the IDMS, waiting for incoming connections from the JDBC type 4 driver.
    I set up a Tomcat to MySQL connection using MySQL Connector / J, which is a similar kind of process to what I am trying to achieve with IDMS. MySQL connector / J came with a jar file which is placed in Tomcat’s lib folder, and then the JDBC setup for the web application is created in Tomcat's server.xml and web.xml files. You can then connect to the MySQL database using JSP and the configured JDBC driver / connection. The CA-IDMS Server comes with an idmsjdbc.jar file, which I think is the JDBC typr 4 driver. I think it needs to be placed in the Tomcat /lib folder, but I don’t know how to set up the configuration.
    There is a JDBC DriverManager which allows JDBC drivers to connect to CA-IDMS. The DriverManager recognises the following syntax:
    jdbc:idms://hostname:port/database
    This allows the JDBC driver running within Tomcat to connect to the IDMS which is running on the IDM mainframe. CA IDMS r16 supports direct connections from the Type 4 JDBC driver to the Central Version on IDMS. "hostname" is the DNS name or IP address of the machine where the CV is running, and "port" is the IP port that was specified for the listener PTERM (setup on the IDMS side).
    There is a caidms.properties file for the JDBC driver, which is used to specify user ID, password, and optional accounting information. It can also be used to specify physical connection information, allowing an application to connect to a CA-IDMS database without requiring the definition of an ODBC style data source. However, I don’t know where to place this file within the Tomcat setup.
    There is also an IdmsDataSource class. I don’t know where to configure this or how to set it up; the CA-IDMS Server manual states the following:
    This class implements the JDBC DataSource interface. It is used with an application server (Tomcat) providing Java Naming and Directory Interface (JNDI) naming service to establish a connection to a CA IDMS database. IdmsDataSource properties conform to the Java Beans naming conventions and are implicitly defined by public “setter” and “getter” methods. For example, the “description” property, which is required for all DataSource implementations, is set using the setDescription(String) method. The application server may use the java.lang.reflection methods to discover DataSource properties and provide an interface to set them, or may simply require that they are defined in some configuration file. IdmsDataSource properties are used to specify the connection parameters. These properties are the equivalent of the DriverPropertyInfo attributes described in the previous section and can be used to completely define the parameters needed to connect to a database. Like a URL, an IdmsDataSource object can also reference an “ODBC” style data source name, where the connection parameters are defined in the configuration file on Linux.
    Is there anyone that can try to point me in the right direction to setting up the JDBC connection? I am totally new to Java and so the instructions are not making much sense at the moment. Any help, hints, tips…..anything will be greatly appreciated as I have just hit a brick wall here. I can't find much to do with setting up the CA-IDMS Server JDBC type 4 driver online either....if anyone can point me to some resources that would also be extremely useful.
    Kind regards
    Jp

    You say you've managed to get the JDBC driver working
    in an application but not in a JSP. You also say that
    the error you get is
    "com.microsoft.jdbc.sqlserver.SQLServerDriver".
    I'd be willing to bet that the exception that you have
    got is a ClassNotFoundException. I.E. your application
    server hasn't found the JDBC driver classes. The
    application server probably doesn't use your current
    CLASSPATH to look for classes. It will be setup within
    the application server in some way and you'll need to
    check your app server documentation to see how it is
    done.
    Try replacing
    e.printStackTrace();with
    e.printStackTrace(out);to get a full stack trace of your error.
    ColTried it. Got this error when I tried to run the JSP.
    Incompatible type for method. Can't convert javax.servlet.jsp.JspWriter to java.io.PrintWriter.
              e.printStackTrace(out);
    I'm currently using Apache Tomcat 4.0.3 as my JSP/Servlet Container.
    I'm also using Type 4 MS SQL Server 2000 JDBC driver version 2.0 on my NT4.0 Server.
    Do I need to set my JDBC driver in my container? if so, how do I do that?

  • What is equivalent of JInternalFrame in JavaFX 2.0?

    what is equivalent of JInternalFrame in JavaFX 2.0?
    Actually I want to use pure javaFX 2.0 to view report created in iReport 5.0.0.
    I have used java.swing code, and now I want to use pure javaFX 2.0.
    My code in swing is as follows
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package reports;
    import java.awt.BorderLayout;
    import java.awt.Container;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import java.util.HashMap;
    import net.sf.jasperreports.engine.JRException;
    import net.sf.jasperreports.engine.JasperFillManager;
    import net.sf.jasperreports.engine.JasperPrint;
    import net.sf.jasperreports.view.JRViewer;
    * @author TANVIR AHMED
    public class ReportsViewer extends javax.swing.JInternalFrame {
    * Creates new form MyiReportViewer
    private ReportsViewer()
    super("Report Viewer",true,true,true,true);
    initComponents();
    setBounds(10,10,600,500);
    setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    public ReportsViewer(String fileName)
    this(fileName,null);
    public ReportsViewer(String fileName,HashMap parameter)
    this();
    try
    /* load the required JDBC driver and create the connection
    here JDBC Type Four Driver for MySQL is used*/
    //Class.forName("com.mysql.jdbc.Driver");
    Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE", "invoice", "item");
    //Connection con=DriverManager.getConnection("jdbc:mysql://localhost/inventory","root","karim");
    /*(Here the parameter file should be in .jasper extension
    i.e., the compiled report)*/
    JasperPrint print = JasperFillManager.fillReport(
    fileName, parameter, con);
    JRViewer viewer=new JRViewer(print);
    Container c=getContentPane();
    c.setLayout(new BorderLayout());
    c.add(viewer);
    catch(SQLException sqle)
    sqle.printStackTrace();
    catch(JRException jre)
    jre.printStackTrace();
    * This method is called from within the constructor to initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is always
    * regenerated by the Form Editor.
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {
    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGap(0, 394, Short.MAX_VALUE)
    layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGap(0, 290, Short.MAX_VALUE)
    pack();
    }// </editor-fold>
    // Variables declaration - do not modify
    // End of variables declaration
    and
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package reports;
    import java.beans.PropertyVetoException;
    * @author TANVIR AHMED
    public class MainUI extends javax.swing.JFrame {
    * Creates new form MainUI
    public MainUI() {
    super("REPORTS");
    initComponents();
    setSize(java.awt.Toolkit.getDefaultToolkit().getScreenSize());
    setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {
    jMenuItem1 = new javax.swing.JMenuItem();
    desktopPane = new javax.swing.JDesktopPane();
    salesTaxInv = new javax.swing.JButton();
    jLabel1 = new javax.swing.JLabel();
    supplyRegister = new javax.swing.JButton();
    PartyLedger = new javax.swing.JButton();
    menuBar = new javax.swing.JMenuBar();
    jMenuItem1.setText("jMenuItem1");
    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    desktopPane.setBackground(new java.awt.Color(255, 204, 0));
    desktopPane.setBorder(new javax.swing.border.MatteBorder(null));
    desktopPane.setForeground(new java.awt.Color(255, 0, 102));
    desktopPane.setAutoscrolls(true);
    desktopPane.setFont(new java.awt.Font("Bookman Old Style", 0, 14)); // NOI18N
    desktopPane.setPreferredSize(new java.awt.Dimension(1024, 768));
    salesTaxInv.setBackground(new java.awt.Color(255, 255, 255));
    salesTaxInv.setFont(new java.awt.Font("Bookman Old Style", 1, 18)); // NOI18N
    salesTaxInv.setForeground(new java.awt.Color(204, 0, 0));
    salesTaxInv.setText("Sales Tax Invoice");
    salesTaxInv.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    salesTaxInvActionPerformed(evt);
    salesTaxInv.setBounds(20, 53, 200, 31);
    desktopPane.add(salesTaxInv, javax.swing.JLayeredPane.DEFAULT_LAYER);
    jLabel1.setFont(new java.awt.Font("Bookman Old Style", 0, 24)); // NOI18N
    jLabel1.setForeground(new java.awt.Color(50, 72, 255));
    jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jLabel1.setText("Invoice System Reports");
    jLabel1.setBounds(0, -1, 1024, 50);
    desktopPane.add(jLabel1, javax.swing.JLayeredPane.DEFAULT_LAYER);
    supplyRegister.setFont(new java.awt.Font("Bookman Old Style", 1, 18)); // NOI18N
    supplyRegister.setForeground(new java.awt.Color(204, 0, 0));
    supplyRegister.setText("Supply Register");
    supplyRegister.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    supplyRegisterActionPerformed(evt);
    supplyRegister.setBounds(20, 100, 200, 30);
    desktopPane.add(supplyRegister, javax.swing.JLayeredPane.DEFAULT_LAYER);
    PartyLedger.setFont(new java.awt.Font("Bookman Old Style", 1, 18)); // NOI18N
    PartyLedger.setForeground(new java.awt.Color(204, 0, 0));
    PartyLedger.setText("Party Ledger");
    PartyLedger.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    PartyLedgerActionPerformed(evt);
    PartyLedger.setBounds(20, 140, 200, 30);
    desktopPane.add(PartyLedger, javax.swing.JLayeredPane.DEFAULT_LAYER);
    setJMenuBar(menuBar);
    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(desktopPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(desktopPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    pack();
    }// </editor-fold>
    private void salesTaxInvActionPerformed(java.awt.event.ActionEvent evt) {                                           
    try
    ReportsViewer myiReportViewer = new ReportsViewer("reports/INV.jasper");
    myiReportViewer.setBounds(0, 0, desktopPane.getWidth(), desktopPane.getHeight());
    myiReportViewer.setVisible(true);
    desktopPane.add(myiReportViewer);
    myiReportViewer.setSelected(true);
    catch (PropertyVetoException pve)
    pve.printStackTrace();
    private void supplyRegisterActionPerformed(java.awt.event.ActionEvent evt) {                                              
    try
    ReportsViewer myiReportViewer = new ReportsViewer("reports/supplyRegister.jasper");
    myiReportViewer.setBounds(0, 0, desktopPane.getWidth(), desktopPane.getHeight());
    myiReportViewer.setVisible(true);
    desktopPane.add(myiReportViewer);
    myiReportViewer.setSelected(true);
    catch (PropertyVetoException pve)
    pve.printStackTrace();
    private void PartyLedgerActionPerformed(java.awt.event.ActionEvent evt) {                                           
    try
    ReportsViewer myiReportViewer = new ReportsViewer("reports/CustomerLedger.jasper");
    myiReportViewer.setBounds(0, 0, desktopPane.getWidth(), desktopPane.getHeight());
    myiReportViewer.setVisible(true);
    desktopPane.add(myiReportViewer);
    myiReportViewer.setSelected(true);
    catch (PropertyVetoException pve)
    pve.printStackTrace();
    * @param args the command line arguments
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new MainUI().setVisible(true);
    // Variables declaration - do not modify
    private javax.swing.JButton PartyLedger;
    private javax.swing.JDesktopPane desktopPane;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.JButton salesTaxInv;
    private javax.swing.JButton supplyRegister;
    // End of variables declaration
    Best Regards

    Dear Sir,
    I am using the swing code and running the jasper report with the above code.
    Realy!
    I start the thread with this code
    @FXML
    private void mainUiButtonAction(ActionEvent event) {
    try{
    new MainUI().setVisible(true);
    catch(Exception ex){                 
    }

  • Bug in Oracle JDBC thin driver (parameter order)

    [ I'd preferably send this to some Oracle support email but I
    can't find any on both www.oracle.com and www.technet.com. ]
    The following program illustrates bug I found in JDBC Oracle thin
    driver.
    * Synopsis:
    The parameters of prepared statement (I tested SELECT's and
    UPDATE's) are bound in the reverse order.
    If one do:
    PreparedStatement p = connection.prepareStatement(
    "SELECT field FROM table WHERE first = ? and second = ?");
    and then bind parameter 1 to "a" and parameter to "b":
    p.setString(1, "a");
    p.setString(2, "b");
    then executing p yields the same results as executing
    SELECT field FROM table WHERE first = "b" and second = "a"
    although it should be equivalent to
    SELECT field FROM table WHERE first = "a" and second = "b"
    The bug is present only in "thin" Oracle JDBC driver. Changing
    driver to "oci8" solves the problem.
    * Version and platform info:
    I detected the bug using Oracle 8.0.5 server for Linux.
    According to $ORACLE_HOME/jdbc/README.doc that is
    Oracle JDBC Drivers release 8.0.5.0.0 (Production Release)
    * The program below:
    The program below illustrates the bug by creating dummy two
    column table, inserting the row into it and then selecting
    the contents using prepared statement. Those operations
    are performed on both good (oci8) and bad (thin) connections,
    the results can be compared.
    You may need to change SID, listener port and account data
    in getConnecton calls.
    Sample program output:
    $ javac ShowBug.java; java ShowBug
    Output for both connections should be the same
    --------------- thin Driver ---------------
    [ Non parametrized query: ]
    aaa
    [ The same - parametrized (should give one row): ]
    [ The same - with buggy reversed order (should give no answers):
    aaa
    --------------- oci8 driver ---------------
    [ Non parametrized query: ]
    aaa
    [ The same - parametrized (should give one row): ]
    aaa
    [ The same - with buggy reversed order (should give no answers):
    --------------- The end ---------------
    * The program itself
    import java.sql.*;
    class ShowBug
    public static void main (String args [])
    throws SQLException
    // Load the Oracle JDBC driver
    DriverManager.registerDriver(new
    oracle.jdbc.driver.OracleDriver());
    System.out.println("Output for both connections should be the
    same");
    Connection buggyConnection
    = DriverManager.getConnection
    ("jdbc:oracle:thin:@localhost:1521:ORACLE",
    "scott", "tiger");
    process("thin Driver", buggyConnection);
    Connection goodConnection
    = DriverManager.getConnection ("jdbc:oracle:oci8:",
    "scott", "tiger");
    process("oci8 driver", goodConnection);
    System.out.println("--------------- The end ---------------");
    public static void process(String title, Connection conn)
    throws SQLException
    System.out.println("--------------- " + title + "
    Statement stmt = conn.createStatement ();
    stmt.execute(
    "CREATE TABLE bug (id VARCHAR(10), val VARCHAR(10))");
    stmt.executeUpdate(
    "INSERT INTO bug VALUES('aaa', 'bbb')");
    System.out.println("[ Non parametrized query: ]");
    ResultSet rset = stmt.executeQuery(
    "select id from bug where id = 'aaa' and val = 'bbb'");
    while (rset.next ())
    System.out.println (rset.getString (1));
    System.out.println("[ The same - parametrized (should give one
    row): ]");
    PreparedStatement prep = conn.prepareStatement(
    "select id from bug where id = ? and val = ?");
    prep.setString(1, "aaa");
    prep.setString(2, "bbb");
    rset = prep.executeQuery();
    while (rset.next ())
    System.out.println (rset.getString (1));
    System.out.println("[ The same - with buggy reversed order
    (should give no answers): ]");
    prep = conn.prepareStatement(
    "select id from bug where id = ? and val = ?");
    prep.setString(1, "bbb");
    prep.setString(2, "aaa");
    rset = prep.executeQuery();
    while (rset.next ())
    System.out.println (rset.getString (1));
    stmt.execute("DROP TABLE bug");
    null

    Horea
    In the ejb-jar.xml, in the method a cursor is closed, set <trans-attribute>
    to "Never".
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name></ejb-name>
    <method-name></method-name>
    </method>
    <trans-attribute>Never</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    Deepak
    Horea Raducan wrote:
    Is there a known bug in Oracle JDBC thin driver version 8.1.6 that would
    prevent it from closing the open cursors ?
    Thank you,
    Horea

  • JDBC to access SQL server 2000 and Oracle.

    hi,
    I have the following requirement. I have an oracle database which contain sql data including BLOB and CLOB. Firstly, I should migrate the data to a SQL server 2000 database. That is, i should be able to have two databases, one on oracle and the other on sql server 2000. the two databases should contain the same data, which includes BLOB data. I guess, sql server 2000 does not have a BLOB data type. What is the equivalent data type i can use to save the Oracle's BLOB data in SQL server?? Should it be image type?
    After i migrate the data to the sql server 2000 database, i should be able to connect to the two databases, oracle and sql server 2000, using the same JDBC code to retrieve, insert, update and delete the data. What are the drivers that i should use. I guess, the MS JDBC driver does not support BLOB and CLOB. Is there a driver that can support BLOB for sql server 2000 and is also free???!
    Kindly help... Thanks.
    Arthi.

    Hi,
    I am new to jdbc... so, pls forgive my ignorance...
    I shall try to map a BLOB data column in oracle to an IMAGE data column in sql server 2000. I am using oracle jdbc driver and microsoft's jdbc driver for connecting to the databases.
    My question is, can i use setBlob() method in the preparedstatement in jdbc code for setting data to the sql server 2000 image column?
    rs.getBlob() and preparedstatement.setBlob()code works fine for oralce's BLOB column using oracle's jdbc driver.... Will the same jdbc code work for sql server 2000's image column using microsoft's jdbc driver??
    Kindly help.
    Arthi.

  • We get "uFF06uFF03x0;" from sender JDBC adapter

    Thank you.
    This is naoki kurihara.
    We have a problem in sender JDBC adapter.
    We use java mapping and sender JDBC adapter in PI7.1 on Windows.(DB is sqlserver)
    and we test the interface and we found error.
    the reason is to get "&#x0;" from JDBC adapter.
    and our java mapping can't parse it. and we got error.
    the column is not null.
    how we can prevent "&#x0;",
    (sorry I cant write "&#" 1byte word, so I wrote 2bytes word)
    please give me your help!!
    Thanks

    Hi,
    Replace the & character with &amp ; in your java mapping. The same goes for these special characters:
    < with &lt ;
    > with &gt ;
    " with &quot ;
    ' with &apos ;
    Please remove the space between the escape character and the ; in your Java mapping. The spaces are typed here because the equivalent characters are not displaying correctly.
    It should be able to handle the # though. Hope this helps
    Regards,
    Mark

  • Error: Unparseable date with OracleXMLSave

    Hi,
    Error:
    oracle.xml.sql.OracleXMLSQLException: java.text.ParseException: Unparseable date: "03/18/2099"
    int oracle.xml.sql.dml.OracleXMLSave.insertXML(org.w3c.dom.Document)
    void b2b.RcvQueueListener.saveCsmToTso(oracle.xml.parser.v2.XMLDocument)
    void b2b.RcvQueueListener.<init>()
    void b2b.RcvQueueListener.main(java.lang.String[])
    I've tried to save a row in the database with OracleXMLSave:
    I use JDeveloper 3.1.1.2 with XDK 2.? and a local Oracle 8.1.6 unde NT.
    // XML Doc:
    <ROWSET>
    <ROW NUM="1">
    <CSM_NO>A29912</CSM_NO>
    <CRE_DAY_CSM>03/18/2099</CRE_DAY_CSM>
    <CSM_VOL_GRO_FRZ>59.89</CSM_VOL_GRO_FRZ>
    </ROW>
    </ROWSET>
    // Set java enviroment:
    Locale.setDefault(java.util.Locale.US);
    // Save Data with XSU like:
    OracleXMLSave sav =
    new OracleXMLSave(cn.getConnection(), "consignment_t");
    sav.insertXML(csmData);
    Same Error when trying to...
    (1) set date format for OracleXMLSave:
    > sav.setDateFormat("DD/MM/YYYYY");
    (2) set database parameter:
    > nls_date_format='DD/MM/YYYY';
    > nls_language='AMERICAN';
    (3) set registry (winnt)
    > nls_lang=AMERICAN_AMERICA.WEISO8859P1
    Help would be appreciated.
    Thanks in advance!
    Matthias.

    setDateFormat() is expecting a format mask that is valid for the java.text.SimpleDateFormat object.
    So, just do:
    setDateFormat("d/M/yyyy");
    null

  • Stored Procedure issue in receiver JDBC synchronous scenario

    Dear Experts,
    Below is the description of the Stored Procedure for my requirement which has 1 input and 7 output.
    CREATE OR REPLACE PROCEDURE emp_det_proc
        p_emp_id IN NUMBER,
        cur_det OUT sys_refCURSOR
    aS
    BEGIN
        OPEN cur_det FOR
        SELECT * FROM EMP_PERSON_VIEW
            WHERE id = p_emp_id;
    END emp_det_proc;
    Inside the procedure , we can see that Select query is done on a VIEW which has some 7 column and these are the output. The data type description of the ID is VARCHAR2 in Oracle Database 11g VIEW, that's why I maintained VARCHAR in Constant mapping at SAP-PI side.
    I am maintaining all the column name present in the view for my JDBC request structure with isOutput and type.
    Below is my JDBC request.
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MT_ECCJDBC_EmpStrdProc_JDBCReq xmlns:ns0="urn:empdet:sap:jdbc:storedprocedure"> 
    - <Statement> 
    - <emp_det_proc action="EXECUTE"> 
    <table>emp_det_proc</table> 
    <ID isInput="true" type="VARCHAR">200178</ID> 
    </emp_det_proc>
    </Statement>
    </ns0:MT_ECCJDBC_EMPStrdProc_JDBCReq>
    I tested with other XSD type like INT/CHAR/ but with the same error.
    Unable to execute statement for table or stored procedure. 'emp_det_proc' (Structure 'Statement') due to java.sql.SQLException: ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'EMP_DET_PROC'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    1. I observed that the Key field ID is maintained as NUMBER in Stored Procedure but in the VIEW it is maintained as VARCHAR2.
    Could anyone help me to solve the issue  with any suggestions?
    Regards
    Rebecca

    Dear Ramesh,
    There are change in the datatype of the Stored Procedure Input parameter. Below is the correct procedure description now.
    Select query of the View
    My JDBC structure
    Observation and querry:
    1. In the SP declaration, there is 1 IN parameter which I have  created in JDBC structure as p_moi_id and gave the type as INTEGER.
    Error : JDBC message processing failed; reason Error processing request in sax parser: Error when executing statement for table/stored proc. 'moi_det_proc' (structure 'Statement'): java.lang.NumberFormatException: For input string: "2*********&49"
    I assume since the range of the number is limited . Integers are values up to 2147483647 and the number I am using is greater than this values.
    2. I assume I have not included the parameter cur_det as OUT. Instead I have maintained the COLUMN names of Select query of the view. Should I remove all the Out parameters which represents inside the View.
    3. What could be the Data type equivalent to Oracle sys_refCURSOR in SAP PI?
    Please share you suggestion.
    Regards
    Rebecca

  • Urg:Executing SQL From Java App using Jdbc Driver

    Hi
    I am using JDBC Driver version 9.0.1.1.0.
    I am running this in Thin Client Mode
    My Code Snippet Looks Like This:=
    ==========================================================
    String url = "jdbc:oracle:thin:@localhost:1521:VpDb";
    String userName = "scott";
    String password = "tiger";
    Connection conn = null ;
    Statement st = null ;
    ResultSet rs = null ;
    String categoryCode="ABC";
    try
    conn = DriverManager.getConnection (url, userName, password);
    st = conn.createStatement ();
    String sqlStatement = "Select Count(*) From News Where CategoryCode=" +"\'" + categoryCode + "\'" + ";";
    System.out.println(sqlStatement);
    rs = st.executeQuery ( sqlStatement );
    if( rs.next() )
    System.out.println("Headline Exists");
    else
    System.out.println("No Headline Exists");
    catch (SQLException e )
    System.out.println();
    System.out.println (" SQL ERROR IN IS_NEWS_EMPTY: " + e) ;
    =========================================================
    I have added the classes12.zip and nls_charset12.zip in the classpath.
    Now when i run this it gives me an error saying the following error message:-
    SQL ERROR IN IS_NEWS_EMPTY: java.sql.SQLException: ORA-00911: invalid character
    Can anyone help me with this as to whats going wrong because the exact equivalent of my sqlStamenet runs on SQL command line but not from java code.Why??
    Any Help appreciated
    Thanks
    Mum

    I think it is complaining about the ";" that you add at the end of your string. You don't need to add that to the query.

  • Configuring RAC-aware JDBC connection in Oracle SQL Developer?

    How can Oracle SQL Developer be configured to properly connect to an [Oracle RAC|http://en.wikipedia.org/wiki/Oracle_RAC] environment, I.E., not just setup to always connect to one of the individual nodes?
    [http://programmersjournal.blogspot.com/2008/08/jdbc-connection-string-for-oracle-rac.html] has an example of a classic and the equivalent RAC-aware version of a JDBC connection string. I've already been using a RAC connection string of the same format from within custom Java applications without issue. I thought the same should be configurable in Oracle SQL Developer by setting the "Connection Type" drop-down to "Advanced", then entering the RAC-aware JDBC connection string as the "Custom JDBC URL". However, upon testing the connection, the following error is displayed at the bottom of the dialog:
    Status : Failure -Test failed: Io exception: NL Exception was generated
    There is no additional information shown on the "Logging Page" view. Using Oracle SQL Developer 1.5.5.
    Thanks!

    Thanks, Barry. Just F.Y.I., it is working for me now that I upgraded to the 2.1 EA as -K- suggested. I had marked his reply as "Correct", but probably should have left a response indicating my success as well.
    Now, if there's anything you could do regarding the [issues around the display performance of CLOBs, etc., in the Query Result view|http://forums.oracle.com/forums/message.jspa?messageID=3906571] , it'd be very appreciated!

Maybe you are looking for

  • New hard drive failed verification/repair

    After my hard drive in my 2013 MacBook Pro suffered damage, I replaced it with "WDC WD5000BPKX-00HPJT0 Media." I formatted the hard drive with a partition. However, after several attempts to reinstall the OS X, it still failed. I tried to verify and

  • Apple's xpress port has a problem with Apogee mobile card...

    Who can I speak with about this problem? I tried here, I tried Apple support ? Nobody can answer my question about this problem? I purchased a new MacBook Pro in January to use with Apogee mobile card but the xpress port in MacBook Pro has a major pr

  • Labview data collection and storage?

    for a complete labview beginner, what is the best way to collect data from hardware connected by rs-422 serial port? Solved! Go to Solution.

  • Error when looping over list

    Looping over a series of lists created from form fields generates an error when one of the fields on the form has been left blank. The form is a list of event dates, start times and end times. One event can have a number of times. When the end time i

  • Proxy server preventing download of trials?

    The company I work for has a proxy server in place and this is preventing us downloading the Creative Cloud Trial.  Adobe's answer is for us to go off network or disable our proxy server!  Has anyone else experienced this problem and if so what is th