Connection ClassCastException trying to create ArrayDescriptor

 

Create a class that implements oracle.sql.CustomDatum and the toDatum() method. The OracleDriver will call this method to create your oracle.sql.ARRAY object.The just use setObject() to set the value.import oracle.sql.Datum;import oracle.jdbc.driver.OracleConnection;import oracle.sql.CustomDatum;import oracle.sql.ARRAY;import oracle.sql.ArrayDescriptor;public class OracleArray implements CustomDatum {  private List data;  private String sqlType;  // pass in the sql name of the array   public OracleArray(String sqlType, List data) {    this.data = data;  } public Datum toDatum(OracleConnection conn) throws SQLException {    ArrayDescriptor arrayDesc = ArrayDescriptor.createDescriptor(sqlType, conn);    ARRAY array = new ARRAY(arrayDesc, conn, data.toArray());    return array;  }

Similar Messages

  • ClassCastException trying to create ArrayDescriptor

     

    There is one way I found to accomplish something like this. It basically involves
    using the customdatum interface that oracle provides. Essentially you can pass
    an object through all of the jdbc layers into the oracle driver and then let the
    driver call your object back with an oracleconnection - thereby avoiding the classcastexception.
    It does require a bit more work, but may be worth it in certain circumstances.
    I have attached an example dervied from some working code(though the example probably
    will not compile). It shows how to accomplish this for a struct containing an
    array of structs (pretty much a one to many model). It can be simplified of course
    if such a containment model does not exist. Also one should be able to adjust
    this strategy for clobs as well to basically avoid having to do two jdbc calls
    to create a new clob.
    Rupen
    "David" <[email protected]> wrote:
    >
    Joseph Weinstein <[email protected]> wrote:
    Jay Fuller wrote:
    I am trying to save information to a Nested Table with type "HISTORY_NT"within "ejbStore", but
    I'm getting a ClassCastException when I make this call.
    ArrayDescriptor.createDescriptor("HISTORY_NT",conn); // orace.sql.ArrayDescriptor
    The exact error statement is:
    java.lang.ClassCastException: weblogic.jdbc20.jts.Connection
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:80)...
    Hi. We currently don't have any way of offering Oracle non-standardJDBC
    extensions through
    our pool and jts drivers. For example, that createDescriptor call requires
    a naked Oracle JDBC
    connection for an argument, not a WebLogic jts or pool connection. There's
    nothing we can do to
    make our jts or pool connections cast directly to an Oracle class. Unless/until
    we provide
    you access to the underlying DBMS connection for these purposes, you
    will not be able to make
    these Oracle calls with a pooled connection. We need to maintain a wrapper
    around any pooled
    connection to be able to guarantee that when the connection is returned
    to the pool, no one retains
    a reference to it that is out of our control. Otherwise the next user
    of the pooled connection may
    have his work corrupted by a former user that mis-uses a reference to
    the DBMS connection they
    obtained long before. A simple example is that if we gave you access
    to the Oracle connection
    class to make that call, and when you were done, you closed both pool
    connection (returning it
    to the pool), and the DBMS connection, you would kill the pooled connection
    and the next user
    would get a dead pool connection. A more serious example would be if
    after closing the pool
    connection, you did a commit() or rollback on the DBMS connection, if
    some other thread got
    the pool connection before the commit/rollback you'd be trampling their
    tx.
    Joe
    My connection statement within my EJB is:
    static
    new weblogic.jdbc20.jts.Driver();
    private Connection getConnection()
    throws SQLException
    return DriverManager.getConnection("jdbc20:weblogic:jts:OraclePool",null);
    I am using a database pool set up as follows.
    weblogic.jdbc.connectionPool.OraclePool=\
    url=jdbc:oracle:oci8:@dbname,\
    driver=oracle.jdbc.driver.OracleDriver,\
    loginDelaySecs=1,\
    initialCapacity=4,\
    maxCapacity=10,\
    capacityIncrement=2,\
    allowShrinking=true,\
    shrinkPeriodMins=15,\
    refreshMinutes=10,\
    testTable=dual,\
    props=user=xxxxxxxx;password=xxxxxx
    I'm using WLS 5.1 sp1 and Oracle 8.1.6 and I can make the code workif I access the database
    directly, but going through the jts driver there seems to be a bugin the weblogic code. I might
    be wrong about this, so if someone can please point out my error Iwould appreciate it.
    Jay--
    PS: Folks: BEA WebLogic is in S.F., and now has some entry-level positions
    for
    people who want to work with Java and E-Commerce infrastructure products.
    Send
    resumes to [email protected]
    The Weblogic Application Server from BEA
    JavaWorld Editor's Choice Award: Best Web Application Server
    Java Developer's Journal Editor's Choice Award: Best Web Application
    Server
    Crossroads A-List Award: Rapid Application Development Tools for
    Java
    Intelligent Enterprise RealWare: Best Application Using a ComponentArchitecture
    http://weblogic.beasys.com/press/awards/index.htm
    <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
    <html>
    <p>Jay Fuller wrote:
    <blockquote TYPE=CITE>I am trying to save information to a Nested Table
    with type "HISTORY_NT" within "ejbStore", but I'm getting a ClassCastException
    when I make this call.
    <p> <b>ArrayDescriptor.createDescriptor("HISTORY_NT",conn);
    // </b>orace.sql.ArrayDescriptor
    <p>The exact error statement is:
    <br> <b>java.lang.ClassCastException:
    weblogic.jdbc20.jts.Connection</b>
    <br><b>
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:80)
    ....</b></blockquote>
    <p><br>Hi. We currently don't have any way of offering Oracle non-standard
    JDBC extensions through
    <br>our pool and jts drivers. For example, that createDescriptor call
    requires
    a naked Oracle JDBC
    <br>connection for an argument, not a WebLogic jts or pool connection.
    There's nothing we can do to
    <br>make our jts or pool connections cast directly to an Oracle class.
    Unless/until we provide
    <br>you access to the underlying DBMS connection for these purposes,
    you
    will not be able to make
    <br>these Oracle calls with a pooled connection. We need to maintain
    a
    wrapper around any pooled
    <br>connection to be able to guarantee that when the connection is returned
    to the pool, no one retains
    <br>a reference to it that is out of our control. Otherwise the next
    user
    of the pooled connection may
    <br>have his work corrupted by a former user that mis-uses a reference
    to the DBMS connection they
    <br>obtained long before. A simple example is that if we gave you access
    to the Oracle connection
    <br>class to make that call, and when you were done, you closed both
    pool
    connection (returning it
    <br>to the pool), and the DBMS connection, you would kill the pooled
    connection and the next user
    <br>would get a dead pool connection. A more serious example would be
    if
    after closing the pool
    <br>connection, you did a commit() or rollback on the DBMS connection,
    if some other thread got
    <br>the pool connection before the commit/rollback you'd be trampling
    their
    tx.
    <br>Joe
    <blockquote TYPE=CITE><b></b>
    <br>
    <p>My connection statement within my EJB is:
    <br> <b>static</b>
    <br><b> {</b>
    <br><b> new weblogic.jdbc20.jts.Driver();</b>
    <br><b> }</b>
    <p><b> private Connection getConnection()</b>
    <br><b> throws SQLException</b>
    <br><b> {</b>
    <br><b> return
    DriverManager.getConnection("jdbc20:weblogic:jts:OraclePool",null);</b>
    <br><b> }</b>
    <p>I am using a database pool set up as follows.
    <br> <b> weblogic.jdbc.connectionPool.OraclePool=\</b>
    <br><b> url=jdbc:oracle:oci8:@dbname,\</b>
    <br><b> driver=oracle.jdbc.driver.OracleDriver,\</b>
    <br><b> loginDelaySecs=1,\</b>
    <br><b> initialCapacity=4,\</b>
    <br><b> maxCapacity=10,\</b>
    <br><b> capacityIncrement=2,\</b>
    <br><b> allowShrinking=true,\</b>
    <br><b> shrinkPeriodMins=15,\</b>
    <br><b> refreshMinutes=10,\</b>
    <br><b> testTable=dual,\</b>
    <br><b> props=user=xxxxxxxx;password=xxxxxx</b>
    <br>
    <p>I'm using WLS 5.1 sp1 and Oracle 8.1.6 and I can make the code work
    if I access the database directly, but going through the jts driverthere
    seems to be a bug in the weblogic code. I might be wrong about
    this,
    so if someone can please point out my error I would appreciate it.
    <p>Jay</blockquote>
    <p>--
    <p>PS: Folks: BEA WebLogic is in S.F., and now has some entry-levelpositions
    for
    <br>people who want to work with Java and E-Commerce infrastructureproducts.
    Send
    <br>resumes to [email protected]
    <br>--------------------------------------------------------------------------------
    <br>
    The Weblogic Application Server from BEA
    <br> JavaWorld Editor's
    Choice Award: Best Web Application Server
    <br> Java Developer's Journal Editor's Choice Award: Best Web Application
    Server
    <br> Crossroads A-List Award: Rapid Application
    Development Tools for Java
    <br>Intelligent Enterprise RealWare: Best Application Using a Component
    Architecture
    <br>
    http://weblogic.beasys.com/press/awards/index.htm
    <br> </html>
    Weblogic connection pool users weblogic.jdbc.rmi.SerialConnection connection
    class,
    not java.sql.Connection.
    Oracle oracle.sql.ArrayDescriptor.createDescriptor method tries to cast
    it to
    oracle.jdbc.OracleConnection which fails.
    One workaround is to use Oracle connection pool.
    Oracle8i JDBC Developer's Guide and Reference:
    http://download-west.oracle.com/docs/cd/A81042_01/DOC/index.htm
    Another workaround is to stop passing Oracle Array to the stored procedure,
    pass delimited string and conver it into pl/sql Array internaly.
    Here is the code we use (original sample by Tom Kyte):
    CREATE OR REPLACE TYPE INT_TABLE AS TABLE OF NUMBER;
    CREATE OR REPLACE
    FUNCTION str2array( p_string in VARCHAR2 ) RETURN INT_TABLE
    AS
    l_string long default p_string || ',';
    l_data INT_TABLE := INT_TABLE();
    n number;
    BEGIN
    LOOP
    EXIT WHEN l_string is null;
    n := INSTR( l_string, ',' );
    l_data.EXTEND;
    l_data(l_data.COUNT) :=
    LTRIM( RTRIM( SUBSTR( l_string, 1, n-1 ) ) );
    l_string := SUBSTR( l_string, n+1 );
    END LOOP;
    RETURN l_data;
    END;
    --Unit test
    SELECT * from THE ( select cast( str2array('787, 234, 12, 1024, 1,45,1231243,324235435,3436426767,0,-1,-345235')
    AS INT_TABLE ) from dual ) a
    --Performance test
    DECLARE
    it_groups INT_TABLE := INT_TABLE();
    BEGIN
    FOR i IN 1..1000 LOOP
         it_groups:=str2array('787,234,312,787,234,312,345,235,787,235,787,234,312,335,434,235');
    END LOOP;
    END;
    Overhead is about 1 ms to parse 16 tokens.
    Hope it helps,
    David
    [CustomDatumExample.java]

  • Error when tyring to create ArrayDescriptors in Weblogic for Oracle

    Has anyone every tried to pass arrays to a oracle callable statement within weblogic and recieved the following error?
    java.lang.ClassCastException: weblogic.jdbc.rmi.SerialConnection
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:87)
    Or has anyone ever gotten this error when trying to use the setObject method - (SQLException Cannot bind object type:) and if so what does it mean.

    Hi Anver
    I am getting this error when I am trying to create ArrayDescriptor using JNDI WL server connection.
    Env :
    Oracle : 8.1.7
    WL Server : 6.1
    JDK : 1.3.1
    JDBC: 2.0 - classes12.zip
    Error Message :
    java.lang.ClassCastException: weblogic.jdbc.rmi.SerialConnection
    Please let me know if you had find any solution for this error.
    This is my code :
         public void testArray()
              Connection conn = null;
              ArrayList serialNumbers=new ArrayList();
              serialNumbers.add("296300");
              serialNumbers.add("296281");
              try
    ArrayDescriptor desc = ArrayDescriptor.createDescriptor("SERIALNUMS",conn.getMetaData().getConnection());
    ARRAY newArray = new ARRAY(desc, conn, serialNumbers.toArray());
    oracle.jdbc.driver.OracleCallableStatement cstmt =(oracle.jdbc.driver.OracleCallableStatement)conn.prepareCall("{call TRIP_WIZARD.GetTripCount(?,?,?)}");
                   cstmt.setARRAY(1,newArray);
                   cstmt.registerOutParameter(2,Types.NUMERIC);
                   cstmt.registerOutParameter(3,Types.VARCHAR);
                   String errDesc=cstmt.getString(3);
                   cstmt.execute();
                   cstmt.close();
              }catch(Exception e)
              System.out.println("Exception Occured :"+e.toString());
    Thanks a lot in advance.
    Rama.

  • Error trying to create https connection from Web Dynpro

    Hi experts!!
    I am trying to create a WD view with an actionButton and a form template, when the user fills the data in the form and presses the button, i want to create an Https connect and post some parameters to the URL.
    HttpsURLConnection cannot be resolved,
    com.sun.net.ssl.internal.ssl.Provider() does't not exist in the package com.sun.net.ssl.internal.ssl.Provider()
    do i need to add any jars?? I've already added the jsse.jar
    The code i use is the following.
    private void sendHttp(){
          String response = "";
          HttpsURLConnection connection = null;
          try {
                      System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
                      java.security.Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
                      URL url = new URL(<your_url>);
                      connection = (HttpsURLConnection) url.openConnection();
                      connection.setDoInput(true);
                      connection.setDoOutput(true);
                      connection.setAllowUserInteraction(true);
                      connection.setUseCaches(false);
                }     catch(Exception e) {
                      response = response +  "Error in getting connection: " ;
                      response = response +  e ;
                if (connection != null){
                      try {
                            connection.setRequestMethod("POST");
                            connection.setFollowRedirects(true);
                            //build all the parameters into 1 string
                            String query = "parameter1name=" + URLEncoder.encode(parameter1value);
                                  query += "&";
                                  query += "parameter2name=" + URLEncoder.encode(parameter2value);
                            connection.setRequestProperty("Content-length",String.valueOf (query.length()));
                            connection.setRequestProperty("Content-Type","application/x-www- form-urlencoded");
                            connection.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)");
                            // open up the output stream of the connection
                            DataOutputStream output = new DataOutputStream( connection.getOutputStream() );
                            // write out the data
                            int queryLength = query.length();
                            output.writeBytes( query );
                            output.close();
                            //if responsecode <> 200 you should stop: should always be 200
                            String responsecode = connection.getResponseCode();
                            if (responsecode.equalsIgnoreCase("200")){
                                  String inputLine;
                                  StringBuffer input = new StringBuffer();
                                  BufferedReader in =     new BufferedReader(     new InputStreamReader(connection.getInputStream()));
                                                                                    //Get site response
                                  while ((inputLine = in.readLine()) != null) {
                                        input.append(inputLine);
                                  in.close();
                                  response = response + input.toString();
                      }     catch(Exception e) {
                          response = response +  "Error in using connection: " ;
                          response = response +  e ;
              wdContext.currentContextElement().setResponse(response);

    Hai ,
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/526bd490-0201-0010-038e-d3ff7eb1d16e
    please check above link .
    application server u have take load balancing click on next  there u take click on radio button of Msg server .
    Regards ,
    venkat

  • Somebody correct my code Iam trying to create an applet which connects  DB

    This is throwing many mistakes iam trying to create an applet like an airplace booking which shows combo box of the available aircrafts and when selected it should show the no of available seats
    import javax.swing.*;
    import java.awt.*;
    //<applet code=Aircraft_Booking width=500 height=500></applet>
    public class Aircraft_Booking extends JApplet
    JLabel           lblStdId;
    JLabel          lblStdSeats;
    JLabel          lblStdAircraft;
    JComboBox      jcmbStdAircraft;
    JTextField      jcmbStdSeats;
    JTextField      jcmbStdId;
    JPanel           panel;
    //Member Function/
    public void init()
    panel = new JPanel();
    lblStdId          =      new JLabel("Aircraft Booking");
    lblStdSeats =      new JLabel("No of Available Seats");
    lblStdAircraft =     new JLabel("Choose your Aircraft");
    //txtStdId     =     new JTextField(5);/
    String p = "Select * from Aircraft where aircrafttypeid";
    /*Initialize and load the JDBC-ODBC Bridge driver*/
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    /*Establish a connection with a data source*/
    Connection con = DriverManager.getConnection("jdbc:odbc:MyDataSource", "sa", "");
    /*Create a Statement object to process the SELECT statement*/
    Statement stmt = con.createStatement();
    /*Execute the SELECT SQL statement*/
    ResultSet rs = stmt.executeQuery(str);
    jcmbStdAircraft = new JComboBox(p);
    //Add all components to panel/
    panel.add(lblStdId);
    //panel.add(txtStdId);/
    panel.add(lblStdAircraft);
    panel.add(jcmbStdAircraft);
    //Add Panel to JApplet/
    getContentPane().add(panel);
    }

    When running an Applet connections can only be established back to the originating machine unless you have changed the security configuration of the client machine.
    This means that you would only be able to connect to the database on the server from which the applet was loaded.
    Contrariwise the JDBC-ODBC driver will try to connect to the database on the local machine. So I can't see that working unless this was your intention and you have made the appropriate security config changes - but in such a circumstance Applets are a rather odd choice of environment.

  • ODBC ORACLE connection issue when trying to create a datastore. SAP Ds 3.2

    I am at a client and I am trying to create an Oracle data store.  I have an Oracle client installed on my laptop and an ORACLE driver.  I can connect and query Oralce tables using Oralce tools on my laptop.
    When I go to SAP DS to create a datastore I get an error message "Cannot find NT Oracle Server DLL <OCI.dll>  Make sure Oracle has been installed and the PATH variable has been set"
    The PATH is set correctly. 
    Creating a data store using Database Oracle give the above message.
    If I try using ODBC it cannot find the oracle drive in the system list.
    HELP

    Hello
    Are you using a supported version of Oracle?  I hope it's not Oracle 7!
    This is probably an installation issue, where is Data Services installed?  If its Program Files (x86), try re-installing in C:\SAP or similar.
    Your comment <<If I try using ODBC it cannot find the oracle drive in the system list.>>  makes me wonder if the the Oracle client is not installed properly.
    Michael

  • "Access denied by Business Data Connectivity" on trying to connect to SQL server for creating external content type

    I was trying to create external client type but whenever I try to connect to Database server it is showing me error"Access denied by Business Data Connectivity". I have given the Secure Store Target Application ID coorectly and it is setup coorectly.
    In BDC service application I have given myself all the permissions( edit,execute,Selectable in clients,Set Permissions) through set metadata store permission option in it.
    Please suggest what other reason can be there for the error.
    Thanks and Regards
    Gaurav

    Hi Gaurav,
    If you have given your account all permissions through setting metadata store permission, the issue should be resolved.
    For a better trouble shooting , I suggest you do as the followings:
    1. Assign administrators to a Business Data Connectivity service application
    Here is a detailed article for your reference:
    http://technet.microsoft.com/en-us/library/ff973113.aspx
    2. You can try to recreate a Business Data Connectivity service application to test whether it works.
    http://www.dotnetcurry.com/showarticle.aspx?ID=794
    Best regards,
    Zhengyu Guo
    Zhengyu Guo
    TechNet Community Support

  • My family uses a single lap-top as our main internet connection and when we synch our respective I-pods, our I-tunes account seems to wipe-out our playlists, even though we have tried to create separate I-tune accounts.  Help!!

    My family uses a single lap-top as our home computer and several of us have i-pods that we like to synch, using I-tunes.  Although we've tried to create separate I-tune accounts, our i-tunes playlists are getting wiped out when one of us deletes songs on our I-pod and it seems as though I-tunes is not distinguishing our distinct accounts and all i-pods are being synched to reflect the latest i-pod anyone makes on their respective account.  It appears as though our distinct I-tune accounts are not being loaded on our lap-top when we sign in and unfortunately, when we're in I-tunes, there is nothing to indicate what account is on the screen.  For all the glowing appraisals apple-related products usually receive, we are finding i-tunes and its interface with our respective i-pods to be a very, very frustrating experience. 
    Can anyone shed some light on this for a family of non-techies?  Thx 
    Pegger64  

    You need to create separate Windows user accounts if you want to seperate the behaviour of iTunes for each user. That also means separate iTunes libraries for each user.
    Windows is a multi-user operating system but you are not using it properly. iTunes is not a multi-user application. No application is. You can't expect it to treat different users differently when they are all using the same computer user account.
    Do you understand what I mean?

  • Trying to create a shell script to cut/paste files in finder. Help needed.

    I'm trying to create an automator shell script to cut/paste. It'll function exactly like copy/paste. i.e. I'll just copy file/files with command+c like always, but then I'll create an automator which uses the "mv" terminal app to move the files which works exactly like cut paste.
    I need some help since I don't know the syntax for creating shell scripts.
    What I did so far is to do it in automator with Apple Script which goes like the following:
    on run {input, parameters}
    tell application "Finder"
    set theWindow to window 1
    set thePath to quoted form of (POSIX path of (target of theWindow as string))
    end tell
    tell application "Terminal"
    do script with command "mv \"" & input & "\"" & thePath in window 1
    end tell
    return input
    end run
    This gets the copied file path from clipboard before, as input, and then recognizes the active finder window as thePath so then executes the mv command for the input file to the thePath window.
    It doesn't work as expected since it connects both file/window paths into a single path instead of leaving a space between them so the mv command can't recognize two separate paths.
    What's the correct syntax for that line
    do script with command "mv \"" & input & "\"" & thePath in window 1
    to leave a space between input and thePath under the mv command?
    Also this requires the terminal app to be open in the background.
    After I get this to work I want to do the exact same thing using shell script within automator, so I won't need Terminal to be open all the time.
    And the next step will be to cut/paste multiple files/folders but that should be easy to do once I get the hang of it.

    Try using:
    on run {input, parameters}
    tell application "Finder"
    set theWindow to window 1
    set thePath to quoted form of (POSIX path of (target of theWindow as string))
    end tell
    do shell script "mv \"" & input & "\" " & thePath
    return input
    end run
    (45977)

  • Null connection when trying to connect to SQL Server 2000 in Tomcat4.1.29

    Hi All,
    I am still struggling with null connection when trying to connect to sql server 2000 with tomcat using sun.jdbc.odbc.JdbcOdbcDriver
    Here is my server.xml
    <Server port="8005" shutdown="SHUTDOWN" debug="0">
    <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
    debug="0"/>
    <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
    debug="0"/>
    <GlobalNamingResources>
    <Resource name="UserDatabase" auth="Container"
    type="org.apache.catalina.UserDatabase"
    description="User database that can be updated and saved">
    </Resource>
    <ResourceParams name="UserDatabase">
    <parameter>
    <name>factory</name>
    <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
    </parameter>
    <parameter>
    <name>pathname</name>
    <value>conf/tomcat-users.xml</value>
    </parameter>
    </ResourceParams>
    <Resource auth="Container" description="Users and Groups
    Database" name="UserDatabase"
    scope="Shareable"
    type="org.apache.catalina.UserDatabase"/>
    <Resource name="jdbc/DefaultDS" scope="Shareable"
    type="javax.sql.DataSource"/>
    <ResourceParams name="UserDatabase">
    <parameter>
    <name>factory</name>
    <value>org.apache.catalina.users.
    MemoryUserDatabaseFactory</value>
    </parameter>
    <parameter>
    <name>pathname</name>
    <value>conf/tomcat-users.xml</value>
    </parameter>
    </ResourceParams>
    <ResourceParams name="jdbc/DefaultDS">
    <parameter>
    <name>validationQuery</name>
    <value></value>
    </parameter>
    <parameter>
    <name>user</name>
    <value>sa</value>
    </parameter>
    <parameter>
    <name>maxWait</name>
    <value>5000</value>
    </parameter>
    <parameter>
    <name>maxActive</name>
    <value>4</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>sa</value>
    </parameter>
    <parameter>
    <name>url</name>
    <value>jdbc:odbc:JBoss-SQL://localhost:1433;databaseName=Development;selectMethod=cursor;</value>
    </parameter>
    <parameter>
    <name>driverClassName</name>
    <value>sun.jdbc.odbc.JdbcOdbcDriver</value>
    </parameter>
    <parameter>
    <name>maxIdle</name>
    <value>2</value>
    </parameter>
    </ResourceParams>
    </GlobalNamingResources>
    <!-- Define the Tomcat Stand-Alone Service -->
    <Service name="Tomcat-Standalone">
    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
    port="8080" minProcessors="5" maxProcessors="75"
    enableLookups="true" redirectPort="8443"
    acceptCount="100" debug="0" connectionTimeout="20000"
    useURIValidationHack="false" disableUploadTimeout="true" />
    <!-- Note : To disable connection timeouts, set connectionTimeout value
    to -1 -->
    <!-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -->
    <!--
    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
    port="8443" minProcessors="5" maxProcessors="75"
    enableLookups="true"
    acceptCount="100" debug="0" scheme="https" secure="true"
    useURIValidationHack="false" disableUploadTimeout="true">
    <Factory className="org.apache.coyote.tomcat4.CoyoteServerSocketFactory"
    clientAuth="false" protocol="TLS" />
    </Connector>
    -->
    <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
    port="8009" minProcessors="5" maxProcessors="75"
    enableLookups="true" redirectPort="8443"
    acceptCount="10" debug="0" connectionTimeout="0"
    useURIValidationHack="false"
    protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/>
    <!-- Define an AJP 1.3 Connector on port 8009 --><Logger className="org.apache.catalina.logger.FileLogger"
    prefix="catalina_log." suffix=".txt"
    timestamp="true"/>
    <!-- Define the default virtual host -->
    <Host name="localhost" debug="0" appBase="webapps"
    unpackWARs="true" autoDeploy="true">
    <Logger className="org.apache.catalina.logger.FileLogger"
    directory="logs" prefix="localhost_log." suffix=".txt"
    timestamp="true"/>
    <Environment name="maxExemptions" type="java.lang.Integer"
    value="15"/>
    <Parameter name="context.param.name" value="context.param.value"
    override="false"/>
    <Resource name="jdbc/DefaultDS" auth="container" type="javax.sql.DataSource"/>
    <ResourceParams name="jdbc/DefaultDS">
    <!-- Maximum number of dB connections in pool.
    Set to 0 for no limit.
    -->
    <parameter>
    <name>maxActive</name>
    <value>8</value>
    </parameter>
    <!-- Maximum number of idle dB connections to retain in pool.
    Set to 0 for no limit.
    -->
    <parameter>
    <name>maxIdle</name>
    <value>4</value>
    </parameter>
    <!-- Maximum time to wait for a dB connection to become available
    in ms, in this example 10 seconds. An Exception is thrown if
    this timeout is exceeded. Set to -1 to wait indefinitely.
    -->
    <parameter>
    <name>maxWait</name>
    <value>5000</value>
    </parameter>
    <!-- MS Sql Server dB username and password for dB connections
    -->
    <parameter>
    <name>user</name>
    <value>sa</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>sa</value>
    </parameter>
    <!-- Class name for MS Sql Server JDBC driver
    -->
    <parameter>
    <name>driverClassName</name>
    <value>sun.jdbc.odbc.JdbcOdbcDriver</value>
    </parameter>
    <!-- The JDBC connection url for connecting to MS Sql Server dB.
    -->
    <parameter>
    <name>url</name>
    <value>jdbc:odbc:JBoss-SQL://localhost:1433;databaseName=Development;selectMethod=cursor;</value>
    </parameter>
    <!-- This Databae Connection Pool Description.
    -->
    <parameter>
    <name>description</name>
    <value>JDBC Driver: sun.jdbc.odbc.JdbcOdbcDriver</value>
    </parameter>
    </ResourceParams>
    <Resource name="mail/Session" auth="Container"
    type="javax.mail.Session"/>
    <ResourceParams name="mail/Session">
    <parameter>
    <name>mail.smtp.host</name>
    <value>localhost</value>
    </parameter>
    </ResourceParams>
    <ResourceLink name="linkToGlobalResource"
    global="simpleValue"
    type="java.lang.Integer"/>
    </Host>
    </Engine>
    </Service>
    </Server>
    and my web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    <!-- Standard Action Servlet Mapping -->
    <web-app>
    <resource-ref>
    <res-ref-name>jdbc/DefaultDS</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </web-app>
    and JBoss-SQL is data source I created from control panel settings and here is way I am retrieving connetion
    InitialContext initCtx = new InitialContext();
    DataSource ds = (DataSource) initCtx.lookup("java:comp/env/jdbc/DefaultDS");
    Connection con = ds.getConnection();
    return con;
    I tried connecting as mentioned in this website
    http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html#Common%20Problems.But didn't help
    Please help urgent
    Sorry for long file. Can any one please help me in solving this problem.
    Thanks in advnace
    Kurakula

    I'd recommend that you not use the JDBC-ODBC bridge driver to connect to SQL Server. M$ and jTDS are two free type IV JDBC drivers that you should use instead. Put those JARs in the WEB-INF/lib directory.
    The database URL you're using is not correct if you change drivers. Consult the docs to find out what the proper syntax is.
    MOD

  • I am trying to create another email account with talk talk. and I keep getting a failed message saying 'mail could not log into the mail server talk talk. Yet I already have another email account with talk talk. Not sure what I am doing wrong

    I am trying to create another email account with Talktalk. I already have one account.
    I try to input the new email address and password and get a failed message
    'Mail could not lot into the mail server talktalk.net.
    I have tried several times and keep getting the same message.
    Any ideas

    Accessing your emails from any computer connected to the Internet or from a Smart phone should be straightforward.
    For help on how to set up your e-mail on some of the most common software applications and devices, see How do I set up my TalkTalk email?
    If your software application or device isn't listed, all you need to connect to your TalkTalk e-mail mailbox are the TalkTalk e-mail settings. Make sure you use the right email settings for your specific email address.
    TalkTalk email addresses only
    Login / Username
    [email protected]
    [email protected]
    Incoming mail server
    mail.talktalk.net
    mail.talktalk.net
    Incoming Port
    110
    143
    Outgoing mail server
    smtp.talktalk.net
    smtp.talktalk.net
    Outgoing Port
    587
    587
    Outgoing SSL
    Yes
    Yes
    Outgoing Authentication
    Yes
    Yes

  • Application hangs while trying to create a socket

    Hello,
    We have a third party application that makes HTTP connections using a old version of HTTPClient. Recently we have run into problems where the application hangs as one thread seems to hang while trying to create a socket (thread dumps show the hang occurs in native code) and other threads end up waiting for this thread as they need to obtain a lock on HTTPClient.HTTPConnection. We found out that HTTPClient was not setting a timeout on the underlying socket (SO_TIMEOUT) and the relevant patch has been implemented in the hope that if the condition arises again the offending thread will be timed out and allow other threads to try and continue.
    We will not be able to see if the patch works until Monday and I would like to understand the problem a little better if it fails. My question at what point will the socket timeout starting ticking? As our offending thread is waiting in native code is there a chance that the timeout will not be "active".
    Also can anyone provide reasons for an application hanging while trying to create a socket and any suggestions for monitoring or mitigating this problem?
    Thanks a lot.
    Sun Solaris 5.8
    JDK 1.4.1 b02

    It looks like our version of the JDK offer a connect method with a timeout value, I think this will do the trick.

  • I have 2 id apple. 1of them don´t recongize my adress in Brazil. I tried to create another account but the ipad refuse it. I´d like to exclude these 2 accounts and creat a new account with my same email. How can I do it?

    I have 2 accounts at ID apple. One of them the system don´t recongize my addres in Brazil, I tried to create another account but the ipad refuse it.
    I´d like to exclude my accounts and creat another account with my same email. How can I do It?

    I don't know if that works on the iPhone, but....
    View your SETTINGS and choose ICLOUD. That will give you your cloud settings. At the very bottom it has a delete button. Click it an see what happens. After deleting the account (and potentially loosing data connected with it) you should be able to log in to iCloud using your old id.

  • TS4002 I'm trying to create a new apple-id but when typing the email adress I want to use I'm told that the particular email adress is not allowed but when searching I can't find same being used. How do I find out where that particular email adress is use

    I'm trying to create a new apple-id but when typing the email adress I want to use I'm told that the particular email adress is not allowed When searching I can't find same being used anywhere. How do I find out where that particular email adress is used so I can delete it there and use it for my new apple-id?

    Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
    iOS: Wrong passcode results in red disabled screen                         
    If recovery mode does not work try DFU mode.                        
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings        
    For how to restore:
    iTunes: Restoring iOS software
    To restore from backup see:
    iOS: How to back up     
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload most iTunes purchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store        
    Also
    If you have Find My iPhone enabled, you can use Remote Wipe to erase the contents of your device. If you have been using iCloud to back up, you may be able to restore the most recent backup to reset the passcode after the device has been erased.

  • Error trying to create a Power View report against a Multi Dimensional SSAS cube

    Hi all,
    We have installed the Power View For Multidimensional Models CTP, released last November 27 on our Analysis Server instances.  I am now trying to create a Power View report in SharePoint that is connected to a Multi-Dimensional cube.
    I have followed the instructions diligently:
    1. Install the CTP
    2. Created a data connection of type "Microsoft BI Semantic Model for Power View" (see attachment #1)
    3. Tested that the connection was valid (all is good here!)
    I then select the "Create Power View Report" option from the data connection that I created above.
    The Power View GUI appears, and then throws an error:
    Error text:
    "An error occurred while loading the model for the item or data source 'http://server/site/SalesVarianceAnalysis_MDX.rsds'. Verify that the connection information is correct and that you have permissions to access the data source."
    The details of the error are:
    <detail><ErrorCode xmlns="rsCannotRetrieveModel</ErrorCode><HttpStatus">http://www.microsoft.com/sql/reportingservices">rsCannotRetrieveModel</ErrorCode><HttpStatus
    xmlns="400</HttpStatus><Message">http://www.microsoft.com/sql/reportingservices">400</HttpStatus><Message xmlns="An">http://www.microsoft.com/sql/reportingservices">An
    error occurred while loading the model for the item or data source 'http://hubtest/sites/broadcasting/thewowzone/Data Connections/SalesVarianceAnalysis_MDX.rsds'. Verify that the connection information is correct and that you have permissions to access the
    data source.</Message><HelpLink xmlns="http://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&EvtID=rsCannotRetrieveModel&ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=11.0.3000.0</HelpLink><ProductName">http://www.microsoft.com/sql/reportingservices">http://go.microsoft.com/fwlink/?LinkId=20476&amp;EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&amp;EvtID=rsCannotRetrieveModel&amp;ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&amp;ProdVer=11.0.3000.0</HelpLink><ProductName
    xmlns="Microsoft">http://www.microsoft.com/sql/reportingservices">Microsoft SQL Server Reporting Services</ProductName><ProductVersion xmlns="11.0.3000.0</ProductVersion><ProductLocaleId">http://www.microsoft.com/sql/reportingservices">11.0.3000.0</ProductVersion><ProductLocaleId
    xmlns="127</ProductLocaleId><OperatingSystem">http://www.microsoft.com/sql/reportingservices">127</ProductLocaleId><OperatingSystem xmlns="OsIndependent</OperatingSystem><CountryLocaleId">http://www.microsoft.com/sql/reportingservices">OsIndependent</OperatingSystem><CountryLocaleId
    xmlns="1033</CountryLocaleId><MoreInformation">http://www.microsoft.com/sql/reportingservices">1033</CountryLocaleId><MoreInformation xmlns="<Source>ReportingServicesLibrary</Source><Message">http://www.microsoft.com/sql/reportingservices"><Source>ReportingServicesLibrary</Source><Message
    msrs:ErrorCode="rsCannotRetrieveModel" msrs:HelpLink="http://go.microsoft.com/fwlink/?LinkId=20476&amp;EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&amp;EvtID=rsCannotRetrieveModel&amp;ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&amp;ProdVer=11.0.3000.0"
    xmlns:msrs="An">http://www.microsoft.com/sql/reportingservices">An error occurred while loading the model for the item or data source '<omitted for security purposes>.
    Verify that the connection information is correct and that you have permissions to access the data source.</Message><MoreInformation><Source></Source><Message>For more information about this error navigate to the report server
    on the local server machine, or enable remote errors</Message></MoreInformation></MoreInformation><Warnings xmlns="http://www.microsoft.com/sql/reportingservices" /></detail>
    So, I can connect with the connection, but I get an error when connecting with Power View. 
    Any suggestions are appreciated.
    Thanks...
    /Peter
    Peter

    Hi Peter - are you specifying the cube name in the connection string?
    Data Source=[server];Initial Catalog=AdventureWorksDW-MD;Cube='Adventure Works'
    Check out
    http://blogs.msdn.com/b/analysisservices/archive/2012/12/09/power-view-for-multidimensional-models-feature-drill-down.aspx

Maybe you are looking for

  • How do I remove one of the calendars from iCloud but keep it on the iPhone to sync with Outlook by USB and keep the other calendars synced on iCloud ?

    iPhone 5, Macs and iPads at home, Windoze7 system at work.  Using iCloud to sync calendars, contacts, etc on all the home devices.  Used USB cable to sync at work with the Windows system, with the Outlook 2010 corporate account (corporate server).  I

  • For loop vs Iterator

    I'm writing an application in which performance will be quite important and was looking into my collection classes. I recently saw the move towards using Iterator instead of for loops, while loops to retrieve objects from a List. I wanted to test to

  • As SYSDBA from VB 6.0

    Hi. How can I connect me as sysdba since Visual Basic, my ConnectionString is: ConnectionString = "Data Source=" & ServiceOraDb & ";User ID=" & pUser & ";Password=" & pass & ";" The result is: Error #-2147467259: PRAYS-01017: invalid username/passwor

  • How to find WSDL url for a portlet

    Hi, I am using webcenter 11.1.1.4. I have created one portlet and successfully deployed in application server. For registering portlet into webcenter i have to enter WSDL url. After deploying portlet i didnt get WSDL url. After completion of deployme

  • Automatically creating an internal requistion from an order

    Is it possible to create an internal requisition from an sales order automatically? I can create a purchase requisition easily, but cannot get it to create an internal requisition to create an internal sales order. I have the following 1) Internal cu