Database connectivity in netbeans

whenever i try connectin database using this code :
import java.sql.*;
import java.lang.*;
import java.net.*;
import javax.naming.*;
public class NewClass{
public static void main(String[] args) {
// Load the JDBC driver
System.out.println("Table Creation Example!");
Connection con = null;
String url = "jdbc:mysql://localhost:3306/";
String dbName = "test";
String driverName = "com.mysql.jdbc.Driver";
String userName = "ide";
String password = "NnEFchLb";
try{
Class.forName(driverName).newInstance();
con = DriverManager.getConnection(url+dbName, userName, password);
try{
Statement st = con.createStatement();
String table = "CREATE TABLE Employee11(Emp_code integer, Emp_name varchar(10))";
st.executeUpdate(table);
System.out.println("Table creation process successfully!");
catch(SQLException s){
System.out.println("Table all ready exists!");
con.close();
catch (Exception e){
e.printStackTrace();
i get followin error:
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at NewClass.main(NewClass.java:21)
can anyone help me???

Hi bhavishya,
You just forgot to import the driver in your project :
- in your project, right-click on 'Libraries' then select 'Add Library ...';
- in the popup window, select 'Java DB driver' then click the 'Add Library' button

Similar Messages

  • How do i connect to a derby database created in Netbeans externally?

    I've created a a Java DB in Netbeans, I can connect to the Java DB server and then to my database from Netbeans. I need to use this database outside of Netbeans... a table from this database is used in a program which i created with netbeans... i open the program using the .jar file outside of netbeans... but i can't access the table.
    can anyone help me with this?

    what exactly are you wanting to do? to connect to the database i use this
    String driverName = "org.apache.derby.jdbc.ClientDriver";
                Class.forName(driverName);
                String url = "jdbc:derby://localhost:1527/table name";
                String username = "username";
                String password = "password";
                connection = DriverManager.getConnection(url, username, password);you need to make sure that you have the derbyclient.jar file in the librarie for your project.
    Message was edited by:
    developprograms

  • NetBean, I can't establish the oracle database connection with version 9i.

    In NetBean, I can't establish the oracle database connection with version 9i.
    I have create the datasource and it is fine.
    when i try to access the tables i get a message
    "Unable to refresh children, connection is broken, unsupported feature"
    in netbeans.
    Does netbeans support oracle 9i version.
    Thanks,
    VKK

    In NetBean, I can't establish the oracle database connection with version 9i.
    I have create the datasource and it is fine.
    when i try to access the tables i get a message
    "Unable to refresh children, connection is broken, unsupported feature"
    in netbeans.
    Does netbeans support oracle 9i version.
    Thanks,
    VKK

  • Tomcat JDBC Realm Database Connection Error

    Hello all,
    I am trying to edit the server.xml file on Tomcat so I can use the JDBC Realm instead of the MemoryRealm. Hence, I will be able to read users, passwords and roles from a relational database instead of from the tomcat-users.xml.
    I have tried following all the guides on the net I can find, my server.xml looks as follows (after making changes to allow it to use JDBC realm). The only problem is, when I try to run the application the server outputs the following: (after all of these errors have been kicked up a pop-up box then appears titled "Tomcat Manager Application", it asks for a User Name and Password. I have tried the standard user name of "ide" and the password next to it in tomcat-users.xml but it won't accept it. (I am using the netbeans IDE)).
    Please could someone suggest any ideas of how I can get the server.xml to work with JDBC realm?
    Using CATALINA_BASE:   C:\Documents and Settings\Administrator\.netbeans\5.0beta\jakarta-tomcat-5.5.7_base
    Using CATALINA_HOME:   C:\Program Files\netbeans-5.0beta\enterprise2\jakarta-tomcat-5.5.7
    Using CATALINA_TMPDIR: C:\Documents and Settings\Administrator\.netbeans\5.0beta\jakarta-tomcat-5.5.7_base\temp
    Using JAVA_HOME:       C:\j2sdk1.4.2_08
    Created MBeanServer with ID: 1f934ad:107444b1d2b:-8000:ravinder-rdnzoa:1
    31-Oct-2005 01:29:33 org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on http-8084
    31-Oct-2005 01:29:34 org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on http-8443
    31-Oct-2005 01:29:34 org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 2174 ms
    31-Oct-2005 01:29:34 org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    31-Oct-2005 01:29:34 org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/5.5.7
    31-Oct-2005 01:29:34 org.apache.catalina.realm.JDBCRealm start
    SEVERE: Exception opening database connection
    java.sql.SQLException: org.gjt.mm.mysql.Driver
            at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:646)
            at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:720)
            at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1003)
            at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:440)
            at org.apache.catalina.core.StandardService.start(StandardService.java:450)
            at org.apache.catalina.core.StandardServer.start(StandardServer.java:683)
            at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
            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.catalina.startup.Bootstrap.start(Bootstrap.java:271)
            at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
    31-Oct-2005 01:29:34 org.apache.catalina.core.StandardHost start
    INFO: XML validation disabled
    31-Oct-2005 01:29:36 org.apache.catalina.startup.ContextConfig validateSecurityRoles
    INFO: WARNING: Security role name IBM used in an <auth-constraint> without being defined in a <security-role>
    31-Oct-2005 01:29:36 org.apache.catalina.startup.ContextConfig validateSecurityRoles
    INFO: WARNING: Security role name Auditor used in an <auth-constraint> without being defined in a <security-role>
    31-Oct-2005 01:29:37 org.apache.struts.tiles.TilesPlugin initDefinitionsFactory
    INFO: Tiles definition factory loaded for module ''.
    31-Oct-2005 01:29:37 org.apache.struts.validator.ValidatorPlugIn initResources
    INFO: Loading validation rules file from '/WEB-INF/validator-rules.xml'
    31-Oct-2005 01:29:37 org.apache.struts.validator.ValidatorPlugIn initResources
    INFO: Loading validation rules file from '/WEB-INF/validation.xml'
    31-Oct-2005 01:29:38 org.apache.catalina.startup.ContextConfig validateSecurityRoles
    INFO: WARNING: Security role name IBM used in an <auth-constraint> without being defined in a <security-role>
    31-Oct-2005 01:29:38 org.apache.struts.tiles.TilesPlugin initDefinitionsFactory
    INFO: Tiles definition factory loaded for module ''.
    31-Oct-2005 01:29:38 org.apache.struts.validator.ValidatorPlugIn initResources
    INFO: Loading validation rules file from '/WEB-INF/validator-rules.xml'
    31-Oct-2005 01:29:38 org.apache.struts.validator.ValidatorPlugIn initResources
    INFO: Loading validation rules file from '/WEB-INF/validation.xml'
    31-Oct-2005 01:29:39 org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on http-8084
    31-Oct-2005 01:29:39 org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on http-8443
    31-Oct-2005 01:29:40 org.apache.jk.common.ChannelSocket init
    INFO: JK2: ajp13 listening on /0.0.0.0:8009
    31-Oct-2005 01:29:40 org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/60  config=null
    31-Oct-2005 01:29:40 org.apache.catalina.storeconfig.StoreLoader load
    INFO: Find registry server-registry.xml at classpath resource
    31-Oct-2005 01:29:40 org.apache.catalina.startup.Catalina start
    INFO: Server startup in 5738 ms
    31-Oct-2005 01:29:40 org.apache.catalina.realm.JDBCRealm authenticate
    SEVERE: Exception performing authentication
    java.sql.SQLException: org.gjt.mm.mysql.Driver
            at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:646)
            at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:344)
            at org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:181)
            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:446)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
            at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
            at java.lang.Thread.run(Thread.java:534)
    31-Oct-2005 01:29:40 org.apache.catalina.realm.JDBCRealm authenticate
    SEVERE: Exception performing authentication
    java.sql.SQLException: org.gjt.mm.mysql.Driver
            at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:646)
            at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:344)
            at org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:181)
            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:446)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
            at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
            at java.lang.Thread.run(Thread.java:534)The server.xml looks as follows:
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Example Server Configuration File -->
    <!-- Note that component elements are nested corresponding to their
         parent-child relationships with each other -->
    <!-- A "Server" is a singleton element that represents the entire JVM,
         which may contain one or more "Service" instances.  The Server
         listens for a shutdown command on the indicated port.
         Note:  A "Server" is not itself a "Container", so you may not
         define subcomponents such as "Valves" or "Loggers" at this level.
    -->
    <Server port="8025" shutdown="SHUTDOWN">
        <!-- Comment these entries out to disable JMX MBeans support used for the
        administration web application -->
        <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"/>
        <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
        <Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>
        <!-- Global JNDI resources -->
        <GlobalNamingResources>
            <!-- Test entry for demonstration purposes -->
            <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
            <!-- Editable user database that can also be used by
            UserDatabaseRealm to authenticate users -->
       <!-- RAV
            <Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml"/>
          -->
        </GlobalNamingResources>
        <!-- A "Service" is a collection of one or more "Connectors" that share
        a single "Container" (and therefore the web applications visible
        within that Container).  Normally, that Container is an "Engine",
        but this is not required.
        Note:  A "Service" is not itself a "Container", so you may not
        define subcomponents such as "Valves" or "Loggers" at this level.
        -->
        <!-- Define the Tomcat Stand-Alone Service -->
        <Service name="Catalina">
            <!-- A "Connector" represents an endpoint by which requests are received
            and responses are returned.  Each Connector passes requests on to the
            associated "Container" (normally an Engine) for processing.
            By default, a non-SSL HTTP/1.1 Connector is established on port 8080.
            You can also enable an SSL HTTP/1.1 Connector on port 8443 by
            following the instructions below and uncommenting the second Connector
            entry.  SSL support requires the following steps (see the SSL Config
            HOWTO in the Tomcat 5 documentation bundle for more detailed
            instructions):
            * If your JDK version 1.3 or prior, download and install JSSE 1.0.2 or
            later, and put the JAR files into "$JAVA_HOME/jre/lib/ext".
            * Execute:
            %JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows)
            $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA  (Unix)
            with a password value of "changeit" for both the certificate and
            the keystore itself.
            By default, DNS lookups are enabled when a web application calls
            request.getRemoteHost().  This can have an adverse impact on
            performance, so you can disable it by setting the
            "enableLookups" attribute to "false".  When DNS lookups are disabled,
            request.getRemoteHost() will return the String version of the
            IP address of the remote client.
            -->
            <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
            <Connector port="8084" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="utf-8"/>
            <!-- Note : To disable connection timeouts, set connectionTimeout value
            to 0 -->
            <!-- Note : To use gzip compression you could set the following properties :
            compression="on"
            compressionMinSize="2048"
            noCompressionUserAgents="gozilla, traviata"
            compressableMimeType="text/html,text/xml"
            -->
            <!-- Define a SSL HTTP/1.1 Connector on port 8443 -->
            <Connector port="8443"
            maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
            enableLookups="false" disableUploadTimeout="true"
            acceptCount="100" scheme="https" secure="true"
            clientAuth="false" sslProtocol="TLS" />
            <!-- Define an AJP 1.3 Connector on port 8009 -->
            <Connector port="8009" enableLookups="false" redirectPort="8443" protocol="AJP/1.3"/>
            <!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
            <!-- See proxy documentation for more information about using this. -->
            <!--
            <Connector port="8082"
            maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
            enableLookups="false" acceptCount="100" connectionTimeout="20000"
            proxyPort="80" disableUploadTimeout="true" />
            -->
            <!-- An Engine represents the entry point (within Catalina) that processes
            every request.  The Engine implementation for Tomcat stand alone
            analyzes the HTTP headers included with the request, and passes them
            on to the appropriate Host (virtual host). -->
            <!-- You should set jvmRoute to support load-balancing via AJP ie :
            <Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">        
            -->
            <!-- Define the top level container in our container hierarchy -->
            <Engine name="Catalina" defaultHost="localhost">
                <!-- The request dumper valve dumps useful debugging information about
                the request headers and cookies that were received, and the response
                headers and cookies that were sent, for all requests received by
                this instance of Tomcat.  If you care only about requests to a
                particular virtual host, or a particular application, nest this
                element inside the corresponding <Host> or <Context> entry instead.
                For a similar mechanism that is portable to all Servlet 2.4
                containers, check out the "RequestDumperFilter" Filter in the
                example application (the source for this filter may be found in
                "$CATALINA_HOME/webapps/examples/WEB-INF/classes/filters").
                Request dumping is disabled by default.  Uncomment the following
                element to enable it. -->
                <!--
                <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
                -->
                <!-- Because this Realm is here, an instance will be shared globally -->
                <!-- This Realm uses the UserDatabase configured in the global JNDI
                resources under the key "UserDatabase".  Any edits
                that are performed against this UserDatabase are immediately
                available for use by the Realm.  -->
                <!-- RAV
               <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
               -->
                <!-- Comment out the old realm but leave here for now in case we
                need to go back quickly -->
                <!--
                <Realm className="org.apache.catalina.realm.MemoryRealm" />
                -->
                <!-- Replace the above Realm with one of the following to get a Realm
                stored in a database and accessed via JDBC -->
                <Realm  className="org.apache.catalina.realm.JDBCRealm"
                driverName="org.gjt.mm.mysql.Driver"
                connectionURL="jdbc:mysql://localhost:3306/tomcatusers"
                connectionName="root" connectionPassword="sikhism1"
                userTable="users" userNameCol="user_name" userCredCol="user_pass"
                userRoleTable="user_roles" roleNameCol="role_name" />
                <!--
                <Realm  className="org.apache.catalina.realm.JDBCRealm"
                driverName="oracle.jdbc.driver.OracleDriver"
                connectionURL="jdbc:oracle:thin:@ntserver:1521:ORCL"
                connectionName="scott" connectionPassword="tiger"
                userTable="users" userNameCol="user_name" userCredCol="user_pass"
                userRoleTable="user_roles" roleNameCol="role_name" />
                -->
                <!--
                <Realm  className="org.apache.catalina.realm.JDBCRealm"
                driverName="sun.jdbc.odbc.JdbcOdbcDriver"
                connectionURL="jdbc:odbc:CATALINA"
                userTable="users" userNameCol="user_name" userCredCol="user_pass"
                userRoleTable="user_roles" roleNameCol="role_name" />
                -->
                <!-- Define the default virtual host
                Note: XML Schema validation will not work with Xerces 2.2.
                -->
                <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="false" xmlValidation="false" xmlNamespaceAware="false">
                    <!-- Defines a cluster for this node,
                    By defining this element, means that every manager will be changed.
                    So when running a cluster, only make sure that you have webapps in there
                    that need to be clustered and remove the other ones.
                    A cluster has the following parameters:
                    className = the fully qualified name of the cluster class
                    name = a descriptive name for your cluster, can be anything
                    mcastAddr = the multicast address, has to be the same for all the nodes
                    mcastPort = the multicast port, has to be the same for all the nodes
                    mcastBindAddr = bind the multicast socket to a specific address
                    mcastTTL = the multicast TTL if you want to limit your broadcast
                    mcastSoTimeout = the multicast readtimeout
                    mcastFrequency = the number of milliseconds in between sending a "I'm alive" heartbeat
                    mcastDropTime = the number a milliseconds before a node is considered "dead" if no heartbeat is received
                    tcpThreadCount = the number of threads to handle incoming replication requests, optimal would be the same amount of threads as nodes
                    tcpListenAddress = the listen address (bind address) for TCP cluster request on this host,
                    in case of multiple ethernet cards.
                    auto means that address becomes
                    InetAddress.getLocalHost().getHostAddress()
                    tcpListenPort = the tcp listen port
                    tcpSelectorTimeout = the timeout (ms) for the Selector.select() method in case the OS
                    has a wakup bug in java.nio. Set to 0 for no timeout
                    printToScreen = true means that managers will also print to std.out
                    expireSessionsOnShutdown = true means that
                    useDirtyFlag = true means that we only replicate a session after setAttribute,removeAttribute has been called.
                    false means to replicate the session after each request.
                    false means that replication would work for the following piece of code: (only for SimpleTcpReplicationManager)
                    <%
                    HashMap map = (HashMap)session.getAttribute("map");
                    map.put("key","value");
                    %>
                    replicationMode = can be either 'pooled', 'synchronous' or 'asynchronous'.
                    * Pooled means that the replication happens using several sockets in a synchronous way. Ie, the data gets replicated, then the request return. This is the same as the 'synchronous' setting except it uses a pool of sockets, hence it is multithreaded. This is the fastest and safest configuration. To use this, also increase the nr of tcp threads that you have dealing with replication.
                    * Synchronous means that the thread that executes the request, is also the
                    thread the replicates the data to the other nodes, and will not return until all
                    nodes have received the information.
                    * Asynchronous means that there is a specific 'sender' thread for each cluster node,
                    so the request thread will queue the replication request into a "smart" queue,
                    and then return to the client.
                    The "smart" queue is a queue where when a session is added to the queue, and the same session
                    already exists in the queue from a previous request, that session will be replaced
                    in the queue instead of replicating two requests. This almost never happens, unless there is a
                    large network delay.
                    -->
                    <!--
                    When configuring for clustering, you also add in a valve to catch all the requests
                    coming in, at the end of the request, the session may or may not be replicated.
                    A session is replicated if and only if all the conditions are met:
                    1. useDirtyFlag is true or setAttribute or removeAttribute has been called AND
                    2. a session exists (has been created)
                    3. the request is not trapped by the "filter" attribute
                    The filter attribute is to filter out requests that could not modify the session,
                    hence we don't replicate the session after the end of this request.
                    The filter is negative, ie, anything you put in the filter, you mean to filter out,
                    ie, no replication will be done on requests that match one of the filters.
                    The filter attribute is delimited by ;, so you can't escape out ; even if you wanted to.
                    filter=".*\.gif;.*\.js;" means that we will not replicate the session after requests with the URI
                    ending with .gif and .js are intercepted.
                    The deployer element can be used to deploy apps cluster wide.
                    Currently the deployment only deploys/undeploys to working members in the cluster
                    so no WARs are copied upons startup of a broken node.
                    The deployer watches a directory (watchDir) for WAR files when watchEnabled="true"
                    When a new war file is added the war gets deployed to the local instance,
                    and then deployed to the other instances in the cluster.
                    When a war file is deleted from the watchDir the war is undeployed locally
                    and cluster wide
                    -->
                    <!--
                    <Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
                    managerClassName="org.apache.catalina.cluster.session.DeltaManager"
                    expireSessionsOnShutdown="false"
                    useDirtyFlag="true"
                    notifyListenersOnReplication="true">
                    <Membership
                    className="org.apache.catalina.cluster.mcast.McastService"
                    mcastAddr="228.0.0.4"
                    mcastPort="45564"
                    mcastFrequency="500"
                    mcastDropTime="3000"/>
                    <Receiver
                    className="org.apache.catalina.cluster.tcp.ReplicationListener"
                    tcpListenAddress="auto"
                    tcpListenPort="4001"
                    tcpSelectorTimeout="100"
                    tcpThreadCount="6"/>
                    <Sender
                    className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
                    replicationMode="pooled"
                    ackTimeout="15000"/>
                    <Valve className="org.apache.catalina.cluster.tcp.ReplicationValve"
                    filter=".*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;"/>
                    <Deployer className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
                    tempDir="/tmp/war-temp/"
                    deployDir="/tmp/war-deploy/"
                    watchDir="/tmp/war-listen/"
                    watchEnabled="false"/>
                    </Cluster>
                    -->
                    <!-- Normally, users must authenticate themselves to each web app
                    individually.  Uncomment the following entry if you would like
                    a user to be authenticated the first time they encounter a
                    resource protected by a security constraint, and then have that
                    user identity maintained across *all* web applications contained
                    in this virtual host. -->
                    <!--
                    <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
                    -->
                    <!-- Access log processes all requests for this virtual host.  By
                    default, log files are created in the "logs" directory relative to
                    $CATALINA_HOME.  If you wish, you can specify a different
                    directory with the "directory" attribute.  Specify either a relative
                    (to $CATALINA_HOME) or absolute path to the desired directory.
                    -->
                    <!--
                    <Valve className="org.apache.catalina.valves.AccessLogValve"
                    directory="logs"  prefix="localhost_access_log." suffix=".txt"
                    pattern="common" resolveHosts="false"/>
                    -->
                    <!-- Access log processes all requests for this virtual host.  By
                    default, log files are created in the "logs" directory relative to
                    $CATALINA_HOME.  If you wish, you can specify a different
                    directory with the "directory" attribute.  Specify either a relative
                    (to $CATALINA_HOME) or absolute path to the desired directory.
                    This access log implementation is optimized for maximum performance,
                    but is hardcoded to support only the "common" and "combined" patterns.
                    -->
                    <!--
                    <Valve className="org.apache.catalina.valves.FastCommonAccessLogValve"
                    directory="logs"  prefix="localhost_access_log." suffix=".txt"
                    pattern="common" resolveHosts="false"/>
                    -->
                    <!-- Access log processes all requests for this virtual host.  By
                    default, log files are created in the "logs" directory relative to
                    $CATALINA_HOME.  If you wish, you can specify a different
                    directory with the "directory" attribute.  Specify either a relative
                    (to $CATALINA_HOME) or absolute path to the desired directory.
                    This access log implementation is optimized for maximum performance,
                    but is hardcoded to support only the "common" and "combined" patterns.
                    This valve use NIO direct Byte Buffer to asynchornously store the
                    log.
                    -->
                    <!--
                    <Valve className="org.apache.catalina.valves.ByteBufferAccessLogValve"
                    directory="logs"  prefix="localhost_access_log." suffix=".txt"
                    pattern="common" resolveHosts="false"/>
                    -->
                </Host>
            </Engine>
        </Service>
    </Server>Many thanks, and apologies for "dumping" all of the code here.

    So looking through the java api docs, I found that the tcUtilJDBCOperations has a connect string for the database. Below is the info it outlines. The questions I have it this. How do you specify the psdriver and URL along with do I need to do this as a persistent instance then add my selectstatement as a part of this or can I just specify this and the select statement will use this connection? Any help you can give would be appreciated.
    tcUtilJDBCOperations
    public tcUtilJDBCOperations(java.lang.String psDriver,
    java.lang.String psUrl,
    java.lang.String psUsername,
    java.lang.String psPassword)Contructor that sets the parameters for connecting to a database
    Parameters:
    psDriver - The class name of the jdbc driver
    psUrl - The URL of the database
    psUsername - The username required to access the database
    psPassword - The password for the above username
    Nick

  • Database Connection Problem, JSP, Tomcat5.5.9, Oracle9i

    hi,
    Am trying to make database connection using Oracle9i thin driver, what am doing is:
    I put classes12.zip and classes12_dms.jar in the classpath and also added these libraries in netbeans library folder.
    I make jsp page like this --------
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@page import="java.util.*, java.sql.*"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Testing Page</title>
    </head>
    <body>
    <%
    String url = "jdbc:oracle:thin:@SERVERNAME:1521:DBNAME";
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection conn = DriverManager.getConnection(url,"scott","tiger");
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery("select * from person order by name");
    %>
    <h1>Testing Page</h1><hr>
    <table border="1">
    <tbody>
    <tr>
    <th>Name</th>
    <th>Email</th>
    </tr>
    <% while(rs.next()) {%>
    <tr>
    <td><%= rs.getString(1)%></td>
    <td><%= rs.getString(2)%></td>
    </tr>
    <%
    rs.close();
    stmt.close();
    conn.close();
    } catch(ClassNotFoundException CNFEx) {
    out.println("<b>Error !</b><br>" + CNFEx.getMessage());
    } catch(Exception Ex) {
    out.println("<b>Error !</b><br>" + Ex.getMessage());
    %>
    </tbody>
    </table>
    </body>
    </html>
    when I run this page i got this error messages ----
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
    org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:138)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
    root cause
    java.lang.NoClassDefFoundError
    oracle.jdbc.driver.OracleConnection.createDMSSensors(OracleConnection.java:506)
    oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:330)
    oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:485)
    oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:337)
    java.sql.DriverManager.getConnection(Unknown Source)
    java.sql.DriverManager.getConnection(Unknown Source)
    org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:79)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
    any kind of help is appericiable.
    thanks.....

    I'd start by checking for a more recent driver version on Oracle's web site.
    Or: googling for "createDMSSensors" (the "root cause" in the stack trace) has as the first hit: Re: Java Help Please! HttpServlet doFilter() Exception

  • Installation problem with NW'04 SR1: database connection failed

    Hi all,
    while installing NW '04 SR1 on Windows Server 2003 SP1 and MS SQL Server 2000 SP4 I ran into an error related to the database connection. While performing the step "Load Java Database content" SAPinst crashes with the message
    com.sap.sql.log.OpenSQLException: Could not load class com.ddtek.jdbc.sqlserver.SQLServerDriver.
    The connection to the SLQ Server with e.g. the Query Analyzer is OK. I had a problem with this installation setup before (have a look at the corresponding <a href="https://forums.sdn.sap.com/thread.jspa?threadID=338638&tstart=0">thread</a> ), the JDBC drivers where missing on the installation master but after copying them in the right direction the installation went on with no problem up to this point...
    Has anybody an idea what could have happened here? Is this maybe a problem connected to the one I recently had
    Below I attached the sapinst.log and jload.log with more detailed messages.
    sapinst.log ###########
    INFO 2007-03-12 22:06:24
    Working directory changed to C:\PROGRA1\SAPINS1\NW04SR1\WEBAS_~1\ONE_HOST.
    INFO 2007-03-12 22:06:24
    Output of D:\Java/bin/java.exe '-classpath' './sharedlib/antlr.jar;./sharedlib/exception.jar;./sharedlib/jddi.jar;./sharedlib/jload.jar;./sharedlib/logging.jar;./sharedlib/offlineconfiguration.jar;./sharedlib/opensqlsta.jar;./sharedlib/tc_sec_secstorefs.jar;D:\usr\sap/WPT/JC10/j2ee\jdbc\base.jar;D:\usr\sap/WPT/JC10/j2ee\jdbc\util.jar;D:\usr\sap/WPT/JC10/j2ee\jdbc\sqlserver.jar;D:\usr\sap/WPT/JC10/j2ee\jdbc\spy.jar;D:/usr/sap/WPT/SYS/global/security/lib/tools/iaik_jce_export.jar;D:/usr/sap/WPT/SYS/global/security/lib/tools/iaik_jsse.jar;D:/usr/sap/WPT/SYS/global/security/lib/tools/iaik_smime.jar;D:/usr/sap/WPT/SYS/global/security/lib/tools/iaik_ssl.jar;D:/usr/sap/WPT/SYS/global/security/lib/tools/w3c_http.jar' '-showversion' '-Xmx512m' 'com.sap.inst.jload.Jload' '-sec' 'WPT,jdbc/pool/WPT,D:\usr\sap\WPT\SYS\global/security/data/SecStore.properties,D:\usr\sap\WPT\SYS\global/security/data/SecStore.key' '-dataDir' 'S:/D51030724\J2EE_OSINDEP\J2EE-ENG/JDMP' '-job' 'C:\PROGRA1\SAPINS1\NW04SR1\WEBAS_1\ONE_HOST/IMPORT.XML' '-log' 'C:\PROGRA1\SAPINS1\NW04SR1\WEBAS_1\ONE_HOST/jload.log' is written to the logfile C:\PROGRA1\SAPINS1\NW04SR1\WEBAS_~1\ONE_HOST/jload.java.log.
    WARNING 2007-03-12 22:06:26
    Execution of the command "D:\Java/bin/java.exe '-classpath' './sharedlib/antlr.jar;./sharedlib/exception.jar;./sharedlib/jddi.jar;./sharedlib/jload.jar;./sharedlib/logging.jar;./sharedlib/offlineconfiguration.jar;./sharedlib/opensqlsta.jar;./sharedlib/tc_sec_secstorefs.jar;D:\usr\sap/WPT/JC10/j2ee\jdbc\base.jar;D:\usr\sap/WPT/JC10/j2ee\jdbc\util.jar;D:\usr\sap/WPT/JC10/j2ee\jdbc\sqlserver.jar;D:\usr\sap/WPT/JC10/j2ee\jdbc\spy.jar;D:/usr/sap/WPT/SYS/global/security/lib/tools/iaik_jce_export.jar;D:/usr/sap/WPT/SYS/global/security/lib/tools/iaik_jsse.jar;D:/usr/sap/WPT/SYS/global/security/lib/tools/iaik_smime.jar;D:/usr/sap/WPT/SYS/global/security/lib/tools/iaik_ssl.jar;D:/usr/sap/WPT/SYS/global/security/lib/tools/w3c_http.jar' '-showversion' '-Xmx512m' 'com.sap.inst.jload.Jload' '-sec' 'WPT,jdbc/pool/WPT,D:\usr\sap\WPT\SYS\global/security/data/SecStore.properties,D:\usr\sap\WPT\SYS\global/security/data/SecStore.key' '-dataDir' 'S:/D51030724\J2EE_OSINDEP\J2EE-ENG/JDMP' '-job' 'C:\PROGRA1\SAPINS1\NW04SR1\WEBAS_1\ONE_HOST/IMPORT.XML' '-log' 'C:\PROGRA1\SAPINS1\NW04SR1\WEBAS_1\ONE_HOST/jload.log'" finished with return code 1. Output:
    java version "1.4.2_13"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_13-b06)
    Java HotSpot(TM) Client VM (build 1.4.2_13-b06, mixed mode)
    12.03.2007 22:06:25 com.sap.inst.jload.Jload main
    INFO: Jload -sec WPT,jdbc/pool/WPT,D:\usr\sap\WPT\SYS\global/security/data/SecStore.properties,D:\usr\sap\WPT\SYS\global/security/data/SecStore.key -dataDir S:/D51030724\J2EE_OSINDEP\J2EE-ENG/JDMP -job C:\PROGRA1\SAPINS1\NW04SR1\WEBAS_1\ONE_HOST/IMPORT.XML -log C:\PROGRA1\SAPINS1\NW04SR1\WEBAS_1\ONE_HOST/jload.log
    12.03.2007 22:06:26 com.sap.inst.jload.Jload main
    SCHWERWIEGEND: couldn't connect to DB
    com.sap.sql.log.OpenSQLException: Could not load class com.ddtek.jdbc.sqlserver.SQLServerDriver.
    ERROR 2007-03-12 22:06:26
    CJS-20065  Execution of JLoad tool 'D:\Java/bin/java.exe '-classpath' './sharedlib/antlr.jar;./sharedlib/exception.jar;./sharedlib/jddi.jar;./sharedlib/jload.jar;./sharedlib/logging.jar;./sharedlib/offlineconfiguration.jar;./sharedlib/opensqlsta.jar;./sharedlib/tc_sec_secstorefs.jar;D:\usr\sap/WPT/JC10/j2ee\jdbc\base.jar;D:\usr\sap/WPT/JC10/j2ee\jdbc\util.jar;D:\usr\sap/WPT/JC10/j2ee\jdbc\sqlserver.jar;D:\usr\sap/WPT/JC10/j2ee\jdbc\spy.jar;D:/usr/sap/WPT/SYS/global/security/lib/tools/iaik_jce_export.jar;D:/usr/sap/WPT/SYS/global/security/lib/tools/iaik_jsse.jar;D:/usr/sap/WPT/SYS/global/security/lib/tools/iaik_smime.jar;D:/usr/sap/WPT/SYS/global/security/lib/tools/iaik_ssl.jar;D:/usr/sap/WPT/SYS/global/security/lib/tools/w3c_http.jar' '-showversion' '-Xmx512m' 'com.sap.inst.jload.Jload' '-sec' 'WPT,jdbc/pool/WPT,D:\usr\sap\WPT\SYS\global/security/data/SecStore.properties,D:\usr\sap\WPT\SYS\global/security/data/SecStore.key' '-dataDir' 'S:/D51030724\J2EE_OSINDEP\J2EE-ENG/JDMP' '-job' 'C:\PROGRA1\SAPINS1\NW04SR1\WEBAS_1\ONE_HOST/IMPORT.XML' '-log' 'C:\PROGRA1\SAPINS1\NW04SR1\WEBAS_1\ONE_HOST/jload.log'' aborts with returncode 1. Check 'C:\PROGRA1\SAPINS1\NW04SR1\WEBAS_1\ONE_HOST/jload.log' and 'C:\PROGRA1\SAPINS1\NW04SR1\WEBAS_1\ONE_HOST/jload.java.log' for more information.
    jload.log ###########
    12.03.07 22:06 com.sap.inst.jload.Jload main
    INFO: Jload -sec WPT,jdbc/pool/WPT,D:\usr\sap\WPT\SYS\global/security/data/SecStore.properties,D:\usr\sap\WPT\SYS\global/security/data/SecStore.key -dataDir S:/D51030724\J2EE_OSINDEP\J2EE-ENG/JDMP -job C:\PROGRA1\SAPINS1\NW04SR1\WEBAS_1\ONE_HOST/IMPORT.XML -log C:\PROGRA1\SAPINS1\NW04SR1\WEBAS_1\ONE_HOST/jload.log
    12.03.07 22:06 com.sap.inst.jload.Jload main
    SEVERE: couldn't connect to DB
    com.sap.sql.log.OpenSQLException: Could not load class com.ddtek.jdbc.sqlserver.SQLServerDriver.
    Best regards,
    Bernd

    Hello Kairat,
    Please follow the below mentioned guide to install it.
    Check all the parameters to set and run pre requisite checker before starting installation.
    Keep in mind that before starting any SAP installation you should always run prerequisite checker.
    https://websmp205.sap-ag.de/instguides --> SAP Netweaver -->SAP Netweaver 7.0 -- > Installations --> EHP2
    Regards,
    Amit Barnawal

  • Closing the database connection after report in a server application

    I searched these forums and the internet for a definitive answer on asking the Crystal SDK for java to close the jdbc connection after it has generated a report.  We have been using the Crystal Report SDK to generate reports within our JEE application, built upon the Spring framework, for the past two years.  It works well, especially if you prepare views in the database for your reports.
    From what I can tell once you have used ReportClientDocument to create your report you all the close() method to release resources associated with report generation, but this does not close the jdbc database connection.
    Further research states that if you are using the CrystalReportViewer you can call the dispose method to close the database connection.  We are not using JSP nor this class, so that does us little good.
    Finally I found a post that one could call ((AdvancedReportDocument)reportClientDocument.getReportSource()).dispose().  This doesn't drop the connection either.
    Each report actually opens 3 connections according to SQL Server.  Each report will reuse the connections it has open, so for 50 reports, theoretically, we could have up to 150 connections.  We explained to our client those connections  remain inactive, however this is unacceptable to our client as they would like to minimize the number of connections left open to their database.
    If anyone can post any further information on this issue, it is much appreciated.

    Yes, another team member found the issue.  Quite embarrassing really I didn't see it.  I was looking for the answer within Crystal's libraries.  It had nothing to do with Crystal.
    The developer who wrote the helper code for using Crystal first opened a connection to the datasource for the live production database and read that connection information for the report. Next he set that connection information in the report template's PropertyBag, then ran the report. The developer however forgot to close the connection he used to look up the connection info, leaving a memory leak and using up all the connections.
    I'm glad you inquired.  I forgot to post the resolution here.

  • Error while applying a patch "Unable to get the database connection"

    Dear Experts,
    A patch which got successfully applied is failing Production and the error is kind of surprising to me.
    Apps version is 11.5.10.2
    db version is 10.2.0.4
    The worker log file shows
    Time when worker restarted job: Thu Nov 24 2011 22:14:52
    Start time for file is: Thu Nov 24 2011 22:14:52
    adjava -ms128m -mx256m -nojit oracle.apps.fnd.odf2.FndXdfCmp &un_apps &pw_apps &un_apps &pw_apps &jdbc_protocol &jdbc_db_addr table &fullpath_pa_patch/115
    Reading product information from file...
    Reading language and territory information from file...
    Reading language information from applUS.txt ...
      Temporarily resetting CLASSPATH to:
      "/erp/oracle/prodappl/ad/11.5.0/java/adjri.zip:/usr/java14/jre/lib/charsets.jar:/usr/java14/jre/lib/core.jar:/usr/java14/jre/lib/graphics.jar:/usr/java1
      Calling /usr/java14/bin/java ...
    Exception occured
                  Copyright (c) 2003 Oracle Corporation
                     Redwood Shores, California, USA
             XDF(XML Object Description File) Comparison Utility
                            Version 1
    NOTE: You may not use this utility for custom development
          unless you have written permission from Oracle Corporation.
    Unable to get the database connection using schema username/passwordIo exception: The Network Adapter could not establish the connection
    AD Run Java Command is complete.
                         Copyright (c) 2002 Oracle Corporation
                            Redwood Shores, California, USA
                                        AD Java
                                     Version 11.5.0
    NOTE: You may not use this utility for custom development
          unless you have written permission from Oracle Corporation.
    AD Worker error:
    The above program failed.  See the error messages listed
    above, if any, or see the log and output files for the program.
    Time when worker failed: Thu Nov 24 2011 22:14:53
    {code}
    The error says database connection error.  I am able to connect to the database using sqlplus.  I tried to restart the failed worker, but the same error is repeating. 
    Any help would be appreciated.
    Thanks
    qARS
    Edited by: user7640966 on Nov 24, 2011 9:07 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Hussein,
    One thing which I noticed now is in the apps Tier the
    tnsnames.ora under $TNS_ADMIN
    shows entry like this:
    PROD=
            (DESCRIPTION=
                    (ADDRESS=(PROTOCOL=tcp)(HOST=<appsServerName>)(PORT=1521))
                    (ADDRESS=(PROTOCOL=tcp)(HOST=<dbServer>)(PORT=1521))
                (CONNECT_DATA=
                    (SID=PROD)
            )Actually *(ADDRESS=(PROTOCOL=tcp)(HOST=<appsIPaddress>)(PORT=1521))* this line in the tnsnames.ora is not correct. In fact the appsServerName should be replaced with dbServerName
    I deleted the tnsnames.ora and reran autoconfig but it is again recreating the same entry.
    Any clue how this can be fixed?
    Thanks
    qARS

  • Can not find Function module in Crystal Report Database Connections FN

    Hi,
    we designed a Function Module XX in SE80.
    We set up BO Interagtion for SAP
    We can connect to the R3( CRM) System.
    We can See FN's.
    We can not see our Function Module XX we designed in SE80 in the Database Connection
    What is missing ?
    Any Authorization missing ?
    Which Where
    Thanks
    Martin Sautter

    Yes,
    we just have got it:
    /Database Assistant / Data / My Connections/<myConnection>/FN -> Right Mice Button/ Options ->  Table Name Like: <MYTABLE>
    than
    /Right Mice Button/Regenerate
    Thanks
    Martin

  • Problem with having several database connection registered in JDEVElOPER

    Hi
    Thank you for reading my post
    I have several AS registered in my Jdeveloper environemtn and several database connections.
    unfortunately some times Jdeveloper can not deploy an application into a server beacause it say that "I failed to create the connection pool", the project has no database stuff at all but Jdeveloper try to register and create connection pools for those connection that i hace registered in the Databse coonnection node.
    It fails because in that particular server which i want to deploy the application i have not add all databases JDBC driver.
    is there any solution for it?
    thanks

    Hi,
    see Tools --> Preferences --> Deployment
    Uncheck the "Bundle default data-sources.xml during deployment
    Frank

  • Problem with database connection in Jdev 11

    Hello,
    my jdev version is 11 and i want do really simple task create new database connection to my oracle db.
    I open database navigator and click new connection. i want jdbc connection but after i fill this form i pressed test connection button and get this error msg:
    Test failed: 4
    i think i have correct information but i tried this, i opened my older jdev 10 and copy jdbc url from my old db connection.
    In jdev 11 i checked Enter Custom JDBS Url and pasted url from jdev 10 and i get:
    Test failed: 4
    What is wrong?
    Thanks for your advice.
    J.

    I add new information:
    i cant connect to oracle db 8, but i try another db in my company which is 10 and its working fine.
    I write java class and try connect to db 8 via jdbc manually:
    String url = "jdbc:oracle:thin:@SERVER:1525:SID";
    String user = "user1";
    String password = "aaa";
    Class.forName("oracle.jdbc.driver.OracleDriver");
    // DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
    Connection conn = DriverManager.getConnection(url, user, password);
    and i get this:
    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4
         at oracle.jdbc.driver.T4C8TTIdty.marshal(T4C8TTIdty.java:468)
         at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:339)
         at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:621)
         at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:203)
         at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:34)
         at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:501)
         at java.sql.DriverManager.getConnection(DriverManager.java:525)
         at java.sql.DriverManager.getConnection(DriverManager.java:171)
         at project1.Class1.main(Class1.java:31)
    i hope this will be more usefull and i know i write this info about db's version little bit late.
    J.

  • Creating new Data Source Error - Database connection Failed

    Successfully installed and configured 11.1.1.3.0. Planning and Essbase dev.
    Went to Workspace > Administer > Classing Planning Administration > Manage Data Sources > Create Data Source.
    Entered all info about the application database , etc. Getting error "The database connection failed" (I was able to connect with no problem during the install)
    SQL server 2005 is on the same physical server.
    The diagnostic tool shows database connection passed for planning. A new database was created for the new application.
    The server event viewer shows these errors.
    "Login failed for user 'xxx-hyperion'. The user is not associated with a trusted SQL Server connection."
    Group Policy Error "The client-side extension could not apply computer policy settings for 'Default Domain Policy {xxx}' because it failed with error code '0x80070003 The system cannot find the path specified.' See trace file for more details. "
    The Group Policy client-side extension Group Policy Services failed to execute. Please look for any errors reported earlier by that extension.
    Any help is appreciated.

    Datasource for the application.
    I have created a sql db for this planning application (my datasource). See my first message for more details.
    When you create a new planning application, you need to associate it with a data source. Since this is a new install, I don't have any data sources available yet.
    So, "To create, edit or delete data sources, click Manage Data Source."
    This page lets you validate your connection to the database and essbase server. My essbase server connection validates! The database connection does not validate after I enter all the relevant information.
    SCREEN INFO BELOW
    Fields displayed with an asterisk (*) are mandatory.
    Data Source Name *:
    Data Source Description:
    Select Database Platform
    Microsoft SQL Server
    Application Database
    Server * :
    Port * :
    Database *:
    User *:
    Password *:
    Click "Validate Database Connection"
    ERROR ---> Database connection failed.
    So it does not let me create a data source for my new planning application, so I cannot create a new planning application.
    Thanks in advance.

  • JDBC Adapter - Established database connection failed

    Hi Guys,
    we have installed the JDBC Adapter based on the How To Guide and we checked after the installation the  Libaries :Cluster --> Server --> Libraries --> com.sap.aii.af.jmsproviderlib and the box Box "JARs Contained" was filled.
    So in my point of view we have done everything right during the installation.
    Now the developer tested theJDBC Adapter and he comes back with following Error:
    Attempt to establish database connection failed with SQL error com.sap.aii.adapter.jdbc.sql.DriverManagementException: Cannot establish connection to URL "jdbc:microsoft:sqlserver://xxx.x.xx.xxx:1433; databaseName=CZZ03;":ClassNot FoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
    Do you have any ideas?
    Regards
    Markus

    Hello Markus,
    To install JDBC driver follow the how to guide.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi-how-to-guides/how%20to%20install%20and%20configure%20external%20drivers%20for%20jdbc%20and%20jms%20adapters.pdf
    Configuration of JDBC Adapter for SQL Server
    JDBC Driver = com.microsoft.jdbc.sqlserver.SQLServerDriver
    Connection = jdbc:microsoft:sqlserver://hostname:<port>;DatabaseName=<DBName>
    UserID and Password.
    If the connection is not working find the correct port number.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40b92770-db81-2a10-8e91-f747188d8033
    JDBC- X I -  R/3 Scenario
    /people/bhavesh.kantilal/blog/2006/07/03/jdbc-receiver-adapter--synchronous-select-150-step-by-step
    /people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30
    Thanks,
    Satya Kumar
    Reward Points If it is Useful..

  • J2EE Struts - Database connection failed - help???:(

    Hello,
    I have built a little web application and it works without any problems. In the next step I tried to add a database connection but I have already worked on it for at least one day and I could not fix the problem with the database connection.
    I downloaded the MySQL Server 5.0 and installed it, furthermore I have downloaded the jdbc driver mysql-connector-java-3.1.11.zip and extracted it to the MySQL Server 5.0 directory. Furthermore I have added under system settings - system - etended - system variables the whole path to the driver -> C:\Programme\MySQL\MySQL Server 5.0\mysql-connector-java-3.1.11\mysql-connector-java-3.1.11-bin.jar to the CLASSPATH systemvariable.
    Then I have startet the SQL Server 5.0 with mysqld --console from the command line.
    Furthermore I have added under Project-Properties-Java Build Path - Libraries - Add External JARs in Eclipse the mysql-connector-java-3.1.11-bin.jar to my Struts WebProject.
    To test the whole thing I have added to the existing test-database from mysql a table named owner and wanted to test the database connection in the Action-class with the following statements - I quote the whole execute method of the OwnerAction class:
    public ActionForward execute(
                     ActionMapping mapping,
                     ActionForm form,
                     HttpServletRequest request,
                     HttpServletResponse response)
                     throws Exception {
                   OwnerForm ownerForm = (OwnerForm) form;
                   String greet = ownerForm.getGreet();
                   String name = ownerForm.getName();
                   request.setAttribute("name", name);
                   request.setAttribute("greet", greet);
                   String address = ownerForm.getAddress();
                   String email = ownerForm.getEmail();
                   int tel = ownerForm.getTel();
                   Connection conn = null;
                   Statement stmt = null;
                   ResultSet rs = null;
                   DriverManager.registerDriver(new org.gjt.mm.mysql.Driver());
                   conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","sa");
                   try {
                         //conn = dataSource.getConnection();
                         stmt = conn.createStatement();
                         int id = 0;
                         rs = stmt.executeQuery("select max(id) as counter from owner");
                         while(rs.next()){
                            id = rs.getInt("counter");
                         id += 1;
                         stmt.executeUpdate("insert into owner values("+id+", '"+greet+"', '"+name+"', '"+email+"', '"+address+"', "+tel+")");
                         rs.close();
                         stmt.close();
                         conn.close();
                      catch(SQLException e){
                         throw new SQLException("database error");
                      // Forward control to the specified success target
                      return (mapping.findForward("success"));
          }But when I execute the WebApplication and the Action will be called the following error message appears in the browser:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Servlet execution threw an exception
         org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
    root cause
    java.lang.NoClassDefFoundError: org/gjt/mm/mysql/Driver
         com.asprise.struts.action.OwnerAction.execute(OwnerAction.java:72)
         org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
         org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
         org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5 logs.
    It must depend with anything that the driver was not found but I have defined it in the CLASSPATH variable and added it to the Web-Project in eclispe.
    Has anybody an idea what I have else made wrong or have forgotten??:(:(:(
    thanks in advance
    lg
    pat

    One thing I have forgotten - I have also copied the mysql-connector-java-3.1.11-bin.jar in the WebRoot\WEB-INF\lib directory of my EasyStruts WebApplication.
    Can anything else be wrong??:(:((
    regards

  • J2EE - database connection failed...:(:(:(

    Hello,
    I have built a little web application and it works without any problems. In the next step I tried to add a database connection but I have already worked on it for at least one day and I could not fix the problem with the database connection.
    I downloaded the MySQL Server 5.0 and installed it, furthermore I have downloaded the jdbc driver mysql-connector-java-3.1.11.zip and extracted it to the MySQL Server 5.0 directory. Furthermore I have added under system settings - system - etended - system variables the whole path to the driver -> C:\Programme\MySQL\MySQL Server 5.0\mysql-connector-java-3.1.11\mysql-connector-java-3.1.11-bin.jar to the CLASSPATH systemvariable.
    Then I have startet the SQL Server 5.0 with mysqld --console from the command line.
    Furthermore I have added under Project-Properties-Java Build Path - Libraries - Add External JARs in Eclipse the mysql-connector-java-3.1.11-bin.jar to my Struts WebProject.
    To test the whole thing I have added to the existing test-database from mysql a table named owner and wanted to test the database connection in the Action-class with the following statements - I quote the whole execute method of the OwnerAction class:
    public ActionForward execute(
                     ActionMapping mapping,
                     ActionForm form,
                     HttpServletRequest request,
                     HttpServletResponse response)
                     throws Exception {
                   OwnerForm ownerForm = (OwnerForm) form;
                   String greet = ownerForm.getGreet();
                   String name = ownerForm.getName();
                   request.setAttribute("name", name);
                   request.setAttribute("greet", greet);
                   String address = ownerForm.getAddress();
                   String email = ownerForm.getEmail();
                   int tel = ownerForm.getTel();
                   Connection conn = null;
                   Statement stmt = null;
                   ResultSet rs = null;
                   DriverManager.registerDriver(new org.gjt.mm.mysql.Driver());
                   conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","sa");
                   try {
                         //conn = dataSource.getConnection();
                         stmt = conn.createStatement();
                         int id = 0;
                         rs = stmt.executeQuery("select max(id) as counter from owner");
                         while(rs.next()){
                            id = rs.getInt("counter");
                         id += 1;
                         stmt.executeUpdate("insert into owner values("+id+", '"+greet+"', '"+name+"', '"+email+"', '"+address+"', "+tel+")");
                         rs.close();
                         stmt.close();
                         conn.close();
                      catch(SQLException e){
                         throw new SQLException("database error");
                      // Forward control to the specified success target
                      return (mapping.findForward("success"));
          }But when I execute the WebApplication and the Action will be called the following error message appears in the browser:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Servlet execution threw an exception
         org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
    root cause
    java.lang.NoClassDefFoundError: org/gjt/mm/mysql/Driver
         com.asprise.struts.action.OwnerAction.execute(OwnerAction.java:72)
         org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
         org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
         org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5 logs.
    It must depend with anything that the driver was not found but I have defined it in the CLASSPATH variable and added it to the Web-Project in eclispe.
    Has anybody an idea what I have else made wrong or have forgotten??:(:(:(
    thanks in advance
    lg
    pat

    One thing I have forgotten - I have also copied the mysql-connector-java-3.1.11-bin.jar in the WebRoot\WEB-INF\lib directory of my EasyStruts WebApplication.
    Can anything else be wrong??:(:((
    regards

Maybe you are looking for

  • In Oracle 11.5.10.2 Advance Pricing, quantity discount in ranges

    In Oracle 11.5.10.2 Advance Pricing, we have a requirement. free item promotion based on range of items ordered. Eg: If customer buy 10 qty then 2 free, else, if customer buy 20 qty. then 5 qty free, else, if if customer buy 30 then get 8 qty free. H

  • Problems when cinema display attached to PowerBook

    I have a new PowerBook G4 (15" stretch) with OS 10.4.5. I also have a new 20" Apple cinema display. When the display is attached to the PowerBook, I've noticed a host of problems, including: HP LaserJet 1022 (new) prints only about 50% of the time--r

  • Suppressing "reopen windows" dialog when restarting a crashed program

    Hi All, Is there any way of suppressing the alert dialog that pops up when restarting a crashed program? The alert's text reads: "The last time you opened <app name>, it unexpectedly quit while reopening windows. Do you want to try to reopen its wind

  • Dreamweaver Trial Not Functioning

    Hello there. I just downloaded a trial version for Dreamweaver 8 and when I open it, it quits without telling me anything. What could be wrong? I'm using a MacBook Intel-based 10.4 OS Version. Please help.

  • HELP! iPod sorting artists that start with "The" under "T"

    OK, so I synced my iPod classic last night, and now ALL artists that start with "The" are listed alphabetically under "T". Prior to last sync, it had never done this. I didn't change any setting, the only reason for the sync was to add a podcast that