Can't sqlj use datasource?urgent!

I write a sqlj like this
line 27: #sql context MyContext;
line 51-80:
myctx = new MyContext(conn);//conn is a connection retrieve from datasource
#sql [myctx]
select
                         certtypeid,certnum,to_char(custid),custname,
                         to_char(custcrdt),to_char(inblklstdate,'yyyy-mm-dd hh24:mi:ss'),
                         inblklstreason,stat,rmk
                    into
                         :(blacklistOut.certtypeid),
                         :(blacklistOut.certnum),
                         :(blacklistOut.custid),
                         :(blacklistOut.custname),
                         :(blacklistOut.custcrdt),
                         :(blacklistOut.inblklstreason),
                         :(blacklistOut.stat),
                         :(blacklistOut.rmk)
                    from tab_custblklst
                    where custid = to_number(:(CustID))
the Exception is
java.lang.IllegalArgumentException: java.sql.SQLException:
getClientData is not supported by the Weblogic JDBC Drivers
What's wrong? what is getClientData? Why not supported by Weblogic JDBC
Drivers

Hi Mike,
currently, I am trying to connect our SAP NetWeaver Portal to an ADAM. I successfully read users and groups from ADAM. However, I am not able to write any objects to the ADAM. My user has full admin rights.
The error message is like yours:
ldap: error code 16 - 00000057: Ldaperr: DSID-0C090B3D, comment: error in attribute conversion operation, data o, va28
If you solved the problem could you please describe how to fix it.
Best regards,
Martin

