Cast ResultSet to Sybase SybResultSet Error

Hi:
I'm using weblogic 7.0 and In Connection Pools: I set the driver is com.sybase.jdbc2.jdbc.SybDriver.
The pool is working.
I try to upload the image file and save it to the sybase database. I took the
sample TextPointers.java from weblogic/.../sample2/. Whenever I try to following
line I get exception.
from weblogic.jdbc.rmi.SerialResultSet
SybResultSet rs = (SybResultSet) stmt.executeQuery(getText);
What is the different between the two drivers:
com.sybase.jdbc2.jdbc.SybDriver and
com.sybase.jdbc.SybDriver
Thanks,
Hellen.

Joseph Weinstein <[email protected]_this> wrote:
>
>
Hellen wrote:
Yes, I need use non standard - jdbc call. after get the ResultSet nextI need to
do is:
TextPointer tp = rs.getSybTextPointer(1);
tp.sendData(file, false); // send the image file to sybase server.
The actully code is runing on the weblogic server side.Ok. What version of the server are you running? If you must use a non-standard
JDBC method to do your work, you may have to obtain a link to the underlying
vendor's connection to make the statement and run the query. This ability
to
access the vandor connection is available in the latest SPs of the more
recent
server versions.
JoeThe server is 7.0 with SP2. Could you give me an example how to obtain a link
to the underlying vendor's connection if I take the connection from connection
pool which setup on the server side.
>
>>
>>
Thanks,
Hellen
Joseph Weinstein <[email protected]_this> wrote:
Hellen wrote:
Hi:
I'm using weblogic 7.0 and In Connection Pools: I set the driver
is
com.sybase.jdbc2.jdbc.SybDriver.
The pool is working.
I try to upload the image file and save it to the sybase database.I took the
sample TextPointers.java from weblogic/.../sample2/. Whenever I
try
to following
line I get exception.
from weblogic.jdbc.rmi.SerialResultSet
SybResultSet rs = (SybResultSet) stmt.executeQuery(getText);Hi.Unless you need to make some sybase-specific extra method, thereis
no]reason for you to try to
cast the java.sql.ResultSet you are getting. ie: Just do:
ResultSet rs = stmt.executeQuery(getText);
If there is a non-standard JDBC call required, we will have to dosomething
else.
Where is this code running? In the server or in an external client?
What is the different between the two drivers:
com.sybase.jdbc2.jdbc.SybDriver and
com.sybase.jdbc.SybDriverDunno.... There should be no reason for you to care... I just examined
their public
face, and there were no important differences:
public static final int DEFAULT_DRIVER_VERSION = 5;
Thanks,
Hellen.The sybase driver mutates quicker than our releases, so I highly recommend
you download
sybase's latest EBF version of their driver and install/use it asopposed
to the older one we
packaged (which was the latest when the package was defined)...
Joe

