Connecting to a datasource.

I am replacing an existing form on my web site.  I have used MySQL to collect and store data.  Is it possible to connect Adobe Forms to my database?  Can I use the data on the form to create a text file to send to an FTP site?

The forms need to be created using the LiveCycle product. Acrobat no longer supports a database connection within the form. It is possible to export a form to the FDF format to a scripted web page and have the web page's script process the data to the database.

Similar Messages

  • Why does it take over 2 minutes to get a database connection from the DataSource?

    Hello,
    It is taking over 2 minutes for my application to get a connection from a registered DataSource in iAS 6.0 sp4 on Solaris. The proper results are returned it just takes 2 minutes to establish the connection. The DataSource is an Oracle 9i database. I have the 9i drivers in the classpath. I also have a registered datasource that is an Oracle 8 database and have no problems establishing a connection quickly to that database. As an aside I have setup this application on JBOSS and both datasource's return a connection very quickly. If anyone has any ideas about what might be going on please respond. This issue is holding up a production release.
    Here is the code:
    try {
    log.debug("getting a new initial context");
    ctx = new InitialContext();
    ds = (DataSource) ctx.lookup(bundle.getString("IW_DATASOURCE"));
    log.debug("after looking up datasource from initial context");
    } catch (NamingException e) {
    log.error(e);
    throw new FinstarException
    (bundle.getString("E-0001"));
    try {
    log.debug("about to get connection");
    conn = ds.getConnection();
    log.debug("after getting connection");
    Produces this in the logs:
    2002-05-29 08:55:12,859 DEBUG org.mitre.mii.project.finstar.FinancialSummary - about to get connection
    2002-05-29 08:57:24,963 DEBUG org.mitre.mii.project.finstar.FinancialSummary - after getting connection
    Here is the datasource registration file:
    <ias-resource>
    <resource>
    <jndi-name>jdbc/pdc/IWDataSource</jndi-name>
    <jdbc>
    <database-url>jdbc:oracle:thin:@xxx.xxx.org:1521:acisdb</database-url>
    <datasource>jdbc/pdc/IWDataSource</datasource>
    <username>XXXXX</username>
    <password>XXXXX</password>
    <driver-type>OracleThinDriver</driver-type>
    </jdbc>
    </resource>
    </ias-resource>

    Have you tried to eliminate everything extraneous. In other words, do you experience the same delays with a simple Java program (no lookups, JNDI) that loads the drivermanager and creates a connection.
    Do you have access to a traciong JVM or some program that captures run-time execution timing information? Even without the source, this will tell you the specific class::methos where time is spent so you can better determine where the delay is ocurring.

  • Unable to connect database by DataSource in tomcat5.5 plz help to me

    hi,
    i want to connect Database through DataSource in Tomcat5.5 with mysql
    i wrote one servlet , made change in server.xml, web.xml.
    when i access it show exception
    java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.org.apache.tomcat.dbcp.collections)
            at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
            at java.security.AccessController.checkPermission(AccessController.java:427)
            at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
            at java.lang.SecurityManager.checkPackageAccess(SecurityManager.java:1512)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
            at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)The servlet
    * DataSourceAccess.java
    * Created on August 22, 2005, 3:14 PM
    package officecom;
    import java.io.*;
    import java.net.*;
    import java.sql.*;
    import javax.naming.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.sql.*;
    * @author Paramasivam
    * @version
    public class DataSourceAccess extends HttpServlet {
        /** Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
         * @param request servlet request
         * @param response servlet response
        protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            response.setContentType("text/html;charset=UTF-8");
            PrintWriter out = response.getWriter();
            /* TODO output your page here
            out.println("<html>");
            out.println("<head>");
            out.println("<title>Servlet DataSourceAccess</title>");
            out.println("</head>");
            out.println("<body>");
            out.println("<h1>Servlet DataSourceAccess at " + request.getContextPath () + "</h1>");
            out.println("</body>");
            out.println("</html>");
            out.println(" got connection ?  "+getDataConnnecion());
            out.close();
        public boolean getDataConnnecion(){
            try{
                System.out.println(" INFO : getConnection called     ");
                Context initContext = new InitialContext();
                Context envContext  = (Context)initContext.lookup("java:/comp/env");
                DataSource ds = (DataSource)envContext.lookup("mysql");
                Connection con = ds.getConnection();
                if( con != null ){
                    return true;
                }else
                    return false;
            }catch(Exception e){
                e.printStackTrace();
                return false;
        // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
        /** Handles the HTTP <code>GET</code> method.
         * @param request servlet request
         * @param response servlet response
        protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            processRequest(request, response);
        /** Handles the HTTP <code>POST</code> method.
         * @param request servlet request
         * @param response servlet response
        protected void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            processRequest(request, response);
        /** Returns a short description of the servlet.
        public String getServletInfo() {
            return "Short description";
        // </editor-fold>
    }Changes in server.xml
    <GlobalNamingResources>
          <Resource
          name="mysql"
          auth="Container"
          type="javax.sql.DataSource"
          password=""
          driverClassName="com.mysql.jdbc.Driver"
          maxIdle="2"
          maxWait="5000"
          username="root"
          url="jdbc:mysql://localhost:3306/sushi?autoReconnect=true"
          maxActive="4"/>
      </GlobalNamingResources>changes in web.xml
      <resource-ref>
               <description>Tomcat DBCP</description>
               <res-ref-name>mysql</res-ref-name>
               <res-type>javax.sql.DataSource</res-type>
               <res-auth>Container</res-auth>
    </resource-ref> 

    You might have more answers if you post this same question in the Sun Java Studio Enterprise forum...
    http://swforum.sun.com/jive/category.jspa?categoryID=90

  • Connecting to multiple datasources

    i would like to connect to multiple datasources (i.e. db2 and peoplesoft both in two sitting in different subsystems in the MVS platform) in my java application. is it possible to do this in the websphere application server running under mainframe environment? any ideas or way around it?
    thanks.

    Why don't you just describe the problems that arose when you tried it?

  • There are still no BW systems  connected to the Datasource

    Hi All,
    We are currently implementing BW retail project and trying to retrieve POS data using IDOCs through PIPE but we are facing a problem when we try to process idoc from POS workbench (/POSDW/MON0).We are  sending idocs(WBUPON- POS interface: Upload sales docs (receipts) non-aggregated)  using transaction we19 and then when we go to the POS workbench and try to process related idocs choosing supply bw immediately ...etc option after this we are getting the following error with a message class RSQU and message no 10.
    <b>There are still no BW systems  connected to the Datasource</b> I am working on BW  side with datasources such as  2LIS_43_poscas and 2LIS_44_posrec.
    Our system is SAP BI 7.0 with support package level 12.Can you please suggest something on this problem
    Is there anyone who has experienced  this kind of problem.Could you please give a look and share your solutions with me OR can somenone show how to transfer pos data into BW system.
    Waiting for rewarding points for good answers.
    Thanks in Advance,
    Regards,
    #Bill J.

    Satish ,
    Thank you very much for the answer but my r3 system is ecc 5.0 so this note is suitable for it ? What else can you suggest related to this problem ?
    Thanks & Regards,
    #Bill J.

  • Testing connection to a datasource

    hi everyone.
    i want test connection to a datasource that i create on tomcat ( by tomcat interface ), i want try connection trough a simple java classe ( main method ).
    i'm using a postgres database.
    can anyone tell me a sample code to try it ?
    thx .

    I just installed Weblogic 10 and when creating my first Datasource, I got the same error. I think, although I'm not positive, that I clicked Finish instead of Next after testing the Datasource. When you click Next, you get to a page that asks where to deploy.
    I ended up shutting down the server, editing config.xml to delete the datasource. I also deleted the file in the config/jdbc directory. After restarting the server, I recreated the Datasource, clicking Next until there wasn't a next button. Everything is fine now.

  • Limit of Concurrent Connection to a Datasource

    I have an env to generate report concurrently.
    The datasource is a SQLServer2008.
    Can I limit the numbers of Concurrent Connection to the datasource in SSRS?

    Hi Jiulidaji,
    Thank you for your question.
    I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated.
    Thank you for your understanding and support.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • Database connection timeouts and datasource errors

    Connections in the pool randomly die overnight. Stack traces show that for some reason, the evermind driver is being used even though the MySql connection pool is specified.
    Also, the evermind connection pool is saying connections aren't being closed, and the stack trace shows they're being allocated by entity beans that are definitely not left hanging around.
    Sometimes we get non-serializable errors when trying to retrieve the datasource (this is only after the other errors start). Some connections returned from the pool are still good, so the application limps along.
    EJBs and DAOs both use jdbc/SQLServerDSCore.
    Has anyone seen this problem?
    <data-sources>
         <data-source
              class="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource"
              name="SQLServerDSCore"
              location="jdbc/SQLServerDSCore"
              xa-location="jdbc/xa/SQLServerXACore"
              ejb-location="jdbc/SQLServerDSCore"
              connection-driver="com.mysql.jdbc.Driver"
              min-connections="5"
              username="xxx"
              password="xxx"
              staleness-timeout="3600"
              alive-poll-query="SELECT 1 FROM medispan"
              url="jdbc:mysql://1.2.3.4:3306/dbo?autoReconnect=true&autoReconnectForPools=true&cachePrepStmts=true&is-connection-validation-required=true"
              inactivity-timeout="30"
         >
              <property name="autoReconnect" value="true"/>
              <property name="autoReconnectForPools" value="true"/>
              <property name="is-connection-validation-required" value="true"/>
              <property name="cachePrepStmts" value="true"/>
         </data-source>
    </data-sources>

    Rick,
    OC4J 9.0.4.0.0 - BTW, do you know of any patches?As far as I know, there are no patches for the 9.0.4
    production version of OC4J stand-alone.
    I'm using container managed persistence,It was not clear to me, from your previous post, that you
    are using CMP entity beans.
    I found staleness-timeout and alive-poll-query
    somewhere on a website when trying to track this
    down. Here's four sources:Those sources refer to OrionServer -- and an older version, too, it seems.
    Like all other Oracle products that start out as somebody
    else's -- including, for example, JBuilder (that became "JDeveloper"), Apache Web Server (that became "Oracle HTTP Server") and TopLink -- their development paths diverge, until, eventually, there is absolutely no similarity between them at all. Hence, the latest versions of OC4J and "OrionServer" are so different, that you cannot be sure that something that works for "OrionServer" will work for OC4J.
    I recall reading something, somewhere, sometime about configuring OC4J to use different databases (other than Oracle), but I really don't remember any details (since it was not relevant to me, because we only use Oracle database). In any case, it is possible to use a non-Oracle database with OC4J.
    Good Luck,
    Avi.

  • Connection pool and datasource

    In WL 7, we need to configure a datasource and a connection pool in order for the application to get a connection to the database. How is the datasource and connection pool related?
    In WL 9.2, there is no option to configure the connection pool, there is only the option to configure the data source. Where did the connection pool go in WL 9.2?

    gerald lee wrote:
    In WL 7, we need to configure a datasource and a connection pool
    in order for the application to get a connection to the database.
    How is the datasource and connection pool related?
    It depends on the WLS version. pre-9.X, there can be more than one datasource pointing to a given pool,
    but you do need a datasource typically to use a pool.
    In WL 9.2, there is no option to configure the connection pool, there is only
    the option to configure the data source. Where did the connection pool go in WL 9.2?In 9.X and beyond the relationship is one-to-one, and you will create both at the
    same time when creating a datasource.
    Joe

  • Problem with Connection Pooling of datasources in a web service

    Hi,
    I have been driven insane trying to fix this problem, I am trying to connect to a MS SQL data source from a web service in tomcat 4.1, so I have defined the data source through tomcats server administration pages and checked that it has inserted the correct code to server.xml. I have also added the relevant information to the web.xml and added the code to the service. when I start tomcat it outputs:
    DbcpDataSourceFactory: driverClassName=com.microsoft.jdbc.sqlserver.SQLServerDriver, url=jdbc:microsoft:sqlserver://192.168.0.22:1433:databaseName=dbname, user=sa
    but then these errors occours:
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke
    (DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.apache.commons.launcher.ChildMain.run(ChildMain.java:269)
    Caused by: java.lang.IllegalStateException: Context path /RegistryServer is already in use
    at org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:523)
    ... 42 more
    and
    [ERROR] Digester - -End event threw exception <java.lang.reflect.InvocationTargetException>
    java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216)
         at org.apache.commons.digester.SetNextRule.end
    (Bootstrap.java:203)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at org.apache.commons.launcher.ChildMain.run(ChildMain.java:269)
    Caused by: java.lang.IllegalStateException: Context path /Xindice is already in use
         at org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:523)
         ... 42 more
    And when I try to use the data source my code gets the context but when getting the datasource it shows the error:
    Error doing something: javax.naming.NamingException: DbcpDataSourceFactory: driverClassName is required
    My server.xml reads:
    <Resource name="jdbc/msService" 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/msService">
    <parameter>
    <name>validationQuery</name>
    <value></value>
    </parameter>
    <parameter>
    <name>user</name>
    <value>sa</value>
    </parameter>
    <parameter>
    <name>url</name>
    <value>jdbc:microsoft:sqlserver://192.168.0.22:1433:databaseName=dbname</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>password</value>
    </parameter>
    <parameter>
    <name>maxActive</name>
    <value>4</value>
    </parameter>
    <parameter>
    <name>maxWait</name>
    <value>5000</value>
    </parameter>
    <parameter>
    <name>driverClassName</name>
    <value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value>
    </parameter>
    <parameter>
    <name>maxIdle</name>
    <value>2</value>
    </parameter>
    </ResourceParams>
    and my web.xml
    <web-app>
    <display-name>User Service</display-name>
    <description>A service to perform user information orientated tasks</description>
    <session-config>
    <session-timeout>60</session-timeout>
    </session-config>
    <resource-ref>
    <description> Resource reference to java.sql.Connection factory defined in server.xml</description>
    <res-ref-name>jdbc/msService</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </web-app>
    I have read the other posts regarding this error and most mention that the jar files need to be in <root>/common/lib but I have deinitely put all the MS jar files here!!!
    sorry this is such a long post but if any one has any idea it would be most appreciated!!!!
    cheers
    pasty

    Hi,
    I'm struggling with the same problem. One thing I noticed is that your url looks a bit different than others that I've seen:
    Yours:
    url=jdbc:microsoft:sqlserver://192.168.0.22:1433:databaeName=dbname, user=sa
    Most other folks:
    url=jdbc:microsoft:sqlserver://192.168.0.22:1433;databaseName=dbname; user=sa
    Note the semicolons.
    I don't know whether this will help you or not, but it's worth a try.
    Does anyone know where I can get documentation for the options that MS' jdbc driver for SQL Server? I've googled groups and the web and can't find anything authoritative.
    Dan
    Hi,
    I have been driven insane trying to fix this problem,
    I am trying to connect to a MS SQL data source from a
    web service in tomcat 4.1, so I have defined the data
    source through tomcats server administration pages and
    checked that it has inserted the correct code to
    server.xml. I have also added the relevant
    information to the web.xml and added the code to the
    service. when I start tomcat it outputs:
    DbcpDataSourceFactory:
    driverClassName=com.microsoft.jdbc.sqlserver.SQLServer
    river,
    url=jdbc:microsoft:sqlserver://192.168.0.22:1433:databa
    eName=dbname, user=sa
    but then these errors occours:
    java.lang.reflect.InvocationTargetException
    at
    at
    at
    t sun.reflect.NativeMethodAccessorImpl.invoke0(Native
    Method)
    at
    at
    at
    t
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMetho
    AccessorImpl.java:39)
    at
    at
    at sun.reflect.DelegatingMethodAccessorImpl.invoke
    (DelegatingMethodAccessorImpl.java:25)
    at
    at
    at java.lang.reflect.Method.invoke(Method.java:324)
    at
    at
    at
    t
    org.apache.commons.launcher.ChildMain.run(ChildMain.jav
    :269)
    Caused by: java.lang.IllegalStateException: Context
    path /RegistryServer is already in use
    at
    at
    at
    t
    org.apache.catalina.core.StandardHostDeployer.addChild(
    tandardHostDeployer.java:523)
    ... 42 more
    and
    [ERROR] Digester - -End event threw exception
    <java.lang.reflect.InvocationTargetException>
    java.lang.reflect.InvocationTargetException
    at
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native
    Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMeth
    dAccessorImpl.java:39)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Delega
    ingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
    at
    org.apache.commons.beanutils.MethodUtils.invokeMethod(
    ethodUtils.java:216)
         at org.apache.commons.digester.SetNextRule.end
    (Bootstrap.java:203)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native
    Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMeth
    dAccessorImpl.java:39)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Delega
    ingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
    at
    org.apache.commons.launcher.ChildMain.run(ChildMain.ja
    a:269)
    Caused by: java.lang.IllegalStateException: Context
    path /Xindice is already in use
    at
    org.apache.catalina.core.StandardHostDeployer.addChild
    StandardHostDeployer.java:523)
         ... 42 more
    And when I try to use the data source my code gets the
    context but when getting the datasource it shows the
    error:
    Error doing something: javax.naming.NamingException:
    DbcpDataSourceFactory: driverClassName is required
    My server.xml reads:
    <Resource name="jdbc/msService" scope="Shareable"
    le" type="javax.sql.DataSource"/>
    <ResourceParams name="UserDatabase">
    <parameter>
    <name>factory</name>
    <value>org.apache.catalina.users.MemoryUserDatabaseFac
    ory</value>
    </parameter>
    <parameter>
    <name>pathname</name>
    <value>conf/tomcat-users.xml</value>
    </parameter>
    </ResourceParams>
    <ResourceParams name="jdbc/msService">
    <parameter>
    <name>validationQuery</name>
    <value></value>
    </parameter>
    <parameter>
    <name>user</name>
    <value>sa</value>
    </parameter>
    <parameter>
    <name>url</name>
    <value>jdbc:microsoft:sqlserver://192.168.0.22:1433:da
    abaseName=dbname</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>password</value>
    </parameter>
    <parameter>
    <name>maxActive</name>
    <value>4</value>
    </parameter>
    <parameter>
    <name>maxWait</name>
    <value>5000</value>
    </parameter>
    <parameter>
    <name>driverClassName</name>
    <value>com.microsoft.jdbc.sqlserver.SQLServerDriver</v>
    </parameter>
    <parameter>
    <name>maxIdle</name>
    <value>2</value>
    </parameter>
    </ResourceParams>
    and my web.xml
    <web-app>
    <display-name>User Service</display-name>
    <description>A service to perform user information
    n orientated tasks</description>
    <session-config>
    <session-timeout>60</session-timeout>
    </session-config>
    <resource-ref>
    <description> Resource reference to
    to java.sql.Connection factory defined in
    server.xml</description>
    <res-ref-name>jdbc/msService</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </web-app>
    I have read the other posts regarding this error and
    most mention that the jar files need to be in
    <root>/common/lib but I have deinitely put all the MS
    jar files here!!!
    sorry this is such a long post but if any one has any
    idea it would be most appreciated!!!!
    cheers
    pasty

  • Error while getting a Connection from a  Datasource

    hi all, m using netbeans to design a web app. it got to the point of connecting to a mysql database, i tried to follow the recommendation of using a datasource instead, and i edited the META-INF\context.xml and
    WEB-INF\web.xml as follows respectively.
    Here is a copy of context.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <Context path="/MyOnlineStore">
    <Resource name="jdbc/StoreDB"
    type="javax.sql.DataSource"
    auth="Container"
    />
    <ResourceParams name="jdbc/StoreDB">
    <parameter>
    <name>username</name>
    <value>root</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>stephanie</value>
    </parameter>
    <parameter>
    <name>driverClassName</name>
    <value>com.mysql.jdbc.Driver</value>
    </parameter>
    <parameter>
    <name>url</name>
    <value>jdbc:mysql://localhost:3306/mystore?autoReconnect=true</value>
    </parameter>
    </ResourceParams>
    </Context>
    and here is a copy of web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <servlet>
    <servlet-name>controller</servlet-name>
    <servlet-class>com.obinna.servlets.ControllerServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>controller</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>controller</servlet-name>
    <url-pattern>/controller</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>
    30
    </session-timeout>
    </session-config>
    <welcome-file-list>
    <welcome-file>controller</welcome-file>
    </welcome-file-list>
    <resource-ref>
    <res-ref-name>jdbc/StoreDB</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </web-app>
    and here is a fragment of a helper class i use to retrieve connections
    public class StoreJDBCHelper {
    private DataSource _dataSource;
    public StoreJDBCHelper() throws NamingException
    Context context = new InitialContext();
    Context applicationEnv = (Context)context.lookup("java:comp/env");
    _dataSource = (DataSource)applicationEnv.lookup("jdbc/StoreDB");
    public Connection getConnection() throws SQLException
    return _dataSource.getConnection();
    each time i call getConnection() from another class i get this exception
    org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class ' ' for connect URL 'null'
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150)
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
    at com.obinna.processingcommands.StoreJDBCHelper.getConnection(StoreJDBCHelper.java:33)
    at com.obinna.processingcommands.CategoryProcessingCommand.getCategoryDB(CategoryProcessingCommand.java:85)
    at com.obinna.processingcommands.CategoryProcessingCommand.getOrCreateCategory(CategoryProcessingCommand.java:58)
    at com.obinna.processingcommands.CategoryProcessingCommand.execute(CategoryProcessingCommand.java:47)
    at com.obinna.servlets.ControllerServlet.processRequest(ControllerServlet.java:63)
    at com.obinna.servlets.ControllerServlet.doPost(ControllerServlet.java:90)
    at com.obinna.servlets.ControllerServlet.doGet(ControllerServlet.java:78)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: java.lang.NullPointerException
    at sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(JdbcOdbcDriver.java:507)
    at sun.jdbc.odbc.JdbcOdbcDriver.knownURL(JdbcOdbcDriver.java:476)
    at sun.jdbc.odbc.JdbcOdbcDriver.acceptsURL(JdbcOdbcDriver.java:307)
    at java.sql.DriverManager.getDriver(DriverManager.java:253)
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143)
    ... 25 more
    please what can i do.
    thanks.

    Caused by: java.lang.NullPointerException
    at sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(JdbcOdbcDriver.java:507)
    at sun.jdbc.odbc.JdbcOdbcDriver.knownURL(JdbcOdbcDriver.java:476)
    at sun.jdbc.odbc.JdbcOdbcDriver.acceptsURL(JdbcOdbcDriver.java:307)
    at java.sql.DriverManager.getDriver(DriverManager.java:253)
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143)
    ... 25 moreDBCP is trying to create a datasource for you. It has the MySQL JDBC URL which you specified (jdbc:mysql://localhost:3306/mystore?autoReconnect=true) and is trying to find a matching driver. It scans all drivers which are loaded and registered in the DriverManager. The JDBC-ODBC bridge driver is apparently also loaded somehow and while testing the MySQL URL on this driver, the driver is throwing a NullPointerException while getting the protocol.
    This look like one more bug in the JDBC-ODBC bridge -which is already soo full of unfixed bugs-. So to get this problem solved either remove the JDBC-ODBC bridge driver from your application, or upgrade it to a newer version without this bug (if any exist), or change the Tomcat resource configuration that no one datasource is actually using the JDBC-ODBC bridge driver, so that this driver won't get loaded and registered by the DriverManager.

  • Error when connecting  to Oracle DataSource in a clustered environment

    Trying to connect to a ORACLE 9.1 datasource in a remote clustered environment. Getting the following exception. The code works fine when connecting to a local non-clustered server. Any help will be greatly appreciated.
    ---------------------Stack trace--------------
    weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Failed to generate
    class for weblogic.jdbc.rmi.internal.ConnectionImpl_weblogic_jdbc_wrapper_JTACon
    nection_weblogic_jdbc_wrapper_XAConnection_oracle_jdbc_driver_LogicalConnection_
    812_WLStub ] - with nested exception:
    [java.lang.reflect.InvocationTargetException - with target exception:
    [java.lang.ArrayIndexOutOfBoundsException: 164]]
    at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:8
    07)
    at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:7
    90)
    at weblogic.rmi.extensions.StubFactory.getStub(StubFactory.java:79)
    at weblogic.rmi.utils.io.RemoteObjectReplacer.resolveObject(RemoteObject
    Replacer.java:237)
    at weblogic.rmi.internal.StubInfo.readResolve(StubInfo.java:142)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at java.io.ObjectStreamClass.invokeReadResolve(Unknown Source)
    at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
    at java.io.ObjectInputStream.readObject0(Unknown Source)
    at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
    at java.io.ObjectInputStream.readSerialData(Unknown Source)
    at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
    at java.io.ObjectInputStream.readObject0(Unknown Source)
    at java.io.ObjectInputStream.readObject(Unknown Source)
    at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedO
    bjectInputStream.java:119)
    at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.ja
    va:112)
    at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:56)
    at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:159)
    at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
    ef.java:285)
    at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
    ef.java:244)
    at weblogic.jdbc.common.internal.RmiDataSource_812_WLStub.getConnection(
    Unknown Source)

    Trying to connect to a ORACLE 9.1 datasource in a remote clustered environment. Getting the following exception. The code works fine when connecting to a local non-clustered server. Any help will be greatly appreciated.
    ---------------------Stack trace--------------
    weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Failed to generate
    class for weblogic.jdbc.rmi.internal.ConnectionImpl_weblogic_jdbc_wrapper_JTACon
    nection_weblogic_jdbc_wrapper_XAConnection_oracle_jdbc_driver_LogicalConnection_
    812_WLStub ] - with nested exception:
    [java.lang.reflect.InvocationTargetException - with target exception:
    [java.lang.ArrayIndexOutOfBoundsException: 164]]
    at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:8
    07)
    at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:7
    90)
    at weblogic.rmi.extensions.StubFactory.getStub(StubFactory.java:79)
    at weblogic.rmi.utils.io.RemoteObjectReplacer.resolveObject(RemoteObject
    Replacer.java:237)
    at weblogic.rmi.internal.StubInfo.readResolve(StubInfo.java:142)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at java.io.ObjectStreamClass.invokeReadResolve(Unknown Source)
    at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
    at java.io.ObjectInputStream.readObject0(Unknown Source)
    at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
    at java.io.ObjectInputStream.readSerialData(Unknown Source)
    at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
    at java.io.ObjectInputStream.readObject0(Unknown Source)
    at java.io.ObjectInputStream.readObject(Unknown Source)
    at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedO
    bjectInputStream.java:119)
    at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.ja
    va:112)
    at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:56)
    at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:159)
    at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
    ef.java:285)
    at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
    ef.java:244)
    at weblogic.jdbc.common.internal.RmiDataSource_812_WLStub.getConnection(
    Unknown Source)

  • JDBC Connection Using ColdFusion DataSource

    We are using ColdFusion MX 6 and oracle 10g.
    I am trying to code a JAVA JDBC database connection class by
    simplely pass ColdFusion datasouce name.
    i.e, instead of passing URL, user id and password, I hope my
    JAVA class can recognize ColdFusion datasource.
    Is this possible without a J2EE environment?
    If you have done this, please advice.

    DataSource is an interface which allows vendors and developers to implement their means of managing Connection objects (to add features like connection pooling, etc). You can find out about DataSource in API documentation: http://java.sun.com/j2se/1.4.2/docs/api/javax/sql/DataSource.html
    DriverManager on the other hand is a class which registers Drivers and uses them to produce Connection objects:
    http://java.sun.com/j2se/1.4.2/docs/api/java/sql/DriverManager.html

  • How to use connection pool of datasource to make applications run faster?

    Hi, erveryone
    I prepare to implement a servlet that access database and do sync with client.
    When I access database, I would like to configure a datasource in weblogic and use connection pool.
    In order to make servlet application run significantly faster, my servet how to use connection poo is much moreresonable?
    For example, my servlet has many times database access. Is it true that geting and close a connection whenever
    one time database access finished?
    If from the servlet begins, the db connection is hold till servlet finalize. Will the solution affect the servlet performance? Is there any official document to introduce connection pool program? I search some documents.
    <The Java EE 6Tutorial> introduce some simple intruduction about connection pool.

    1. Use WebLogic Servers Data Source for Database Connections.
    2. Open and close the connections where you need it. Dont open it in begin and close in finalise. That is bad practice.
    3. Even when you invoke Connection.close () webLogic will not close the connection. it will commit the transaction and return it back to the pool rather than physically closing the DB connection.
    4. You can tune data source for minimum, maximum and increments of connections that you need based on your application requirement.

  • JDBC Calls when connecting to a Datasource

    Post Author: phrl
    CA Forum: Data Connectivity and SQL
    HelloFirstly I am using CR XI R2 SP2 as per the Eval download on the BI site.  I am trying to get Crystal to connect to an eDirectory (LDAP) Datasource, and since I run my CMS server on Linux I hope to use the JDBC connector.  When using Developer I import my JDBC Driver JAR into the CRCONFIG.XML no problem, and can connect to my JDBC datasource no problem, but when I then use the Database expert and select the Tables (LDAP Classes), if I select more than one table and then Crystal tries to connect the two tables together using a join then Crystal crashes.  The only way I can get it semi-working is to use the "Command" option and manually type in my own SQL statement.  If I start and only select one table that works fine, but Crystal is unable to get a list of columns (attributes) on that row.What I believe is happening is Crystal is trying to make a JDBC API call into the Novell LDAP JDBC Driver (found at: http://developer.novell.com/wiki/index.php/LDAP_JDBC_Driver) which isn't supported in the driver.Is there a way to find out or add in extra debugging into Crystal to find out what API calls it's making into the JDBC driver, so I can then talk with the developer to add in support to the LDAPJDBC driver.Or has someone else ever successfully managed to query a LDAP datasource in a non-windows environment.  The Novell supplied ODBC driver works fine, but that doesn't help me at all.

    You probably don't get an answer, since there seems to be no solution. I have the same problems and regarding iPlanet support and iPlanet doumentation (Troubleshooting section in the RMI/IIOP section of the Java Programmers Guide), this is the buggy behavior, if you try to look up a non-existing JNDI-Name. But since there is no way, to find out what the correct name is, I don't have a clue what to do. I registered a data source with JNDI-Name "jdbc/test", but all mof my four different look ups failed: java:comp/env/jdbc/test, java:comp/env/test, jdbc/test, test.
    Did you found a solution?

  • Connecting to the Datasource in ColdFusion 8 vs CF 6

    Hi all,
    I have a CF6 application that is running well. However, I'm
    in the process of upgrading to CF8, and some of the code no longer
    works. I've scoured the documentation and haven't found information
    on the replacement code.
    My old code gets a datasource, acquires a database
    connection, uses the connection, and then closes the datasource.
    variables.dsService = CreateObject("java",
    "coldfusion.server.ServiceFactory").DataSourceService;
    variables.dsManager = dsService.getDman();
    variables.dataSource =
    variables.dsManager.getDataSource(<data source name goes
    here>);
    variables.dbConnection =
    variables.dataSource.getConnection();
    <code to use the db connection goes here>
    variables.dbConnection.close();
    Under CF8, the error message is "The getDman method was not
    found." So I've been unable to find any code that will let me get
    access to an object that implements DataSource, so that I can use
    my connections.
    Any advice would be appreciated.
    Mike K.

    not sure if these help:
    http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=basiconfig_37.html
    http://localhost/CFIDE/adminapi/datasource.cfc
    Ken Ford
    Adobe Community Expert - Dreamweaver/ColdFusion
    Fordwebs, LLC
    http://www.fordwebs.com
    "MKK2" <[email protected]> wrote in message
    news:g6d5sa$s0q$[email protected]..
    > Hi all,
    >
    > I have a CF6 application that is running well. However,
    I'm in the process of
    > upgrading to CF8, and some of the code no longer works.
    I've scoured the
    > documentation and haven't found information on the
    replacement code.
    >
    > My old code gets a datasource, acquires a database
    connection, uses the
    > connection, and then closes the datasource.
    >
    >
    > variables.dsService = CreateObject("java",
    > "coldfusion.server.ServiceFactory").DataSourceService;
    > variables.dsManager = dsService.getDman();
    > variables.dataSource =
    variables.dsManager.getDataSource(<data source
    > name goes here>);
    > variables.dbConnection =
    variables.dataSource.getConnection();
    > <code to use the db connection goes here>
    > variables.dbConnection.close();
    >
    > Under CF8, the error message is "The getDman method was
    not found." So I've
    > been unable to find any code that will let me get access
    to an object that
    > implements DataSource, so that I can use my connections.
    >
    > Any advice would be appreciated.
    >
    > Mike K.
    >

Maybe you are looking for