Similar Messages

  • My BB9810 refuse to load OS7.1 software on my phone after the download has completed. My phone has freezed/stucked since morning. Pls urgent help/assistant needed as I can not access/use my phone for over 24hrs now.

    My BB9810 refuse to load OS7.1 software on my phone after the download has completed. My phone has freezed/stucked since morning. Pls  urgent help/assistant needed as I can not access/use my phone for over 24hrs now.

    Hi there,
    Use the method described in the link below to get back up and running:
    http://supportforums.blackberry.com/t5/Device-software-for-BlackBerry/How-To-Reload-Your-Operating-S...
    I hope this info helps!
    If you want to thank someone for their comment, do so by clicking the Thumbs Up icon.
    If your issue is resolved, don't forget to click the Solution button on the resolution!

  • How can i using datasource in toplink's map file

    In the TopLink map :
    <toplink:login xsi:type="toplink:database-login">
    <toplink:platform-class>oracle.toplink.platform.database.oracle.Oracle10Platform</toplink:platform-class>
    <toplink:user-name>test</toplink:user-name> <toplink:password>C23487CFA591952D44310804F3D591CB</toplink:password>
    <toplink:sequencing>
    <toplink:default-sequence xsi:type="toplink:native-sequence">
    <toplink:preallocation-size>1</toplink:preallocation-size>
    </toplink:default-sequence>
    </toplink:sequencing>
    <toplink:driver-class>oracle.jdbc.driver.OracleDriver</toplink:driver-class>
    <toplink:connection-url>jdbc:oracle:thin:@192.168.0.1:1521:testdb</toplink:connection-url>
    <toplink:bind-all-parameters>true</toplink:bind-all-parameters>
    </toplink:login>
    How can i modify it using datasource?

    The login information stored in the map file is good for direct connection and design time login information.
    For your runtime login information I would use the sessions configuration (sessions.xml). It provides complete deployment configuration:
       <session>
          <name>my-session</name>
          <!-- This references the ORM map XML file -->
          <project-xml>META-INF/employee-basic.xml</project-xml>
          <session-type>
             <server-session/>
          </session-type>
          <login>
             <datasource>jdbc/TopLinkDS</datasource>
             <uses-external-connection-pool>true</uses-external-connection-pool>
             <uses-external-transaction-controller>true</uses-external-transaction-controller>
          </login>
          <external-transaction-controller-class>oracle.toplink.essentials.transaction.oc4j.Oc4jTransactionController</external-transaction-controller-class>
          <enable-logging>true</enable-logging>
          <logging-options>
             <log-exceptions>true</log-exceptions>
             <print-thread>false</print-thread>
             <print-date>false</print-date>
          </logging-options>
       </session>Doug

  • Can IdM be used as LDAP directory and UME datasource?

    Hi,
    I am trying to figure out what IDM can and cannot do.
    Can IDM be used as a LDAP datasource in its own right for a SAP Portal for example?
    Or do you still have to use an external LDAP directory and IDM is then only used to pull everything together from all systems?
    Thanks,
    Adriaan

    Hi Adriaan,
    it should be tecnically possible to use the Virtual Directory Server as a LDAP datasource for portal, but you probably have to edit the datasource.xml of portal and the connection.
    I'd rather use the portal database or a dedicated LDAP for that and use IdM to provision into this repository.
    Regards,
    Andreas

  • Where can I find how to use DataSource?

    Hi,
    I am quite new to JDBC and is writing some small database program. I find many examples use DataSource, I want to know how to use it, but cannot find the API in the docs section of java.com.
    Can anyone point me to the location of javax.sql.DataSource, or even better some examples of using DataSource?
    Also, I am using Oracle as my database, do I need to register the oracle driver first for DataSource first also?
    Any help will be approcaited.

    Hi,
    You can get the more detailed documentation at
    http://java.sun.com/j2se/1.4/docs/api/javax/sql/DataSource.html and please visit http://www.datadirect-technologies.com/download/docs/jdbc/jdbcref/usejdbc.htm for information on how to connect to database using datasources.
    Hope this helps.
    With Regards
    Gayam_Slash

  • How can I look up DataSource from one EJB to the other EJB?

    Image that, I have 3 databases:
    DB1
    DB2
    DB3,
    And then, 03 DataSources is deployed in DS EJB, named DataSource1, DataSource2, DataSource3.
    In the other App EJB, I have Connection Management function, as follows:
    public Connection getConnection(databaseKey) {
    if (databaseKey.equals("DB1")){
    connection = remote.lookup("DataSource1");
    }else if (databaseKey.equals("DB2")){
    connection = remote.lookup("DataSource2");
    }else if (databaseKey.equals("DB3")){
    connection = remote.lookup("DataSource3");
    return connection;
    How can I access DataSource 1,2,3 from the other EJB? How to config EJB server for that?
    Thanks in advance!
    Now, I have the other App EJB. Some class will require one of the above DataSource from DS EJB through function getConnection(databaseKey){}

    I strongle suggest you to use a ServiceLocator for this . It will be very easy to identify.Go to the sun home page and look for a servicelocator pattern.You can even directly use that code for you.

  • This domain name can't be used because it contains a protected word or inappropriate language.

    Dear
    Creating a Microsoft services experience for my domain (fazlic.ba), is showing an error message as below:
    "This domain name can't be used because it contains a protected word or inappropriate language. Please contact support if you feel this is not the case."
    Can somone help in resolving this issue as i need this bit urgent and i am trying for same since last 2 days but with no success
    My domain name is fazlic.ba, which needs to be added as custom domain in domain.live.com
    Thanks

    Hi,
    we cannot provide any solution here because the domain validation is the second step of the process and is automated.
    My advice wouldbe to follow the message guideline and contact the support, they may identify why this domain is refused.
    Hope this helps,
    Fabrice DI GIULIO, http://blog.digiulio.fr
    Technical Solutions Professional, EMEA at AvePoint

  • When is it appropriate to use DataSource (or Connection pooling)?

    Hello all,
    I'm having some design issues with my application and I'm starting to think that maybe using Connection pooling is not suited for my application. I'm using Tomcat 5.5.12 if it's any relevant..
    The architecture of our application looks like this:
    Servlets -> App Helper classes -> DB/Accessor classes
    looks like the three-tier architecture described in this document: http://www.subrahmanyam.com/articles/servlets/ServletIssues.html
    I have read on the Tomcat docs that said that using DataSource is good practice and improves efficiency since it recycles database connections. However, if the accessor/DB classes are not servlets, how can I use the DataSource facility that interacts with Tomcat?
    I would like to know whether it is a good idea to use DataSource in my case and if so, how? (since they are not servlets)
    Thanks in advance :)

    Hi. Thank you for replying.
    In the examples that I've seen that use JNDI for Database access, it seems that DataSource is always used--in other words, JNDI and DataSource always seem to be used together (in Servlets). I have not found a case where JNDI is used by itself to access the Database--perhaps I'm not looking in the right place. Could you point me to some documentation maybe?
    Thanks a lot!

  • How to use datasources to connect to database ?

    I have the following Problem
    I have two identical databases, one is the development database, the other one the production database.
    Now I need to find a way, how I can deploy an bc4j-application in local mode that way, that if the application is deployed to server 1 it connects to database 1 and if deployed to server 2 it connects to database 2.
    JDBC connection strings do not work as the connection is deployed with the application. So the application always connects to the same database.
    I thought datasources might be the solution. So I tried to define a datasource MyDS in the data-sources.xml file and specified it in the Configuration Wizard as the connection to use.
    But unfortunately this does not work and i do not know why:
    If I try to connect using the tester and using this datasource I get the following exception:
    Level #3: javax.naming.noInitialContextException
    Can anyone help me, what this means? How can I get around this using the BC4J Framework? Is there any "HowTo" Document which describes using datasources with BC4J?

    Frank,
    I've sorted this stuff out to some extent. Have a look at this thread:
    re:? How: multiple myAppWar.ear to use OC4J's data-sources.xml pooling?
    If this isn't all you need, then search on data-source.xml
    and read other threads also I may have posted helps on
    other threads so if you search on data-source.xml and my handle (curt504) it brings up all the threads that I posted to.
    Not to say I've solved all your problems, but I solved mine anyway. :)
    Good luck,
    curt

  • Urg Problem with using DataSources in Tomcat

    I am trying to use DataSource in Tomcat4.0
    I have a simple jsp file as shown below:=
    <html>
    <head>
    <title>DB Test using DataSource</title>
    </head>
    <body>
    <%
    foo.DBTest dbt = new foo.DBTest();
    dbt.init();
    %>
    <h2>Results</h2>
    Foo <%= dbt.getFoo() %>
    Bar <%= dbt.getBar() %>
    </body>
    </html>
    and a Servlet by the name of DBTest as shown below:-
    package foo;
    import javax.naming.*;
    import javax.sql.*;
    import java.sql.*;
    public class DBTest
    String foo = "Not Connected";
    int bar = -1;
    public void init()
    try
         System.out.println("Inside INIT of DBTest");
    Context ctx = new InitialContext();
    Context envCtx = (Context)ctx.lookup("java:comp/env");
    if(ctx == null )
    throw new Exception("Boom - No Context");
    //DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/TestDB");
    DataSource ds = (DataSource)envCtx.lookup("jdbc/TestDB");
    if (ds != null)
    Connection conn = ds.getConnection();
    if(conn != null)
    foo = "Got Connection "+conn.toString();
    Statement stmt = conn.createStatement();
    ResultSet rst = stmt.executeQuery("select id, foo, bar from testdata");
    if(rst.next())
    foo=rst.getString(2);
    bar=rst.getInt(3);
    conn.close();
    }catch(Exception e)
    e.printStackTrace();
    }//end of init
    public String getFoo() { return foo; }
    public int getBar() { return bar;}
    }//end of class
    I modified my server.xml file to include this:=
    <!-- Tomcat My DataSource Testing Context -->
    <Context path="/DBTest" docBase="C:\Program Files\Apache Tomcat 4.0\webapps\DBTest"
    debug="5" reloadable="true" crossContext="true">
    <Logger className="org.apache.catalina.logger.FileLogger"
    prefix="localhost_DBTest_log." suffix=".txt"
    timestamp="true"/>
    <Resource name="jdbc/TestDB"
    auth="Container"
    type="javax.sql.DataSource"/>
    <ResourceParams name="jdbc/TestDB">
    <parameter>
    <name>factory</name>
    <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
    </parameter>
    <parameter>
    <name>maxActive</name>
    <value>5</value>
    </parameter>
    <parameter>
    <name>maxIdle</name>
    <value>2</value>
    </parameter>
    <parameter>
    <name>maxWait</name>
    <value>10000</value>
    </parameter>
    <parameter>
    <name>username</name>
    <value>system</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>manager</value>
    </parameter>
    <parameter>
    <name>driverClassName</name>
    <value>oracle.jdbc.OracleDriver</value>
    </parameter>
    <parameter>
    <name>url</name>
    <value>jdbc:oracle:thin:@localhost:1521:Test2</value>
    </parameter>
    </ResourceParams>
    </Context>
    <!-- Tomcat My DataSource Testing Context -->
    and my web.xml file is as shown below:=
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app PUBLIC
    "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <description>Oracle DataSource Test App</description>
    <resource-ref>
    <description>DB Connection</description>
    <res-ref-name>jdbc/TestDB</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </web-app>
    Now when i start Tomcat and try to access the jsp page i get this error in Tomcat Console:=
    Inside INIT of DBTest
    javax.naming.NamingException: Cannot create resource instance
    at org.apache.naming.NamingContext.lookup(NamingContext.java:837)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
    at foo.DBTest.init(DBTest.java:25)
    at org.apache.jsp.test$jsp._jspService(test$jsp.java:60)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspSer
    vlet.java:202)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
    82)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
    alve.java:243)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
    alve.java:201)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:
    2344)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
    ava:164)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:566)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatche
    rValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:564)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
    ava:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:564)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
    462)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
    ve.java:163)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcesso
    r.java:1011)
    at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.ja
    va:1106)
    at java.lang.Thread.run(Unknown Source)
    Why is this happening .
    I am making sure the resource name in server.xml and web.xml are the same
    Any Help highly appreciated
    Thanks
    Raj

    Hi rajess_kr,
    Looks to me like you're pretty close.
    I'm assuming that you've got the JDBC driver JAR in TOMCAT_HOME/common/lib. The JAR containing your data source factory class org.apache.commons.dbcp.BasicDataSourceFactory should be in that directory, too. Since you're using Oracle, I'd also suggest that you repackage classes12.zip as a JAR file if it's not already a JAR.
    I think the JNDI lookup string should be "java:comp/env/jdbc/TestDB".
    I've got a working example on my desktop at work, but I don't seem to have one here at home. I'll give it a look on Monday and see if I can provide more details. It looks to me like you're not very far off. - MOD

  • How can I asociate a DataSource to a Port for my Video Capture Card???

    Hi!
    First of all, I sorry for my bad english.
    I'm trying to manage ports of my Video Capture Card.It's 4 ports. I believe I can manage it cause running this code I found in a web, I can see a panel called Video Source that contain all my capture devices (the capturer card too) and the four ports. Ports have been asociate like SVIDEO, TVTUNNER, COMPOSITE, COMPOSITE2. I'm trying use PortControl, but I don't ontain nothing. I'm learning java for around only three weeks, I don't know very much.
    My question: How can I asociate a DataSource to a Port for my Video Capture Card and so manage 4 streamings data . Should I work Port Control over a medialocator, a datastream, a player...?
    I'm looking forward your answers. I'm very sad cause this problem.
    Thanx for advance!

    xinixmayur, please don't post in threads that are long dead. When you have a question, start your own topic. Feel free to provide a link to an old post that may be relevant to your problem.
    I'm locking this thread now.
    db

  • Help! use DataSource in Tomcat

    I configure server.xml and web.xml in tomcat to use DataSource
    server.xml is
    <Resource name="jdbc/jsptest" auth="Container"
                   type="javax.sql.DataSource"/>
                   <ResourceParams name="jdbc/jsptest">                    
    <parameter><name>user</name><value>aa</value></parameter>
    <parameter><name>password</name><value>aa</value></parameter>
    <parameter><name>driverClassName</name>
    <value>sun.jdbc.odbc.JdbcOdbcDriver</value></parameter>
    <parameter><name>driverName</name>
    <value>jdbc:odbc:ejbtest</value></parameter>
    </ResourceParams>
    and the web.xml is
    <web-app>
    <resource-ref>
    <description>Resource reference to a factory for java.sql.Connection instances that may be used for talking to a particular database that is configured in the server.xml file.</description>
    <res-ref-name>jdbc/jsptest</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    <res-sharing-scope>Sharable</res-sharing-scope>
    </resource-ref>
    </web-app>
    but ,when I run my jsp ,it always throws
    TyrexDataSourceFactory: Cannot create DataSource, Exception
    java.lang.ClassNotFoundException: org.hsql.jdbcDriver
    I didn't use org.hsql.jdbcDriver ,so I change other jdbc Drivers and receive same
    result,why?
    Thank everyone ,it drives me crazy!

    Dear kbpv43a
    here iam facing the same problem as "ClassNotFoundException: org.hsql.JDBCDriver" even after iam using thin driver for oracle database. i already commented as i dont know where i missed to close
    the /> end tag. but still its throwing the same exception.
    can u please help me by just going through my program and suggest me
    where i committed mistake..??
    here are my server.xml,web.xml and servletApplication for gettting conection from the pool using thin driver for oracle using Tomcat4.0.4
    version.
    thanx.
    server.xml
    <Server port="8005" shutdown="SHUTDOWN" debug="0">
              <!-- Tomcat Stand-Alone Service -->
    <Service name="Tomcat-Standalone">
         <!-- Non-SSL HTTP/1.1 Connector on port 8080 -->
    <Connector className="org.apache.catalina.connector.http.HttpConnector"
    port="8080" minProcessors="5" maxProcessors="75"
    enableLookups="true" redirectPort="8443"
    acceptCount="10" debug="0" connectionTimeout="60000"/>
              <!-- AJP 1.3 Connector on port 8009 -->
    <Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
    port="8009" minProcessors="5" maxProcessors="75"
    acceptCount="10" debug="0"/>
              <!-- Top level container in our container hierarchy -->
    <Engine name="Standalone" defaultHost="localhost" debug="0">
         <!-- Global logger unless overridden at lower levels -->
    <Logger className="org.apache.catalina.logger.FileLogger"
    prefix="catalina_log." suffix=".txt"
    timestamp="true"/>
         <!-- Because this Realm is here, an instance will be shared globally
              <Realm className="org.apache.catalina.realm.MemoryRealm" /> -->
    <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
              driverName="oracle.jdbc.driver.OracleDriver"
                   connectionURL="jdbc:oracle:thin:@oracle:1521:ORCL"
    connectionName = "mail"
    connectionPassword = "mail"
              userTable="users" userNameCol="user_name" userCredCol="user_pass"
                   userRoleTable="user_roles" roleNameCol="role_name" />
                   <!-- Define the default virtual host -->
    <Host name="localhost" debug="1" appBase="webapps" unpackWARs="true">
         <Valve className="org.apache.catalina.valves.AccessLogValve"
         directory="logs" prefix="localhost_access_log." suffix=".txt"
         pattern="common"/>
    <Logger className="org.apache.catalina.logger.FileLogger"
    directory="logs" prefix="localhost_log." suffix=".txt"
         timestamp="true"/>
                   <!-- Tomcat Root Context -->
                   <!-- Tomcat Manager Context -->
    <Context path="/manager" docBase="manager" debug="0" privileged="true"/>
    <!-- My context, username=good and password=bad for my oracle to connect -->
         <Context path="/localhost" docBase="localhost" debug="0" reloadable="false" override="true">
              <Resource name="jdbc/myConnection" auth="Container" type="javax.sql.DataSource"/>
              <ResourceParams name="jdbc/myConnection">
                   <parameter><name>user</name><value>good</value></parameter>
                   <parameter><name>password</name><value>bad</value></parameter>
                   <parameter><name>driverClassName</name><value>oracle.jdbc.driver.OracleDriver</value></parameter>
                   <parameter>
                        <name>url</name>
                        <value>jdbc:oracle:thin:@oracle:1521:ORCL</value>
                   </parameter>
                   <parameter>
                        <name>maxActive</name>
                        <value>32</value>
                   </parameter>
                   <parameter>
                        <name>maxIdle</name>
                        <value>10</value>
                   </parameter>
              </ResourceParams>
    <!-- end of MY Context -->
                   <!-- Tomcat Examples Context
    <Context path="/examples" docBase="examples" debug="0" reloadable="true" crossContext="true">
    -->
    <!--
    <Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_examples_log." suffix=".txt" timestamp="true"/>
         <Ejb name="ejb/EmplRecord" type="Entity" home="com.wombat.empl.EmployeeRecordHome" remote="com.wombat.empl.EmployeeRecord"/>
    <Environment name="maxExemptions" type="java.lang.Integer" value="15"/>
    <Parameter name="context.param.name" value="context.param.value" override="false"/>
    <Resource name="jdbc/EmployeeAppDb" auth="SERVLET" type="javax.sql.DataSource"/>
    <ResourceParams name="jdbc/EmployeeAppDb">
    <parameter><name>user</name><value>sa</value></parameter>
    <parameter><name>password</name><value></value></parameter>
    <parameter><name>driverClassName</name><value>org.hsql.jdbcDriver</value></parameter>
    <parameter><name>driverName</name><value>jdbc:HypersonicSQL:database</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>
    -->
    </Context>
    </Host>
    </Engine>
    </Service>
         <!-- Define an Apache-Connector Service -->
    <Service name="Tomcat-Apache">
    <Connector className="org.apache.catalina.connector.warp.WarpConnector"
    port="8008" minProcessors="5" maxProcessors="75"
    enableLookups="true" appBase="webapps"
    acceptCount="10" debug="0"/>
    <Engine className="org.apache.catalina.connector.warp.WarpEngine"
    name="Apache" debug="0">
    <Logger className="org.apache.catalina.logger.FileLogger"
    prefix="apache_log." suffix=".txt"
    timestamp="true"/>
              <Realm className="org.apache.catalina.realm.MemoryRealm" />
    </Engine>
    </Service>
    </Server>
    web.xml
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <servlet>
    <servlet-name>conServlet</servlet-name>
    <servlet-class>conServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>conServlet</servlet-name>
    <url-pattern> /conServlet </url-pattern>
    </servlet-mapping>
    <resource-ref>
    <description> Resource reference to java.sql.Connection
    factory defined in server.xml
    </description>
    <res-ref-name>jdbc/myConnection</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </web-app>
    Servlet Application:
    public void service(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException
         res.setContentType("text/html");
         PrintWriter out = res.getWriter();
    //Ordinary jdbc connection      
                   //DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
                   //con=DriverManager.getConnection("jdbc:oracle:thin:@oracle:1521:ORCL","mail","mail");
                   //out.println("Your con=="+con);
    try
    // jdbc connection from pool
         Context initCtx = new InitialContext();
    Context envCtx = (Context)initCtx.lookup("java:/comp/env");
    DataSource ds = (DataSource)envCtx.lookup("jdbc/myConnection");
    conn = ds.getConnection();
         out.println("conn : " + conn);
    conn.close();
         catch (Exception e)
         out.println("conn failed : " + e);
    Note: my oralce username is "good" and password is "bad"
    here

  • Using datasources: How to manage transactions when perform. update/insert?

    I've been trying to find information on how datasources manage transacctions but I've been unable to find much information. I've read that for XA datasources you dont have to commit, save and rollback manually, but how are transactions managed for non-XA datasouces?+ I've only seen examples with select statements, such as in the example on this page [this page|http://developers.sun.com/jscreator/reference/techart/2/jdbc.html], but I've never seen a working example with insert and updates.
    Can anyone point me to some examples?*
    Also, when I use the DriverManager instead of the DataSource for doing updates/inserts I use the setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE) method. Can that be used with datasources?+
    Thank you <img class="emoticon" src="images/emoticons/laugh.gif" border="0" alt="" />

    If you are using a connection pool, how are you guaranteeing that you are using the same connection throughout the same application? Look at the following:
    1) You grab a connection from the pool
    2) You call procedure A
    3) You call procedure B and issue rollback in procedure
    4) You call procedure C
    5) You close your connection
    Are you saying you made changes in procedure A and when you issued a hard rollback in procedure B, the changes in A were not rolled back?
    I'm guessing the problem is that you are not issuing your statements using the same connection.

  • Retrieve db connection using datasource object

    The problem is: i can't retrieve the connection to database
    using datasource object in jsp.
    my jsp was build by Oracle9i Report Builder,then deployed
    to OC4J jsp container,
    i define the datasource at container level,
    but an error "log on not specified" arise.
    is it possible to use datasource object in such a way or not?
    thanks you for your help.

    What is the full Java and os versions you are using to compile and to run. Note that with JDEV the platform used for your code may be different than the platform used by JDEV itself.
    Please modify all of your exception handlers to print the stack trace. Add this as the first line in each handler.
    ex.printStackTrace();The stacktrace contains important information about where the problem really occured.
    See the Java docs for NamingException - http://docs.oracle.com/javase/6/docs/api/javax/naming/NamingException.html
    >
    This is the superclass of all exceptions thrown by operations in the Context and DirContext interfaces. The nature of the failure is described by the name of the subclass. This exception captures the information pinpointing where the operation failed, such as where resolution last proceeded to.
    •Resolved Name. Portion of name that has been resolved.
    •Resolved Object. Object to which resolution of name proceeded.
    •Remaining Name. Portion of name that has not been resolved.
    •Explanation. Detail explaining why name resolution failed.
    •Root Exception. The exception that caused this naming exception to be thrown.

  • Help me understand JDBC connections using DataSource objects

    I'm writing a simple Java server application that accepts connections from multiple clients via RMI, connects to a SQL Server 2000 database via Microsoft's SQL 2000 JDBC driver, gets some data, and returns it to the client. The server application will handle every SQL database connection. However, it must be able to establish multiple simultaneous connections, since multiple clients may connect at the same time and request data.
    Sounds like a simple multi-threaded server that utilizes a connection pool for database connectivity, right? Well, if I want to do that, I have to register a PooledDataSource object with JNDI. My server threads that are handling requests will simply grab connections out of the pool to retrieve data (presumably).
    This seems like a fairly simple server application; however, all the information and tutorials I've read on using DataSource objects for database connections rather than DriverManager.getConnection() mention XML config files, J2EE application servers, Tomcat, WebSphere, etc. I really don't want to have to deal with all that just to get connection pooling and not have to use the DriverManager.getConnection() method.
    Is there a simple way to use DataSource objects without installing a lot of extra junk on my server?

    Thanks, diazlara. Your response was exactly what I needed to know. All the information I've read prior to this suggested that I had to have a J2EE server running, and that I had to register the DataSource object with JNDI. If you ladies and gents could take a quick look at this and let me know if I'm doing it correctly, I'd appreciate it.
    As proflux suggested, I wrote a connection manager:
    import java.sql.*;
    import javax.sql.*;
    import com.microsoft.jdbcx.sqlserver.*;
    public class SQLConnectionManager {
       private static ConnectionPoolDataSource connectionPool;
       // Initialize the connection manager
       public SQLConnectionManager() {
          init();
       // Retrieve a connection from the connection pool and return it
       public static Connection getConnection() {
          Connection connection = null;
          try {
             connection = connectionPool.getPooledConnection("myUsername", "myPassword").getConnection();
          catch (SQLException ex) {
             System.err.println("A problem occurred while getting a connection from the pool.");
             ex.printStackTrace();
          return connection;
       // Initialize the datasource and connection pool
       private static void init() {
          SQLServerDataSource mds = new SQLServerDataSource();
          mds.setDescription("MS SQLServerDataSource");
          mds.setServerName("127.0.0.1");
          mds.setPortNumber(1433);
          mds.setDatabaseName("SomeTable");
          mds.setSelectMethod("cursor");
          connectionPool = (ConnectionPoolDataSource) mds;
    }As you can see, I'm hard-coding the username and password for testing purposes. I'll incorporate a login/authentication system for any production code that I use this in.
    Once the SQLConnectionManager is created, connections can be retrieved as follows:
          Connection connection = null;
          try {
             connection = SQLConnectionManager.getConnection();
             System.out.println("** Got a SQL database connection from the pool");
             DatabaseMetaData metaData = connection.getMetaData();
             ResultSet rs = metaData.getCatalogs();
             while (rs.next()) {
                System.out.println("\tcatalog: " + rs.getString(1));
             rs.close();
             connection.close();
          catch (SQLException ex) {
             System.out.println("An exception occurred while connecting to the SQL Database:");
             ex.printStackTrace();
          }So, how does that look? I tested it out, and it seems to work just fine. Using this code, I am getting a connection from a pool, correct? I want to make sure of that. Also, are there any inherent weaknesses or flaws with this method that I need to be aware of?
    Thanks so much for all the helpful responses.

Maybe you are looking for

  • QT file from 5D mark11 not recognized by anything

    Hi folks.  I've read the other forum entries with similar problems and I've surmised that there is meta data or some kind of directory structure corrupted or missing. The problem is I can't go back to source to rebuild because my friend pulled the fi

  • WebLogic 10.3.0, web-service enabled session beans, and CMT transactions

    Does WebLogic 10.3 support CMT for JAX-WS Web-Service enabled EJB 3.0 session beans? When a client invokes the following Web service: @WebService @Stateless @TransactionManagement( TransactionManagementType.CONTAINER ) public class TestService       

  • Cannot install due to registry errors.

    *NOTE TO SUPPORT STAFF: I DID NOT VIOLATE YOUR "SIGNATURE" RULES IN MY LAST THREAD, I DIDN'T EVEN INCLUDE A SIGNATURE. PLEASE ACTUALLY READ THE THREAD BEFORE YOU GO DELETING THINGS FOR NO REASON. ALL LINKS IN THIS THREAD ARE RELEVANT TO THE SUBJECT A

  • Billing date on rebill invoice

    Hello, This is a credit & rebill situation (due to tax error, for example). I'd like to be able to give the customer a new, corrected invoice with the same billing date as the original. However, if the credit & rebill is happening in a subsequent per

  • Deployment of BC4J JSP in Java web Server2.0

    I'm presently trying to deploy a BC4j Jsp into the Java Webserver , I have copied all the class , java and the JSP files in the JWS2.0 , but the error I get is as follows : Package oracle.jbo.* not found in import , Package javax.naming.* not found i