Similar Messages

  • Sybase Connection Error - cannot establish database connection

    BO Data Services Tool -> Creation of new Data Store -> Sybase ASE
    When I tried to create a sybase datastore(New connection), I've got this error message. But I am able to connect to sybase database with client application with same connection parameter. I appreciate if someone come across same issue.
    ERROR MESSAGE
    *WARNING: Cannot establish database connecton.
    u2018Sybase connecton error: <Sybase ASE Server message number <1640> State <2> Severity <16> From Server <tstlS03>: Message Text is:
    Adaptve Server requires encrypton of the login password on the network.
    Sybase ASE Server message number <4002> State <1> Severity <14> From Server <tstlSO3>: Message Text is: Login failed.
    Sybase CS Library message number <6717S468> Severity <4>: Message Text is: ct_connectO: protocol specific layer: external error: The attempt to connect to the server failed.>.u2019 lODI- 1111341)

    I tried to create repositories for sybase, it failed.  But it succeeded when created datastore.  The procedures's as follow:
    1. Create ODBC for this sybase connection, and it should display "Connection successful" when you click "Test connection".
       (you need to specify several parameters like user id & password, server,database name and file, etc.)
    2. Create datastore by using ODBC connection.

  • Trying to find ResultSet empty or not - Error - please help

    Purpose of the code : I am trying to see if the customer or user is in the database.
    Error : Cannote convert boolean to resultset
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
         pageEncoding="ISO-8859-1"%>
    <%@page import="java.sql.*"%><%@page import = "java.sql.ResultSet"  %>
    <%@page import = "java.sql.Connection"  %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Getting Database Connection</title>
    </head>
    <body>
         <%
         ResultSet result = null ;
       Connection connection1 = null;
      try
           String driverName1 = "oracle.jdbc.driver.OracleDriver";
          Class.forName(driverName1);
          String serverName = "localhost";
          String portNumber = "1521";
          String sid = "XE";
          String url = "jdbc:oracle:thin:@" + serverName + ":" + portNumber + ":" + sid;
          String username = "SYSTEM";
          String password = "password";
          connection1 = DriverManager.getConnection(url, username, password);
          out.println(connection1.isClosed());
          String Name = request.getParameter("name");
          String Age = request.getParameter("age");
           int AgeConvert = Integer.parseInt(Age);
           String ADR = request.getParameter("address");
           String sqlInsert =  " INSERT INTO ADDRESS  (NAME,AGE,ADR)  VALUES ('" + Name + "' , " + AgeConvert + ", '" + ADR +"')";
           Statement stm = connection1.createStatement();
           stm.execute(sqlInsert);
           out.println(" User Created");
    catch(Exception e )
         out.println("User not created");
         e.printStackTrace();
    %>
    <table>
      <tr>
      <td> <b>To search the User Please enter the name in the below box </b> </td>
      </tr>
      <tr>
      <td> Name </td>
      <td> <input type = "text" name ="userName" /> </td>
      </tr>
      <tr>
       <td> <input type ="submit" value = "Search" /></td>
       </tr>
      </table>
    <%    ResultSet results = null ;
         String userNameToBeSearched = request.getParameter("userName");
         String sqlselect =  " SELECT * FROM ADDRESS WHERE NAME ='"+userNameToBeSearched+"'";
         Statement stm2 = connection1.createStatement();
         results = stm2.execute(sqlselect);
         if (results.next()) { 
             %>
             <TABLE BORDER="1">
                <TR>
                   <TH>Name</TH>
                   <TH>Age</TH>
                   <TH>Address</TH>
                </TR>
               <TR>
                   <TD> <%= results.getString(1) %> </TD>
                   <TD> <%= results.getInt(2) %> </TD>
                   <TD> <%= results.getString(3) %> </TD>
              </TR>
           </TABLE>
         <%    
         } else
        out.println("User not found");
         %>
    </body>
    </html>

    DrClap wrote:
    jverd wrote:
    Better still, use PreparedStatement and its parameters, rather than trying to escape/quote stuff yourself. I can't think of a single case where there's any good reason to use Statement rather than PreparedStatement. (Though I'm sure somebody will come up with one.)
    Also, don't put Java code in a JSP. Certainly not DB access code. Icky bad.And don't leave your connection open after you've finished using it. Close it in a finally block to make sure it gets closed no matter what.
    And you should be using a connection pool in a web application rather than repeatedly opening and closing connections. Let the container handle the pool and get your connections from it via JNDI.
    There we go. That's the usual lot of bad practices, isn't it? I don't think we missed any......and I would like to add this...dont do these type of business logic in a jsp. It is just a view...these works are of controllers'. You should follow MVC rules unless you want to fell in some real problems .

  • Transparent gateway to Sybase: connection error

    I have been trying with little success to set up a transparent gateway to a sybase server.
    The gateway is an NT 4 workstation, with an oracle server 8.1.7 installed. The sybase server is an ASE 12.0 on a Solaris 8 box.
    Are these versions of the products supported? In the gateway documentation only Sybase 11 is mentioned...
    Moreover all the examples/schemas given refer to an installation of the gateway on the same machine as the sybase server, whereas in my case the gateway is installed on a separate machine (but it is also stated that this configuration is allowed, provided a sybase client is installed togheter with the gateway).
    From what I can make of the error messages / trace files, the problem lies in the gateway not finding the sybase server. But from the sybase client installed on the gateway machine I can connect to the same remote sybase server without hassles, so the sybase client is configured correctly.
    Thanks for help,
    Gaetano Giunta
    Here's the complete details about the situation:
    Sybase client version:
    Sybase ASE client, version 12.0
    sybase environment variables:
    SYBASE=e:\sybase
    SYBASE_OCS=OCS-12_0
    Sybase server:
    Sybase ASE 12.0 on Solaris 8
    The platform/OS on which the gateway and database reside:
    Windows NT 4.0 + SP6a
    Machine Name: fsiazi08
    Oracle database server:
    Oracle 8i enterprise edition, Version: 8.1.7
    Oracle SID of the Oracle database server
    SID: gate
    Full pathname to directory where the Oracle database server is installed
    ORACLE_HOME: e:\oracle\ora81
    Versions of Net8 Server / client used by the gateway & database
    Net8 Version: 8.1.7
    Net8 Adapter used by the gateway: TCP/IP
    Oracle Transparent Gateway for Sybase:
    Version: 8.1.6
    Full pathname to directory in which gateway resides:
    Path: e:\oracle\ora81\tg4sybs
    Listing of spool log if using SQL*Plus, or the SQL statement and error message received
    SQL*Plus: Release 8.0.5.0.0 - Production on Mon Feb 18 10:27:51 2002
    (c) Copyright 1998 Oracle Corporation. All rights reserved.
    Connected to:
    Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production
    With the Partitioning option
    JServer Release 8.1.7.0.0 - Production
    SQL> select * from "bdvo"."arcofifo"@pollo
    2 /
    select * from "bdvo"."arcofifo"@pollo
    ERROR at line 1:
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [Transparent gateway for SYBASE]ct_connect(): directory service layer: internal directory control
    layer error: Requested server name not found.
    ORA-02063: preceding 2 lines from POLLO
    SQL>
    Listings of key files:
    tg4sybs_agt_pid.trc log file gathered with HS_FDS_TRACE_LEVEL=on
    (0) [Transparent gateway for SYBASE] version: 2.0.4.0.0009
    (0) connect string is:
    (0) YEAR2000_POLICY=-1;CONSUMER_API=1;SESSION_BEHAVIOR_FLAGS=4;PARSER_DEPTH=2000;E-
    (0) XEC_FLAGS = 131080;defTdpName=tg4sybs;binding=(tg4sybs,SYBASE,"sqlbdvlin1");
    (0) ORACLE SYBASE GATEWAY Log File Started at 15-Feb-02 16:54:43
    (0) ct_connect(): directory service layer: internal directory control layer error:
    (0) Requested server name not found.
    (0) Unexpected error: Get Sybase Logon: app:TG4SYBS$2, user:, pass:,
    (0) service:sqlbdvlin1.TG4SYBS$2, server:sqlbdvlin1
    (0) Unexpected error: , connect
    (0) ct_connect(): directory service layer: internal directory control layer error:
    (0) Requested server name not found.
    (0)
    (0) Closing log file at FRI FEB 15 16:54:44 2002.
    inittg4sybs.ora
    # This is a sample agent init file that contains the HS parameters that are
    # needed for an SYBASE gateway Agent.
    # HS init parameters
    #HS_FDS_CONNECT_INFO=sqlbdvlin1.master
    #HS_FDS_TRACE_LEVEL=OFF
    HS_FDS_CONNECT_INFO=sqlbdvlin1.procs
    HS_FDS_TRACE_LEVEL=on
    # Environment variables required for the non-Oracle system
    set SYBASE=e:\sybase
    set SYBASE_OCS=OCS-12_0
    tnsnames.ora
    # TNSNAMES.ORA Network Configuration File: E:\oracle\ora81\network\admin\tnsnames.ora
    # Generated by Oracle configuration tools.
    GATE =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = fsiazi08)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = gate)
    INST1_HTTP =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = fsiazi08)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = SHARED)
    (SERVICE_NAME = gate)
    (PRESENTATION = http://admin)
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    tg4sybs = (DESCRIPTION=
    (ADDRESS=(PROTOCOL=tcp)(HOST=fsiazi08)(PORT=1521))
    (CONNECT_DATA=(SID=tg4sybs))
    (HS=OK)
    listener.ora
    # LISTENER.ORA Network Configuration File: E:\oracle\ora81\network\admin\listener.ora
    # Generated by Oracle configuration tools.
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = fsiazi08)(PORT = 1521))
    (DESCRIPTION =
    (PROTOCOL_STACK =
    (PRESENTATION = GIOP)
    (SESSION = RAW)
    (ADDRESS = (PROTOCOL = TCP)(HOST = fsiazi08)(PORT = 2481))
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = E:\oracle\ora81)
    (PROGRAM = extproc)
    (SID_DESC =
    (GLOBAL_DBNAME = gate)
    (ORACLE_HOME = E:\oracle\ora81)
    (SID_NAME = gate)
    (SID_DESC=
    (SID_NAME=tg4sybs)
    (ORACLE_HOME=E:\oracle\ora81)
    (PROGRAM=tg4sybs)
    CONNECT_TIMEOUT_LISTENER = 0
    Sybase interfaces file (e:\sybase\ini\sql.ini)
    ;; Sybase Interfaces file
    ;; <link_type>=<network_driver>,<connection_info>
    ;; Examples:
    ;; [JUPITER]
    ;; QUERY=NLMSNMP,\\JUPITER\pipe\sybase\query
    ;; WIN3_QUERY=WNLNMP,\\JUPITER\pipe\sybase\query
    [bdvlin1]
    master=TCP,10.1.1.238,4000
    query=TCP,10.1.1.238,4000
    Sybase net-library configuration (e:\sybase\ocs-12_0\ini\libtcl.cfg)
    ; This is the sample Net-Library configuration file which
    ; shows how to specify the different types of drivers which
    ; will be used by Client-Library and Server-Library
    ; applications.
    ;      This is the sample for NT platforms.
    [DRIVERS]
    NLWNSCK=TCP Sockets
    NLWNSCK=TCP/IP Sockets
    ;[NT_DIRECTORY]
    ;REGISTRY=LIBDREG ditbase=SOFTWARE\SYBASE\SERVER
    ;[SECURITY]
    ;NTLM=LIBSMSSP

    Gaetano,
    The supported products that we list in the manual is only what we have tested at print time. However we update our certification matrix regularly.
    Please refer to the certification matrix on Technet.com ( http://otn.oracle.com/products/gateways/pdf/certmatrix2.pdf) for the latest certified configurations.
    It looks like you have installed the gateway in the same Oracle home as the database. With v8.1.6 of the gateway this is not possible. With v9.x onwards this is possible.
    You can either reinstall the gateway in another Oracle home or upgrade to v9.x.
    I recommend that you upgrade to v9.x, since v8.x will be desupported shortly.
    As of v9.x the Sybase gateway is located on the database CD and you can install it by doing a custom install.
    Vira

  • SAP Sybase ESP - Error: Invalid URI at Example: Using a Simple Web Services (SOAP) Input Adapter

    Hello all,
    we need our help regarding the StockTrader example project that is delivered with SAP Sybase Event Stream Processor (Sybase ESP 5.1).
    we want to build a simple Web Service and follow the instructions as described in the Sybase Infocenter. We have attached a screenshot ("Sybase InfoCenter") that contains the described steps (as copying the URL always lead to a wrong page).
    We have problems with Step 10 ("Start the ESP project by running the start_project.bat or start_project.sh script."). We get the error message "Invalid URI" as you can see in screenshot "[error] Invalid Uri". Previously we started the "start_node.bat" (Step 9) - see also screenshot "[error] Invalid Uri".
    Like in steps 6 and 7 mentioned, we have changed the parameters "USER" and "PASSWORD" of the adapter_config.xml files and the parameters "ADAPTER_EXAMPLE_USERNAME"and "ADAPTER_EXAMPLE_PASSWORD" of the
    set_example_env.bat files. Here, we were a bit confused wether we should change these parameters in all those files as there are 4 adapter_config.xml and 4 set_example_env.bat files. Please refer to the attached screenshot ("changed files").
    Does anyone know why this error occurs and how to continue to complete the Web Service?
    Later we want to push data with this Web Service into a SAP HANA database table.
    We are thankful for any input and help.
    Regards, Andreas

    Hello Neal,
    thanks a lot for your help.
    The solution for us was to change the column names inside Sybase ESP Studio to the column names in StockTraderMappings.xml.
    After compiling and running the project we could see the data and were also able to push it to SAP HANA.
    This is the CCL Code that worked for us:
    CREATE SCHEMA tradesSchema (
        transaction_buyerId INTEGER,
        transaction_sellerId INTEGER,
        transaction_supervisorIds INTEGER,
        transaction_tradeTime LONG,
        transaction_trades_amount INTEGER,
        transaction_trades_price FLOAT,
        transaction_trades_symbol STRING
    CREATE INPUT STREAM tradesIn SCHEMA tradesSchema;
    CREATE OUTPUT STREAM tradesOut SCHEMA tradesSchema
         AS  SELECT * FROM tradesIn;
    * mapFilePath is currently ignored and must be set via the mappingFile configuration parameter
    * in the given adapter configuration file (configFilePath).
    ATTACH INPUT ADAPTER Web_Services_SOAP_Input_Adapter TYPE soapinput TO tradesIn PROPERTIES configFilePath =
    'C:/Sybase/ESP-5_1/adapters/webservices/examples/input/adapter_config.xml' ,
    mapFilePath = 'C:/Sybase/ESP-5_1/adapters/webservices/examples/input/stockTraderMappings.xml' ,
    jdkHome = 'C:/Software/Java/jdk' ,
    discoveryWsdl = 'http://localhost:8080/axis2/services/StockTraderService?wsdl' ,
    discoveryWorkingDir = 'C:/tmp/adapter/soap' ,
    discoveryServiceName = 'StockTraderService' ;
    Regards, Andreas and Maik

  • Sybase connection error

    I am getting following error when running my bpel process:
    file:/opt/oracle10g/product/10.1.0/oas_1/integration/orabpel/domains/default/tmp/.bpel_EBODProcess_1.0.jar/leasepak.wsdl [ leasepak_ptt::leasepakSelect_arg(leasepakSelect_arg_inparameters,RalCollection) ] - WSIF JCA Execute of operation 'leasepakSelect_arg' failed due to: Could not create/access the TopLink Session. This session is used to connect to the datastore. ; nested exception is: ORABPEL-11622 Could not create/access the TopLink Session. This session is used to connect to the datastore. See root exception for the specific exception. You may need to configure the connection settings in the j2ee/home/application-deployments/default/DbAdapter/oc4j-ra.xml and restart the server. Caused by Exception [TOPLINK-4003] (OracleAS TopLink - 10g (9.0.4.5) (Build 040930)): oracle.toplink.exceptions.DatabaseException Exception Description: Configuration error. Class [com.sybase.jdbc2.jdbc.SybDriver] not found..
    I do not have directory j2ee/home... but have the file oc4j-ra.xml in j2ee/application-deployments/default/DbAdapter/oc4j-ra.xml which i modiefied but am still getting the same error.
    Thanks.

    Hi there,
    you may need to add the Sybase driver to BPEL Server's (oc4j) classpath.
    You can check out the BPEL dev guide at otn.oracle.com/bpel. Specifically in Chapter 20 there is a section "Third-Party Database Support". I am copying from there:
    At run time, you must put the driver's JARs on the application server's classpath. You
    can do this in the following ways:
    &#9632; Edit the classpath in the following files:
    (standalone) Oracle_
    Home/integration/orabpel/system/appserver/oc4j/j2ee/home/config/application.xml
    (regular middle tier) Oracle_Home/j2ee/OC4J_BPEL/config/application.xml
    &#9632; Drop the JARs into the following directories:
    (standalone) Oracle_
    Home/integration/orabpel/system/appserver/oc4j/j2ee/home/applib
    (regular middle tier) Oracle_Home/j2ee/OC4J_BPEL/applib
    If you look at the application.xml you may notice this is how we include the jdbc drivers for olite, i.e.
    <library path="C:\OraBPELPM\integration\orabpel\lib\olite40.jar"/>
    Good luck!
    Steve

  • Cannot cast from SOMETHING to SOMETHING (Error in 1.4) (Works in 1.6)

    Our company have developed an accounting program, and it is already near completion.
    We developed it with JavaBean and Eclipse in Windows Environment with JRE 1.6.0_05
    When we tried to compile and run the program in our linux environment (Server) that runs on 1.4 , the casting error occured..
    we have written a program to generate all casting errors that occurred in our project.
    import java.math.*;
    import java.util.*;
    public class testnow {
         public static void main(String[] args){
              //Declare ALL Primitive!
              int TestINT = 150;
              Boolean TestBOOL = true;
              String TestSTR = "Streng" + "th";
              BigDecimal TestDCM = BigDecimal.valueOf(20);
              Date TestDATE = new Date();
              //Declare ALL Object
              Object TestINTObj = 150;
              Object TestSTRObj = "Strength";
              Object TestDCMObj = BigDecimal.valueOf(20);
              Object TestBOOLObj = true;
              Object TestDATEObj = new Date();
              if(TestINT == (Integer)TestINTObj){
                   System.out.println("TEST Integer PASSED");
              if(TestSTR.equals((String)TestSTRObj)){
                   System.out.println("TEST String PASSED");
              if(TestDCM.equals(TestDCMObj)){
                   System.out.println("TEST Decimal PASSED");
              if(TestBOOL == (Boolean)TestBOOLObj){
                   System.out.println("TEST Boolean PASSED");
              if(TestDATE.equals((Date)TestDATEObj)){
                   System.out.println("TEST Date PASSED");
    }the following is what happened when i run javac testnow.java
    1. ERROR in testnow.java
    (at line 6)
    Integer TestINT = 150;
    ^^^^^^^
    Type mismatch: cannot convert from int to Integer
    2. ERROR in testnow.java
    (at line 7)
    Boolean TestBOOL = (Boolean)true;
    ^^^^^^^^^^^^^
    Cannot cast from boolean to Boolean
    3. ERROR in testnow.java
    (at line 11)
    Object TestINTObj = (Object)150;
    ^^^^^^^^^^^
    Cannot cast from int to Object
    4. ERROR in testnow.java
    (at line 14)
    Object TestBOOLObj = true;
    ^^^^^^^^^^^
    Type mismatch: cannot convert from boolean to Object
    4 problems (4 errors)
    in our windows development JRE 1.6 , it run well and gives the following output :
    TEST Integer PASSED
    TEST String PASSED
    TEST Decimal PASSED
    TEST Boolean PASSED
    TEST Date PASSED
    how do we solve this? i mean we have been using this "convenience" casting all over our code . :(
    please help
    thanks a lot.
    Cheers and God Bless,
    Chowi

    You've got a lot of problems there, and not all of them are due to Java version incompatibilites. I'll take them in the order I see them. public static Object FindDataInTable(ArrayList TargetTable, String TypeColumn,
             String TargetColumn, Object TargetData, String ReturnedColumn)&#x7B; The convention is to give methods and variables names that start with lowercase letters. That makes your code easier to read, which makes it easier for us to help you. Later on, I see you also use a mix of underscores and camelcase. Underscores should be used only in constant names; class, method and variable names should use only camelcase.
    Also, if you don't have a good reason to make that first argument an ArrayList, you should declare it as a List instead. That leaves the calling code the option of using a different List implementation should they need to.
    Next, you assign a primitive value to an Object reference: Object ReturnedObject = 0; That requires autoboxing, as others have pointed out, which didn't exist in JDK 1.4. Even if you could use autoboxing though, that assignment would be a bad idea; a variable of type Object should be assigned a default value of {color:000080}null{color}, not a number. However, you may not need to declare that variable at all, as I explain later.
    Next you use a "foreach" loop, another feature that was added in JDK 1.5; you'll have to switch to the old-style loop if you want this code to work under JDK 1.4. While you're at it, you should declare your "SingleRow" variable inside the loop, since it's not used anywhere else: for (Iterator it = TargetTable.iterator(); it.hasNext(); ) {
        Model_DatabaseQuery SingleRow = (Model_DatabaseQuery)it.next(); Next I see you using matches() to compare String values: if(TypeColumn.matches("String")){
        if(((String)TargetData).matches((String)CheckData))&#x7B; You get away with that because the strings contain only letters, but you need to look up the docs for matches() so you'll understand why you shoudn't be using it here. But this is nothing compared to the next issue: if((Integer)TargetData == (Integer)CheckData)&#x7B; // WRONG WRONG WRONG That can't possibly have worked right, no matter what version of Java you ran it under. You NEVER use == to compare the values objects! You should have been using equals() for all those comparisions, not matches(), and definitely not ==.
    But I don't see why you're doing all those checks on the column type anyway. All you ever do after that is compare the same two values, so just do it: for (Iterator it = targetTable.iterator(); it.hasNext(); ) {
        Model_DatabaseQuery SingleRow = (Model_DatabaseQuery)it.next();
        Object CheckData = SingleRow.Get_object(TargetColumn);
        if (CheckData != null && CheckData.equals(TargetData)) {
            return SingleRow.Get_object(ReturnedColumn);
    } If there are other columns that you're supposed to ignore, you may still need to check the column type, but you could do that in one {color:000080}if{color} statement; you don't have to check them all separately.

  • Power Query - Sybase iAnywhere Error

    Hi,
    When I try to connect using From Sybase Database I get the following error. I have the Sybase SQL Anywhere installed. (C:\ProgramData\SybaseIQ\Samples\SQLAnywhere) I have Windows 7 64 bit. Any direction as to why Power Query does not see SQL Anywhere?
    DataSource.NotFound: Sybase SQL Anywhere: Unable to find a database provider with invariant name 'iAnywhere.Data.SQLAnywhere'.
    This error may have been the result of provider-specific client software being required but missing on this computer.  To download client software for this provider, visit the following site and choose at minimum 'Sybase SQL Anywhere Client Software':
    http://go.microsoft.com/fwlink/?LinkId=324846
    Thanks
    Lauren

    Hi Lauren,
    When installing the Sybase, please make sure the Sybase ADO.NET provider is installed correctly.
    Regards
    Qunshu
    Clarification: Microsoft doesn't own any liability & responsibility for any of my posting.

  • SYBASE Update ERROR 127

    Hi,
    I am updating Sybase from 15.7 patch 100 to 15.7 patch132 after follow steps from note 1982469 - SYB: Updating SAP ASE with saphostctrl / sapdbctrl
    I have an error message:
    PS C:\Program Files\SAP\hostctrl\exe> .\saphostctrl.exe -user sapadm *****  -function LiveDatabaseUpdate -dbname *** -
    dbtype syb -updatemethod Execute -updateoption TASK=UPDATE_ASE -updateoption DROP_LOCATION="I:\SYBASEPATCH"
    Error: Command execution failed. : Operation not supported (fault code: 127)
    Operation ID: 0050568D90621ED4B2BD2245F4B760CE
    ----- Log messages ----
    Info: saphostcontrol: Executing LiveDatabaseUpdate
    Error: sapdbctrl: Operation not supported
    Error: saphostcontrol: LiveDatabaseUpdate failed (sapdbctrl exit code = 6)
    PS C:\Program Files\SAP\hostctrl\exe>
    Any clue?
    OS>Windows 2012

    Hi,
    This is the message from C:\Program Files\SAP\hostctrl\work\dev_sapdbctrl
    ERROR => 'Database live update' failed: Operation not supported [sapdbctrl.cp 2619]
    Regards

  • Sybase connection errors with SSDT

    Hello All,
    I need help.
    I'm designing datamodels in SQL Server Data Tools but am having trouble connecting to my Sybase DB (or anything other than MSSQL). The Sybase client is installed and I'm able to connect and browse to the DB via Sybase Central. However, in SSDT, I get the
    error message:
    Failed to connect to the server. Reason: The 'ASEOLEDB' provider is not registered on the local machine.
    What do I need to install/configure to make this work?
    SSDT: Visual Studio 2010 Shell ver 10.0.40219.1 SP1 Rel
    Windows Server 2008 R2 Enterprise x64bit
    Sybase Central ver 6.0.0.4787, Sybase IQ ver 15.3.0.110506
    Thanks,
    Carter

    Hi Carter,
    Base on my research, the error "The 'XXXX' provider is not registered on the local machine." was caused by that Visual Studio can only recognize 32bit providers for OLEDB providers, however, for .NET providers, both 32bit and 64 bit providers can be
    listed in VS. To avoid this issue, please install both 32bit and 64bit
    Sybase OLEDB provider and then reference the provider using ASEOLEDB in SSDT.
    Hope this helps.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Casting resultSet

    Hi All,
    Could anyone tell me if it is possible to cast a resultSet to a different type of collection such as a java.util.Collection, java.util.Map or an ArrayList etc?

    No. A resultset is not usualy a collection in memory, it is more of a live conection to the database (depending on the driver) this makes it possible to do "select * from alargetable".
    You have to read the results into a collection yourself.
    Alternatively you can use a rowset object which loads the contents of a resultset into memory. But u still cant cast it into a collection. http://java.sun.com/products/jdbc/download.html#spec
    Hope this helps!

  • Casting and radio select : conversion error

    I'd like to display radio options differently, regarding of their type.
    For example I have an OpenOption class which extends Option. So when I display it I'd like to add an input text box if the user select an open option :
                             <h:selectOneRadio value="#{q.answer}">
                                 <s:selectItems value="#{q.target.options}" var="opt" label="#{opt.text}" />                       
                                 <a:support event="onchange" reRender="pnlOpenText"/>
                             </h:selectOneRadio>                         
                             <a:outputPanel id="pnlOpenText">
                                     <h:panelGroup id="innerPnlOpenText" rendered="#{q.answer.class.simpleName eq 'OpenOption'}">
                                       <h:outputText value="#{q.answer.freeTextLabel}"/>&#160;
                                       <h:inputText value="#{q.freeText}" size="50"/>                                   </h:panelGroup>
                             </a:outputPanel>I use the following EL expression to test the type of the selected option :
    #{q.answer.class.simpleName eq 'OpenOption'}It works well BUT if I select the open option and refresh the page, the RadioRenderer fail when trying to convert ALL the options into OpenOption :
    Cannot convert Option[ id=null, text=Q1, rank=0 ] of type class Option to class OpenOptionFor the time being I see only one solution : put a type attribute in my Option class ... I believe this is not the best design.
    Is there any other workaround ?
    Would it be possible to have a renderer which doesnt infer the options type from the selected option but individually for each option ? I don't know anything about the spec ...
    Thanks,
    Bruno

    Java is case sensitive language after all , plus beans getters and setters naming rules :)
    SetConfirmClaim
    must be
    setConfirmClaim
    It raises a question though whether more exact error reporting is achievable , not just "Conversion error has occured".

  • Sybase database error

    this error happened today and when i restart the process it works for
    awhile and comes back. Nothing was done to the server (5.1.x) for months
    This is what I get:
    ERROR Assertion failed: 200601 (7.0.2.1583)
    Page for requested record not a table page page or record not present on
    page
    It seems like a database error. What are my options?

    Otero,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Do a search of our knowledgebase at http://support.novell.com/search/kb_index.jsp
    - Check all of the other support tools and options available at
    http://support.novell.com.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://support.novell.com/forums)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://support.novell.com/forums/faq_general.html
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://support.novell.com/forums/

  • Error in cast a variable

    these are few lines from my long STORED PROCEDURE actually i am new to oracle 11g please
    declare
    v_s nvarchar2(10);
    p_RN nvarchar2(10);
    begin
    v_s := v_s || cast(p_RN as nvarchar2(10)); - ERROR IS COMING IN THIS LINE
    end;
    error
    ORA-06550: line 5, column 39:
    PLS-00103: Encountered the symbol "(" when expecting one of the following:
    06550. 00000 - "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:
    please somebody help me

    Just a little explanation about the error message.
    ORA-06550: line 5, column 39:
    PLS-00103: Encountered the symbol "(" when expecting one of the following:
    Line 5 column 39 is the starting parenthesis of the "(10)". For using cast you can't add a lenght to the datatype.
    If you change that, then you get a different error message:
    declare
    v_s nvarchar2(10);
    p_RN varchar2(10);
    begin
      v_s := v_s || cast(p_RN as nvarchar2); -- ERROR IS COMING IN THIS LINE
    end;
    Fehler beim Start in Zeile 13 in Befehl:
    declare
    v_s nvarchar2(10);
    p_RN varchar2(10);
    begin
      v_s := v_s || cast(p_RN as nvarchar2); -- ERROR IS COMING IN THIS LINE
    end;
    Fehlerbericht:
    ORA-06550: line 5, column 22:
    PLS-00382: expression is of wrong type
    ORA-06550: line 5, column 3:
    PL/SQL: Statement ignored
    06550. 00000 -  "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:ORA-06550: line 5, column 22:
    PLS-00382: expression is of wrong type
    This shows that you can't convert/cast a nvarchzar type into another nvarchar type.
    It would work if you cast a number into a varchar2 type for example
    declare
    v_s nvarchar2(10);
    p_RN number(10);
    begin
      v_s := v_s || cast(p_RN as nvarchar2); -- ERROR IS COMING IN THIS LINE
    end;
    anonymer Block abgeschlossen.

  • Sybase Error 2601 Attempt to insert duplicate key row in object with unique

    RE: Sybase Error 2601 Attempt to insert duplicate key row in object with unique index.
    Hi Folks,
    I'm getting the following error whilst executing a stored procedure in Sybase.
    ERROR: Sybase Error 2601 Attempt to insert duplicate key row in object with unique index.
    I understand that duplicate values have been inserted into a column that has a unique constraint.
    I just can't figure out how to rectify the problem.
    Your help will be greatly appreciated!
    Many thanks in advance.

    If the value I'm trying to insert (using update)
    already exists in the unique-value field then the DB
    refuses to update the field.
    If the value is different it will update.Are you trying to insert or update in SQL (identified by the keyword INSERT or UPDATE respectively)?
    Even in case of an UPDATE query, if you are going to update the values of some columns to violate the unique constraints, the update will not succeed and you will get the error message.
    or is it?
    it tries to create a new row, but can't because there
    is another row with the same unique-values.
    If this is the case, I am only trying to update and
    not create a new item.To put it in simpler words, if you have a set of values defining the uniqueness of a record, you cannot insert another record with the same set of unique values. Similarly, you cannot update an existing record by modifying the set to conflict with another set of unique values which already exist in the database.
    Suppose there are two columns A and B defining the uniqueness of the record and you have only two records at the moment like -
    A B
    ========
    1 1
    2 1
    If you try to insert a record with A = 1 and B = 1, it will fail because a record already exists. You cannot violate uniqueness because the database has already been told that there will be only one record for any given combination of A and B.
    Similarly, if you try to update the second record from A = 2 to A = 1, the end result would be A =1 and B = 1. There is already a record with that set of values and this will result in a violation of the uniqueness. So, this update will also be disallowed. On the other hand, if you try to update B to some value, say 3, there is no problem in doing so.
    For convenience, you can imagine an UPDATE operation to be equivalent to DELETE + INSERT operation, though it doesn't necessarily work the same way internally.
    I hope I was clear enough.

Maybe you are looking for