JDBC(JNDI):Connection dinamically managed

Hi all,
I'm using
1) Crystal Reports 2008 for the reports' design,
2) Java Reporting Component (version 18.8.4.1094) for the integration in java environment,
3) JBoss (version 4.2.3) as Application Server
4) Oracle 11 as DBMS
in a web application.
When I create a report using JDBC (JNDI) and specify as the "Connection Name (optional)" the following string "java:jdbc/name_data_source",
How is managed the connection of the report and any sottoreports? In other words are the connections dynamically managed by the container web or ejb?
Thank you very much.

Hi, Andrea,
I'm gonna' make a few guesses here:
2) Java Reporting Component (version 18.8.4.1094)
I think you mean Crystal Reports for Java (CRJ) 2.8 version 12.2.209.1094. Neither the JRC (the name for the 1.x series) nor the CRJ (the 2.x series) has any version number in the 18.x range.
sottoreports
I think that means "subreports."
are the connections dynamically managed by the container web or ejb?
There are two ways the connections can be managed. If you've created a JNDI connection (a named connection), then you can base a report off of it, then at a later date change where the JNDI connection itself points to and the report should still work correctly, as long as the new target database shares the same schema as the original.
The other way you can manage the connection is to use code to change the database connection information inside the report itself. In this way, you could change it from one JNDI connection to another or even to another type of connection altogether. Again, however, the schemas between the old and the new connections must match.
Regards,
Bryan

Similar Messages

  • CR4E - New JDBC (JNDI) connection at runtime

    Is it possible to create a new JDBC (JNDI) connection at runtime using the propertyBag to set the attributes?  I tried this but received error message stating "error finding jndi name".

    Are you specifying a JDBC or JNDI connection?
    If JDBC, did you set the (Optional) JNDI Connection property?
    If you set the JNDI property for the JDBC connection, it'll try connecting to the JNDI.
    The JDBC has the optional JNDI property, so that you can design a report against JDBC, then use the JNDI when deployed to a J2EE.
    Sincerely,
    Ted Ueda

  • A bug in creator when creating jdbc jndi connection

    Hi,
    I am using sun java studio creator for jdbc jndi connection. The syntax is
    Context ctx = new InitialContext();
    DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/mydb");
    conn = ds.getConnection();
    It's failed. Once I change to ctx.lookup("jdbc/mydb") and the connection is created.
    Once deployed to tomcat, it seems only java:comp/env/jdbc/mydb is working.
    The full path(java:comp/env/jdbc/mydb) seems right from my google search.
    Why creator using jdbc/mydb? Is it a bug to creator?
    Thanks,
    Jie

    I mean a resource reference in web.xml file that looks like this:
         <resource-ref id="ResourceRef_1103225373500">
              <res-ref-name>DBConnection</res-ref-name>
              <res-type>javax.sql.DataSource</res-type>
              <res-auth>Application</res-auth>
              <res-sharing-scope>Shareable</res-sharing-scope>
         </resource-ref>
    where DBConnection is the resource alias I mentioned before:
    DataSource ds = (DataSource)ctx.lookup("java:comp/env/DBConnection");
    Using WebSphere a binding between this above defined ResourceRef and JNDI mapping must be defined in a file called ibm-web-bnd.xmi. The content of this file will look like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <webappbnd:WebAppBinding xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:webappbnd="webappbnd.xmi" xmi:id="WebAppBinding_1" virtualHostName="default_host">
    <webapp href="WEB-INF/web.xml#WebApp"/>
    <resRefBindings xmi:id="ResourceRefBinding_1103225373500" jndiName="jdbc/mydb">
    <bindingResourceRef href="WEB-INF/web.xml#ResourceRef_1103225373500"/>
    </resRefBindings>
    </webappbnd:WebAppBinding>
    Obviously using WSAD all of that could be done using IDE. In your case and using Sun IDE, I am not sure. But this is basically the concept of needed mapping in order to reference your JNDI without getting an error. At least this is how we resolved the error you are encountering.
    Hope that helps!

  • How to configure jdbc/jndi connection in crystal report 10

    Post Author: effy
    CA Forum: Data Connectivity and SQL
    i have tried to configure jdbc/jndi connection , i have both
    drivers  data base side and  crystal report side but i
    can't  configure it.  so please help if u know
    something. 

    Sorry, but I'm not on a home pc, I'm working on a virtualized pc with a long chain of permissions ... so I cannot simply download and run an utility...
    Instead... I think (I WAS thinking) someone from SAP can tell me this info ... Probably I'll buy a paid assistance ticket... But really it's a strange thing that a simply connection from a (so) paid software need a so difficult problem solving routine..
    I edited my environment variales: JAVA, PATH; CLASSPATH; JAVA_DIR, and a long list of others ... to ALL point to ALL of directory containing used jars...
    .. I asked my SysAdmin to edit CrConfig.xml and it's done ... classpath are rights, jdbc infos are also ok, ...
    .. but none ...

  • Cannot connect MS SQL Server2005 by using JDBC(JNDI) connection

    Hi all,
    I met a problem when I was trying to create a JDBC(JNDI) connection in crystal report 2008, the following error dialog shows up, it said:
    Database Connector Error: 'SQL Exceptions: [SQL State:] S1000 [Error Message:] [Microsoft][SQL Native Client]Connection is busy with results for another command'
    here is the steps how to reproduce this problem:
    1) create a DSN(Data source name) in ODBC Data Source Administrator dialog, suppose the DSN is test
        (and the DSN test show it works well)
    2) start up Crystal Report 2008, click New to create a new report, the Standard Report Creation Wizard show up
    3) expand Create New Connection node, then double click JDBC(JNDI) note
    4) the JDBC (JNDI) dialog shows up, chooose JDBC Connection in the dialog, and fill the empty fields with:
       Connection URL: jdbc:odbc:test
       Database Classname:sun.jdbc.odbc.JdbcOdbcDriver
    5) click next, it comes to the next pannel, and fill the empty fields with:
        Database: MyTestDB
        UserID: sa
        Password: sa
    6) then click Finish buttion.
    7) a new connection is created, but when I expand the new created connection, an error dialog shows up
      Database Connector Error: 'SQL Exceptions: [SQL State:] S1000 [Error Message:] [Microsoft][SQL Native Client]Connection is busy with results for another command'
    does anyone knows what's wrong with my setting? any help would be appreciated.
    Best Regards
    Tian-liang

    Hi Tian-liang,
    Try using Microsofts JDBC driver rather than Suns. Also search these forums, other have run into the same issue.
    Thank you
    Don

  • EJB3: JNDI connection problem managed server

    Hi all,
    In a JUnit test, I tried to look up a Session EJB from a remote managed server:
    Hashtable<String, String> props = new Hashtable<String, String>();
    props.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    props.put(javax.naming.Context.PROVIDER_URL, "t3://server1.ux.yucom.es:1751");
    props.put(javax.naming.Context.SECURITY_PRINCIPAL, "userName");
    props.put(javax.naming.Context.SECURITY_CREDENTIALS, "pwd");
    props.put(weblogic.jndi.WLContext.ALLOW_EXTERNAL_APP_LOOKUP, "true");
    InitialContext context = new InitialContext(props);
    Command command = (Command) context.lookup(jndiName);
    But the code already fails while instantiating the InitialContext, because of a connection problem:
    Caused by: java.net.ConnectException: t3://server1.ux.yucom.es:1751: Destination unreachable; nested exception is:
         java.net.ConnectException: Connection timed out: connect; No available router to destination
         at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:203)
         at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:153)
         at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:352)
         ... 34 more
    Caused by: java.rmi.ConnectException: Destination unreachable; nested exception is:
         java.net.ConnectException: Connection timed out: connect; No available router to destination
         at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:464)
         at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:315)
         at weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(RJVMManager.java:251)
         at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:194)
         at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:225)
         at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:188)
         ... 36 more
    I'm able to connect to the the Admin server... In this case I receive a javax.naming.NameNotFoundException, obviously, since the remote EJB is only targetted on the managed server and not on the admin.
    This is confirmed by following little test on the command line:
    java -cp %WL_HOME%\server\lib\weblogic.jar weblogic.Admin -url t3://server1.ux.yucom.es:1700 -username <user> -password <pwd> PING
    => OK, packets received
    java -cp %WL_HOME%\server\lib\weblogic.jar weblogic.Admin -url t3://server1.ux.yucom.es:1751 -username <user> -password <pwd> PING
    => Failure:
    Failed to connect to server1.ux.yucom.es:1751: Destination unreachable; nested exception is:
    java.net.ConnectException: Connection timed out: connect; No available router to destination
    Does anyone has an idea why the connection to the managed server fails??
    Is it a configuration problem in WebLogic?
    Thx a lot!
    Wim.

    Hi,
    Are you able to Remotely Access any Simple Web Application deployed on "server1.ux.yucom.es:1751".
    Example: http://server1.ux.yucom.es:1751/TestApp/index.jsp
    If NOT: Means Some where there is a problem with the Port...Just for testing Try Changin Manged Server port to Default HTTP Port (80).
    If Yes: Then there are chances that Your Box is not allowing any t3-Protocol Traffic on 1751 Port. Just for Testing Enable HTTP Tunneling on this Server from Admin Console
    AdminConsole --> Home-->Summary Of Servers --->ManagedServer1 ---> Protocol (Tab) ---> HTTP (SubTab) --->Enable Tunneling (Check This Check Box)    Save the changes.
    And then After restarting your Server ... Try to ping your Server using:
    java -cp %WL_HOME%\server\lib\weblogic.jar weblogic.Admin -url http://server1.ux.yucom.es:1751 -username <user> -password <pwd> PING
    In the Above command Use HTTP protocol instead of T3. If Now u are able to Ping the Server means Your Port 1751 was not allowing any other Protocol except HTTP.
    Thanks
    Jay SenSharma
    http://middlewaremagic.com/weblogic  (Middleware magic Is Here)

  • JNDI connection error - page not rendered properly

    Dear All.
    Always when I go to my application url I have er: "JBO-26061: Error while opening JDBC connection"
    and a page is displayed only partially (not fully rendered).
    In my case i have 5 development enviroments where I'm deploying my application.
    On 3 envs app works prefectly but on 2 not. The only main difference (that i found) between thoese
    servers is a timezone. Env: 1,2,3 has GMT+1 last two GMT. I didn't set up those machines, but from
    far as I was told, configuration is the same. Weblogic version: 10.3.6.0
    Does anybody now how to fix it? Before I will change a time, I would like to get familiar if a time difference could be an issue.
    Regards.
    Robert.
    supposed error in log:
    [ServletContext@556457299[app:iPlatform_v module:app_v.01-ViewController-context-root path:/app_v.01-ViewController-context-root spec-version:2.5]] Servlet failed with Exception
    oracle.jbo.DMLException: JBO-29114 ADFContext is not setup to process messages for this exception. Use the exception stack trace and error code to investigate the root cause of this exception. Root cause error code is JBO-26061.
    at oracle.jbo.server.DBTransactionImpl.establishNewConnection(DBTransactionImpl.java:1034)
    at oracle.jbo.server.DBTransactionImpl.initTransaction(DBTransactionImpl.java:1174)
    at oracle.jbo.server.DBTransactionImpl.initTxn(DBTransactionImpl.java:6826)
    at oracle.jbo.server.DBTransactionImpl2.connectToDataSource(DBTransactionImpl2.java:304)
    at oracle.jbo.server.DBTransactionImpl2.connectToDataSource(DBTransactionImpl2.java:335)...
    Edited by: user623575 on 20-Jun-2012 01:30

    update:
    always when I run my application in weblogic console (Summary of JDBC Data Sources->Monitoring) JDBC DataSource Runtime Statistics show
    state overloaded.
    Active Connections Average Count, Active Connections Current Count, Active Connections High Count = 15.
    I receive this information only on 2 enviroments from 5. Strange case because JNDI connection is configuret exactly the same.
    Any solutions guys?
    Regards.

  • Serious problem of jdbc-mysql connectivity using tomcat

    hi everybody
    i m in serious problem since last 15-20 days. i m trying hard to make the connection jdbc-mysql using tomcat with the help of a jsp test page but every time i am facing almost the similar probems listed below in detail:
    to make sure that the jdrivers's .jar (mysql-connector-java-3.1.7-bin.jar) available for such connections working fine i have tried the above said connection without using tomcat....which is working fine...for this i have created a dummy database with a dummy table ..and written some queries in the .java file of my code which upon running inserts the specified values in the defined(dummy) database.
    this is the confirmation that the classpath etc..are ok in regard to the mysql-connector-java-3.1.7-bin.jar
    now i have placed a copy of this .jar file in to the commons/lib directory of the tomcat web server(which is suppossed to be the place for such external jars)
    after doing so i have followed 2 methods :
    method 1st:........
    i have made aone more jar file from the following .java file....
    import javax.naming.*;
    import javax.sql.*;
    import java.sql.*;
    public class TestSQLLoad
    String user = "Not Connected";
    String pwd = "no pwd";
    int id = -1;
    public void init() {
    try{
    Context ctx = new InitialContext();
    if(ctx == null ) {
    throw new Exception("Boom - No Context");
    DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/TestDB");
    if (ds != null) {
    Connection conn = ds.getConnection();
    if(conn != null) {
    user = "Got Connection "+conn.toString();
    Statement stmt = conn.createStatement();
    String q = "select name, password, id from user";
    ResultSet rst = stmt.executeQuery(q);
    if(rst.next()) {
    user=rst.getString(1);
    pwd=rst.getString(2);
    id = rst.getInt(3);
    conn.close();
    }catch(Exception e) {
    e.printStackTrace();
    public String getUser() {
    return user;
    public String getPassword() {
    return pwd;
    public int getID()
    return id;
    after compiling it at the cmd prompt i made a .jar file from the .class of it and named it MySQLLoad.jar...then i placed it also in to the commons/lib directory where the mysql-connector-java-3.1.7-bin.jar was already placed.
    then i have changed the server.xml and web.xml files from the conf directory of the tomcat as given here:
    server.xml
    <!-- 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="8005" 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" />
    <!-- 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 -->
    <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">
    <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
    <Connector
    port="80" maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false" redirectPort="8443" acceptCount="100"
    connectionTimeout="20000" disableUploadTimeout="true" />
    <!-- Note : To disable connection timeouts, set connectionTimeout value
    to 0 -->
    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009"
    enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
    <!-- Define the top level container in our container hierarchy -->
    <Engine name="Catalina" defaultHost="localhost">
    <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
    resourceName="UserDatabase"/>
    <Host name="localhost" appBase="webapps"
    unpackWARs="true" autoDeploy="true"
    xmlValidation="false" xmlNamespaceAware="false">
    <Context path="/testdb" docBase="TOMCAT_HOME/webapps/tomcat-docs/testdb"
    debug="5" reloadable="true" crossContext="true" >
    <Logger className="org.apache.catalina.logger.FileLogger"
    prefix="localhost_DBTest_log." suffix=".txt"
    timestamp="true"/>
    <Resource name="jdbc/TestDB"
    auth="Container"
    type="javax.sql.DataSource"/>
    <ResourceParams name="jdbc/TestDB">
    <parameter>
    <name>factory</name>
    <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
    </parameter>
    <parameter>
    <name>maxActive</name>
    <value>10</value>
    </parameter>
    <parameter>
    <name>maxIdle</name>
    <value>5</value>
    </parameter>
    <parameter>
    <name>maxWait</name>
    <value>10000</value>
    </parameter>
    <!-- MySQL dB username and password for dB connections -->
    <parameter>
    <name>username</name>
    <value>root</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>mysql</value>
    </parameter>
    <!-- Class name for mm.mysql JDBC driver -->
    <parameter>
    <name>driverClassName</name>
    <value>com.mysql.jdbc.Driver</value>
    </parameter>
    <parameter>
    <name>url</name>
    <value>jdbc:mysql://localhost/testdb?autoReconnect=true</value>
    </parameter>
    </ResourceParams>
    </Context>
    </Host>
    </Engine>
    </Service>
    </Server>
    and the other xml file i.e
    web.xml is here:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">
    <servlet>
    <servlet-name>default</servlet-name>
    <resource-ref>
    <description>DB Connection</description>
    <res-ref-name>jdbc/TestDB</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-cl ***>
    <init-param>
    <param-name>debug</param-name>
    <param-value>0</param-value>
    </init-param>
    <init-param>
    <param-name>listings</param-name>
    <param-value>true</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
    <servlet-name>invoker</servlet-name>
    <servlet-class>
    org.apache.catalina.servlets.InvokerServlet
    </servlet-class>
    <init-param>
    <param-name>debug</param-name>
    <param-value>0</param-value>
    </init-param>
    <load-on-startup>2</load-on-startup>
    </servlet>
    <servlet>
    <servlet-name>jsp</servlet-name>
    <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
    <init-param>
    <param-name>fork</param-name>
    <param-value>false</param-value>
    </init-param>
    <init-param>
    <param-name>xpoweredBy</param-name>
    <param-value>false</param-value>
    </init-param>
    <load-on-startup>3</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>invoker</servlet-name>
    <url-pattern>/servlet/*</url-pattern>
    </servlet-mapping>
    <!-- The mapping for the JSP servlet -->
    <servlet-mapping>
    <servlet-name>jsp</servlet-name>
    <url-pattern>*.jsp</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>jsp</servlet-name>
    <url-pattern>*.jspx</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>30</session-timeout>
    </session-config>
    <mime-mapping>
    <extension>abs</extension>
    <mime-type>audio/x-mpeg</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>ai</extension>
    <mime-type>application/postscript</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>aif</extension>
    <mime-type>audio/x-aiff</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>aifc</extension>
    <mime-type>audio/x-aiff</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>aiff</extension>
    <mime-type>audio/x-aiff</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>aim</extension>
    <mime-type>application/x-aim</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>art</extension>
    <mime-type>image/x-jg</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>asf</extension>
    <mime-type>video/x-ms-asf</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>asx</extension>
    <mime-type>video/x-ms-asf</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>au</extension>
    <mime-type>audio/basic</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>avi</extension>
    <mime-type>video/x-msvideo</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>avx</extension>
    <mime-type>video/x-rad-screenplay</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>bcpio</extension>
    <mime-type>application/x-bcpio</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>bin</extension>
    <mime-type>application/octet-stream</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>bmp</extension>
    <mime-type>image/bmp</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>body</extension>
    <mime-type>text/html</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>cdf</extension>
    <mime-type>application/x-cdf</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>cer</extension>
    <mime-type>application/x-x509-ca-cert</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>class</extension>
    <mime-type>application/java</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>cpio</extension>
    <mime-type>application/x-cpio</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>csh</extension>
    <mime-type>application/x-csh</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>css</extension>
    <mime-type>text/css</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>dib</extension>
    <mime-type>image/bmp</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>doc</extension>
    <mime-type>application/msword</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>dtd</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>dv</extension>
    <mime-type>video/x-dv</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>dvi</extension>
    <mime-type>application/x-dvi</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>eps</extension>
    <mime-type>application/postscript</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>etx</extension>
    <mime-type>text/x-setext</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>exe</extension>
    <mime-type>application/octet-stream</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>gif</extension>
    <mime-type>image/gif</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>gtar</extension>
    <mime-type>application/x-gtar</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>gz</extension>
    <mime-type>application/x-gzip</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>hdf</extension>
    <mime-type>application/x-hdf</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>hqx</extension>
    <mime-type>application/mac-binhex40</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>htc</extension>
    <mime-type>text/x-component</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>htm</extension>
    <mime-type>text/html</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>hqx</extension>
    <mime-type>application/mac-binhex40</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>ief</extension>
    <mime-type>image/ief</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>jad</extension>
    <mime-type>text/vnd.sun.j2me.app-descriptor</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>jar</extension>
    <mime-type>application/java-archive</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>java</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>jnlp</extension>
    <mime-type>application/x-java-jnlp-file</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>jpe</extension>
    <mime-type>image/jpeg</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>jpeg</extension>
    <mime-type>image/jpeg</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>jpg</extension>
    <mime-type>image/jpeg</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>js</extension>
    <mime-type>text/javascript</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>jsf</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>jspf</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>kar</extension>
    <mime-type>audio/x-midi</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>latex</extension>
    <mime-type>application/x-latex</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>m3u</extension>
    <mime-type>audio/x-mpegurl</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>mac</extension>
    <mime-type>image/x-macpaint</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>man</extension>
    <mime-type>application/x-troff-man</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>me</extension>
    <mime-type>application/x-troff-me</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>mid</extension>
    <mime-type>audio/x-midi</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>midi</extension>
    <mime-type>audio/x-midi</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>mif</extension>
    <mime-type>application/x-mif</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>mov</extension>
    <mime-type>video/quicktime</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>movie</extension>
    <mime-type>video/x-sgi-movie</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>mp1</extension>
    <mime-type>audio/x-mpeg</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>mp2</extension>
    <mime-type>audio/x-mpeg</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>mp3</extension>
    <mime-type>audio/x-mpeg</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>mpa</extension>
    <mime-type>audio/x-mpeg</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>mpe</extension>
    <mime-type>video/mpeg</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>mpeg</extension>
    <mime-type>video/mpeg</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>mpega</extension>
    <mime-type>audio/x-mpeg</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>mpg</extension>
    <mime-type>video/mpeg</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>mpv2</extension>
    <mime-type>video/mpeg2</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>ms</extension>
    <mime-type>application/x-wais-source</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>nc</extension>
    <mime-type>application/x-netcdf</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>oda</extension>
    <mime-type>application/oda</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>pbm</extension>
    <mime-type>image/x-portable-bitmap</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>pct</extension>
    <mime-type>image/pict</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>pdf</extension>
    <mime-type>application/pdf</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>pgm</extension>
    <mime-type>image/x-portable-graymap</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>pic</extension>
    <mime-type>image/pict</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>pict</extension>
    <mime-type>image/pict</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>pls</extension>
    <mime-type>audio/x-scpls</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>png</extension>
    <mime-type>image/png</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>pnm</extension>
    <mime-type>image/x-portable-anymap</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>pnt</extension>
    <mime-type>image/x-macpaint</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>ppm</extension>
    <mime-type>image/x-portable-pixmap</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>ppt</extension>
    <mime-type>application/powerpoint</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>ps</extension>
    <mime-type>application/postscript</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>psd</extension>
    <mime-type>image/x-photoshop</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>qt</extension>
    <mime-type>video/quicktime</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>qti</extension>
    <mime-type>image/x-quicktime</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>qtif</extension>
    <mime-type>image/x-quicktime</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>ras</extension>
    <mime-type>image/x-cmu-raster</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>rgb</extension>
    <mime-type>image/x-rgb</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>rm</extension>
    <mime-type>application/vnd.rn-realmedia</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>roff</extension>
    <mime-type>application/x-troff</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>rtf</extension>
    <mime-type>application/rtf</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>rtx</extension>
    <mime-type>text/richtext</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>sh</extension>
    <mime-type>application/x-sh</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>shar</extension>
    <mime-type>application/x-shar</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>smf</extension>
    <mime-type>audio/x-midi</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>sit</extension>
    <mime-type>application/x-stuffit</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>snd</extension>
    <mime-type>audio/basic</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>src</extension>
    <mime-type>application/x-wais-source</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>sv4cpio</extension>
    <mime-type>application/x-sv4cpio</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>sv4crc</extension>
    <mime-type>application/x-sv4crc</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>swf</extension>
    <mime-type>application/x-shockwave-flash</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>t</extension>
    <mime-type>application/x-troff</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>tar</extension>
    <mime-type>application/x-tar</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>tcl</extension>
    <mime-type>application/x-tcl</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>tex</extension>
    <mime-type>application/x-tex</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>texi</extension>
    <mime-type>application/x-texinfo</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>texinfo</extension>
    <mime-type>application/x-texinfo</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>tif</extension>
    <mime-type>image/tiff</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>tiff</extension>
    <mime-type>image/tiff</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>tr</extension>
    <mime-type>application/x-troff</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>tsv</extension>
    <mime-type>text/tab-separated-values</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>txt</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>ulw</extension>
    <mime-type>audio/basic</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>ustar</extension>
    <mime-type>application/x-ustar</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>xbm</extension>
    <mime-type>image/x-xbitmap</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>xht</extension>
    <mime-type>application/xhtml</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>xhtml</extension>
    <mime-type>application/xhtml</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>xml</extension>
    <mime-type>text/xml</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>xpm</extension>
    <mime-type>image/x-xpixmap</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>xsl</extension>
    <mime-type>text/xml</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>xwd</extension>
    <mime-type>image/x-xwindowdump</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>wav</extension>
    <mime-type>audio/x-wav</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>svg</extension>
    <mime-type>image/svg</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>svgz</extension>
    <mime-type>image/svg</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>vsd</extension>
    <mime-type>application/x-visio</mime-type>
    </mime-mapping>
    <mime-mapping>
    <!-- Wireless Bitmap -->
    <extension>wbmp</extension>
    <mime-type>image/vnd.wap.wbmp</mime-type>
    </mime-mapping>
    <mime-mapping>
    <!-- WML Source -->
    <extension>wml</extension>
    <mime-type>text/vnd.wap.wml</mime-type>
    </mime-mapping>
    <mime-mapping>
    <!-- Compiled WML -->
    <extension>wmlc</extension>
    <mime-type>application/vnd.wap.wmlc</mime-type>
    </mime-mapping>
    <mime-mapping>
    <!-- WML Script Source -->
    <extension>wmls</extension>
    <mime-type>text/vnd.wap.wmlscript</mime-type>
    </mime-mapping>
    <mime-mapping>
    <!-- Compiled WML Script -->
    <extension>wmlscriptc</extension>
    <mime-type>application/vnd.wap.wmlscriptc</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>wrl</extension>
    <mime-type>x-world/x-vrml</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>Z</extension>
    <mime-type>application/x-compress</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>z</extension>
    <mime-type>application/x-compress</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>zip</extension>
    <mime-type>application/zip</mime-type>
    </mime-mapping>
    <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    </web-app>
    after all this i have taken a jsp page whose code is here:
    (the mysql database used is named as "testdb" and the table name is "user" which is having fields name,password and id)
    <html>
    <head>
    <title>DB Test</title>
    </head>
    <body>
    <%
    TestSQLLoad tst = new TestSQLLoad ( );
    tst.init();
    %>
    <h2>Results</h2>
    User <%= tst.getUser() %>
    Pwd <%= tst.getPassword() %>
    Id <%= tst.getID() %>
    </body>
    </html>
    and placed it in to the Tomcat 5.5\webapps\tomcat-docs\testdb directory and saved as test-db.jsp
    when i run this page on the browser i get a lot may errors stating
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 12 in the jsp file: /testdb/test-db.jsp
    Generated servlet error:
    TestSQLLoad cannot be resolved or is not a type
    An error occurred at line: 12 in the jsp file: /testdb/test-db.jsp
    Generated servlet error:
    TestSQLLoad cannot be resolved or is not a type
    org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.j ava:84)
    org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
    org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:389)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.4 logs.
    AND NOW WHEN just to get rid of such errords i try to include a statement
    <%@ page import="pkg.TestSQLLoad" %> in the jsp page code (and also place the MySQLLoad.class file in a folder called pkg and place it in the same directory where the jsp page is )and make it look like
    <html>
    <head>
    <%@ page import="pkg.TestSQLLoad" %>
    <title>DB Test</title>
    </head>
    <body>
    <%
    TestSQLLoad tst = new TestSQLLoad ( );
    tst.init();
    %>
    <h2>Results</h2>
    User <%= tst.getUser() %>
    Pwd <%= tst.getPassword() %>
    Id <%= tst.getID() %>
    </body>
    </html>
    now when i run it i get the following errors:
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP
    Generated servlet error:
    Only a type can be imported. pkg.TestSQLLoad resolves to a package
    An error occurred at line: 12 in the jsp file: /testdb/test-db.jsp
    Generated servlet error:
    TestSQLLoad cannot be resolved or is not a type
    An error occurred at line: 12 in the jsp file: /testdb/test-db.jsp
    Generated servlet error:
    TestSQLLoad cannot be resolved or is not a type
    org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.j ava:84)
    org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
    org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:389)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    in response to the above error i have even tried placing the MySQLLoad.class directly in the testdb folder along with the jsp page without keeping it in a package named pkg and then importing directly as <@page import="MySQLLoad" %>
    that too gave me the following errors
    org.apache.jasper.JasperException: Unable to compile class for JSP
    Generated servlet error:
    The import TestSQLLoad cannot be resolved
    An error occurred at line: 12 in the jsp file: /testdb/test-db.jsp
    Generated servlet error:
    TestSQLLoad cannot be resolved or is not a type
    An error occurred at line: 12 in the jsp file: /testdb/test-db.jsp
    Generated servlet error:
    TestSQLLoad cannot be resolved or is not a type
    org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.j ava:84)
    org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
    org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:389)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    and if i do not use the statement <%@ page import="MySQLLoad"%> then also i get the errors like
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 11 in the jsp file: /testdb/test-db.jsp
    Generated servlet error:
    TestSQLLoad cannot be resolved or is not a type
    An error occurred at line: 11 in the jsp file: /testdb/test-db.jsp
    Generated servlet error:
    TestSQLLoad cannot be resolved or is not a type
    org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.j ava:84)
    org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
    org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:389)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    THE 2nd Method:
    in my second method i did the same changes in the web.xml and server.xml
    then i took a jsp page with the following code:
    <%@ page import="javax.sql.*,java.sql.*,javax.naming.*,com.mysql.jdbc.*" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> trial doc </TITLE>
    </HEAD>
    <BODY>
    <h1>Trial Document</h1>
    <% InitialContext context=new InitialContext( );
    DataSource dataSource=(DataSource) context.lookup("java:comp/env/jdbc/testdb");
    Connection conn=dataSource.getConnection();
    Statement stmt=conn.createStatement();
    ResultSet rset=stmt.executeQuery("select * from user");
    if (rset.next()){
    %>
    <table width="100%" border="1">
    <tr align="left">
    <th>name</th> <th>password</th><th>id</th>
    </tr>
    <%
    do {
    %>
    <tr><td> <%=rset.getString(1)%> </td>
    <td><%=rset.getString(2) %></td>
    <td><%=rset.getString(3) %></td></tr>
    <%
    } while (rset.next());
    %>
    </table>
    <%
    } else{
    %>
    No results from query
    <%
    rset.close();
    stmt.close();
    conn.close();
    context.close();
    %>
    </BODY>
    </HTML>
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 15 in the jsp file: /testdb/Big1.jsp
    Generated servlet error:
    The type Connection is ambiguous
    An error occurred at line: 15 in the jsp file: /testdb/Big1.jsp
    Generated servlet error:
    The type Statement is ambiguous
    An error occurred at line: 15 in the jsp file: /testdb/Big1.jsp
    Generated servlet error:
    The type ResultSet is ambiguous
    org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.j ava:84)
    org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
    org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:389)
    org.apache.jasper.compiler.Compiler.compile(C

    thanx for ur response
    as u said that the problem is more of a jsp page not getting compiled....
    me also pointed towards the similar situation providing all the surrounding situations
    which i have met and gone through
    i m still thinking that problem may b in the tomcat's server.xml and web.xml as well
    so better if u plz guide me in that regard
    regards,
    kuldeep

  • How to use JDBC database connection in Solaris

    Hi all,
    I am new to Solaris and i want to create an application using JDBC database connection.
    I want a small piece of code, probably a login page code that verifies the username from a OpenOffice database (.odb) file. I am particular to know the driver name, etc. If possible give the code using JNDI loopkup.
    Thanks in advance,
    Parasou.

    Sure no problem.
    Please stand by while I do your work for you.

  • Not able to connect with managed server using ssl connection

    Hi Guys,
    My weblogic server is running on linux. I have setup ssl connction bu using Demo Identity and Demo Trust.In server logs i can find the following infomation that server is running on secure port.
    But once i try connect to managed server using client i m facing below error:
    <May 27, 2013 2:55:00 PM IST> <Info> <Security> <BEA-090905> <Disabling CryptoJ JCE Provider self-integrity check for better startup performance. To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true>
    <May 27, 2013 2:55:00 PM IST> <Info> <Security> <BEA-090906> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG to FIPS186PRNG. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true>
    <May 27, 2013 2:55:00 PM IST> <Info> <Security> <BEA-090908> <Using default WebLogic SSL Hostname Verifier implementation.>
    javax.naming.CommunicationException [Root exception is java.net.ConnectException: t3s://host:port: Destination unreachable; nested exception is:
         javax.net.ssl.SSLHandshakeException: General SSLEngine problem; No available router to destination]
         at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:40)
         at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLInitialContextFactoryDelegate.java:767)
         at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:366)
         at weblogic.jndi.Environment.getContext(Environment.java:315)
         at weblogic.jndi.Environment.getContext(Environment.java:285)
         at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)
         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
         at javax.naming.InitialContext.init(InitialContext.java:242)
         at javax.naming.InitialContext.<init>(InitialContext.java:216)
         at com.akt.client.WLCLIENT.makeConnection(WLCLIENT.java:40)
         at com.akt.client.WLCLIENT.main(WLCLIENT.java:60)
    Caused by: java.net.ConnectException: t3s://host:port: Destination unreachable; nested exception is:
         javax.net.ssl.SSLHandshakeException: General SSLEngine problem; No available router to destination
         at weblogic.rjvm.RJVMFinder.findOrCreateInternal(RJVMFinder.java:216)
         at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:170)
         at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:165)
         at weblogic.jndi.WLInitialContextFactoryDelegate$1.run(WLInitialContextFactoryDelegate.java:345)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
         at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:340)
         ... 9 more
    Caused by: java.rmi.ConnectException: Destination unreachable; nested exception is:
         javax.net.ssl.SSLHandshakeException: General SSLEngine problem; No available router to destination
         at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:470)
         at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:321)
         at weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(RJVMManager.java:260)
         at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:197)
         at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:238)
         at weblogic.rjvm.RJVMFinder.findOrCreateInternal(RJVMFinder.java:200)
         ... 15 more
    But in server logs i can see below message
    opt/Oracle/Middleware/wlserver_12.1/server/lib/DemoIdentity.jks.>
    <May 27, 2013 2:47:06 PM IST> <Notice> <Security> <BEA-090169> <Loading trusted certificates from the jks keystore file /opt/Oracle/Middleware/wlserver_12.1/server/lib/DemoTrust.jks.>
    <May 27, 2013 2:47:06 PM IST> <Notice> <Security> <BEA-090169> <Loading trusted certificates from the jks keystore file /opt/jdk1.7.0_21/jre/lib/security/cacerts.>
    <May 27, 2013 2:47:06 PM IST> <Notice> <Server> <BEA-002613> <Channel "DefaultSecure" is now listening on hostname:port for protocols iiops, t3s, ldaps, https.>
    <May 27, 2013 2:47:06 PM IST> <Notice> <WebLogicServer> <BEA-000332> <Started the WebLogic Server Managed Server "Server-Test" for domain "base_domain" running in development mode.>
    Please suggest
    Edited by: 1008140 on May 27, 2013 2:37 AM

    Welcome to OTN
    This section related to Database question not fusion middle ware Post your question
    Oracle Discussion Forums » Fusion Middleware

  • Crystal Reports 2008 - Eclipse and JNDI connection.

    I am evaluting Crystal Reports 2008 .
    I want to use JNDI connection that is defined within my app server by Crystal reports so that I'll have better control of the properties defined.
    How do I set up JNDI data source connection in Crystal Reports 2008 ?
    I defined the following parameters u2026
                    JNDI Provider URL : jnp://localhost:1099
                    Initla Context as :  org.jnp.interfaces.NamingContextFactory
    And user name / password  as defined in JBoss setup
    I also have  u201Cjboss\client\jbossall-client.jaru201D in the classpath .     
    But I am getting Cannot instantiate class exception .
    Thanks in Advance for the help.

    Mr. Ted, We can expose JNDI connections from the appserver. Infact the database connection pool resoures are exposed as JNDI resources, JMS factory and connections are exposed as JNDI etc.
    In fact, JNDI is a means of securely exposing the resources managed by the app server to be used by trusted clients.
    We have achieved this on weblogic (8.1 - JDK 1.4.2) but we would like to replicate the same in glassfish app server ver 3.1.2 and would require the proper factory placed inside the rpt as well as the CRConfig.xml.
    Otherwise, (if we are using conventional URL string) when we ship the rpt files, we need to place this only as localhost. This mandates the presence of rpt files to be in the same server as database server and database. We want to avaoid this by creating a JNDI and use that database access resource inside the rpt files.

  • The mysteries of JDBC, JNDI, and Tomcat 5.5.4

    Like thousands beforefore, I can't get connection pooling to work in Tomcat. I followed all the steps:
    - put jar file for MySQL JDBC driver in TOMCAT_HOME/common/lib
    - put the Jakarta Commons libs in the same location
    - put resource declaration in META-INF/context.xml, per the Tomcat 5.5 docs like so:
    <Context docbase="C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\commutercorps"
        path="\commutercorps" >
        <Resource name="jdbc/commutercorpsds"
            auth="Container"
            type="javax.sql.DataSource"
            maxActive="100"
            maxIdle="30"
            maxWait="10000"
            username="myusername"
            password="mypassword"
            driverClassName="com.mysql.jdbc.Driver"
            url="jdbc:mysql://localhost:3306/commuter_corps_signup"/>
    </Context>- added resource ref in web.xml
        <resource-ref>
            <description>DB Connection</description>
            <res-ref-name>jdbc/commutercorpsds</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
        </resource-ref>I also double checked my connection URL and found that it does work fine when do this in my Java code:
    Class.forName("com.mysql.jdbc.Driver");
    Connection con =
        DriverManager.getConnection
        ("jdbc:mysql://localhost:3306/commuter_corps_signup", "...", "...");When I try to use Tomcat 5.5.4, JNDI like this...
                    try
                        InitialContext initialContext = new InitialContext();
                        DataSource dataSource =
                                (DataSource) initialContext.lookup
                                ("java:comp/env/jdbc/commutercorpsds");
                        Connection con = dataSource.getConnection();
                        Statement stmt = con.createStatement();
                        stmt.executeUpdate(SQLMaker.getInsert(request,
                                request.getParameter("table")));
                        con.close();
                        stmt.close();
                    } catch (NamingException e)
                        System.out.println(e.getMessage());
                        e.printStackTrace();
                    }...I get...
    Cannot create JDBC driver of class '' for connect URL 'null'
    Caused by: java.sql.SQLException: No suitable driver
    Any help would be greatly appreciated.
    Thanks,
    E

    I used to get the message
    Cannot create JDBC driver of class '' for
    connect URL 'null'
    No suitable driverError.
    I was running, jakarta-tomcat-5.0.14.exe on windows.
    I had it installed on a path without spaces
    d:\tomcat5\Good.
    I wanted to use Hibernate. So i used, extensiontools.What's that?
    First create a env var: HIBERNATE_HOME pointing to
    the hibernate extracted dir.No need for this.
    Modify setenv.bat to correct %CP% for
    commons-logging, commons-collection and anything
    else: the version string at the end of the jar
    changes.Wrong. You shouldn't be doing this.
    Then run ddl2hbm, straightforward, fill info in all
    tabs and hit generate. Will show some error message,
    but still creates xmls.I don't see what any of this has to do with Tomcat deployment.
    Then run hbm2java, and hand over each xml file as
    parameter. Creates some java files in generated dir.
    Modify the toString method to something simpler and
    remove the import for apache class.All great, but still has nothing to do with Tomcat deployment.
    move them over to webapp classes.You should create a WAR file or a separate context directory for your application under /webapps. If you're doing anything else, it's wrong.
    Create JNDI in sever.xml as mentioned.Nope. Shouldn't be editing server.xml. Put that stuff in an application-specific context.xml, which goes in the META-INF of your WAR file.
    Create reference in web.xml as mentioned.Good.
    Goto conf/catalina/localhost/<webappname>.xmlNo need for this. Don't know what you're doing here.
    add the line
    <ResourceLink name="jdbc/Oracle"
    type="javax.sql.DataSource" global="jdbc/Oracle"/>
    replace Oracle with your datasource name.
    and i got me workingMight be working, but it's not really correct.
    %

  • TOMCAT 5.0  - JNDI Connection Fails

    Hey guys,!
    Just wanted to test a JNDI datasource I created through the Tomcat administrator with a simple code in a Servlet, here's the snipped code:
                   System.out.println("Starting initial context");
                   Context initCtx = new InitialContext();
                   Context envCtx = (Context) initCtx.lookup("java:comp/env");
                   DataSource ds = (DataSource)
                   envCtx.lookup("jdbc/OFI4");
                   Connection conn = ds.getConnection();
                   //... use this connection to access the database ...
                   conn.close();
    The thing is, I'm getting an error that I've google for the las couple of days and have not found any helpful answers about it, the error message is:
    org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
         at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:780)
         at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
         at test2.doGet(test2.java:68)
    Caused by: java.sql.SQLException: No suitable driver
         at java.sql.DriverManager.getDriver(DriverManager.java:243)
         at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:773)
    thank u people, any hel will be greatly appreciated.!
    Regards,
    Esteban

    Hey guys....!
    I figured out the way to make the JNDI connection work and I can tell you, it DOES work. Apparently, there are some troubles when creating the JNDI datasource by using the Tomcat Administration tool.
    Follow this steps to sort this issue out:
    1. Delete any of the datasources u've created by using the Tomcat Administrator make sure that no tags regarding these datasources remains in the server.xml file
    2. Include the Resource tag in your application web.xml, as follows:
         <resource-ref>
         <description>DB Connection</description>
    <res-ref-name>jdbc/OFICDB</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
         </resource-ref>
    3. Create a xml file named exact as your application (i.e app1, testApp...) and place it at CATALINAHOME/conf/Catalina/localhost. The document content must be as the following (please note that you must change values such as database name, username, password). This files is associated to an application called testCR3
    <?xml version='1.0' encoding='utf-8'?>
    <Context path="/testCR3" docBase="testCR3" debug="5" reloadable="true" crossContext="true" workDir="work\Catalina\localhost\testCR3">>
    <Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_textCR3_log." suffix=".txt" timestamp="true"/>
    <Resource name="jdbc/OFICDB" auth="Container" type="javax.sql.DataSource"/>
    <ResourceParams name="jdbc/OFICDB">
    <parameter>
    <name>factory</name>
    <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
    </parameter>
    <parameter>
    <name>driverClassName</name>
    <value>oracle.jdbc.driver.OracleDriver</value>
    </parameter>
    <parameter>
    <name>url</name>
    <value>jdbc:oracle:thin:@12.145.12.134:1521:OFICDB</value>
    </parameter>
    <parameter>
    <name>username</name>
    <value>user1value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>pwd1</value>
    </parameter>
    <parameter>
    <name>maxActive</name>
    <value>20</value>
    </parameter>
    <parameter>
    <name>maxIdle</name>
    <value>10</value>
    </parameter>
    <parameter>
    <name>maxWait</name>
    <value>-1</value>
    </parameter>
    </ResourceParams>
    </Context>
    If u have any additional troubles, do not hesitate to let me know.
    Best regards,
    E10
    Message was edited by:
    E10

  • How to use JDBC to connect Oracle databse

    Hi
    I try to connect the oracle databse by using JDBC. But I not sure whether is it correct or not because I learnt from the documentation provided by WWW.JAVA.SUN.
    I have create a ODBC DSN file call TKS username/password : tem/manager
    then I download the source code and enhance a bit as following :
    import java.sql.*;
    public class CreateCoffees
    public static void main(String args[])
         String url = "jdbc:oracle:thin:tem/manager@(
         description=(address_list=(
         address=(protocol=tcp)
         (host=192.9.200.8)(port=1521)))(source_route=yes)
         (connect_data=(sid=tks)))";
    Connection con;
    String createString;
    createString = "create table COFFEES " +
    "(COF_NAME VARCHAR(32), " +
    "SUP_ID INTEGER, " +
    "PRICE FLOAT, " +
    "SALES INTEGER, " +
    "TOTAL INTEGER)";
    Statement stmt;
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver");
         catch(java.lang.ClassNotFoundException e)
    System.err.print("ClassNotFoundException: ");
    System.err.println(e.getMessage());
    try {
    con = DriverManager.getConnection(url, "tem", "manager");
    stmt = con.createStatement();
    stmt.executeUpdate(createString);
    stmt.close();
    con.close();
         catch(SQLException ex)
         {  System.err.println("SQLException: " + ex.getMessage());
    After that I saved the file as CreateCoffees.java and compiled it
    D:\KLTAY\JAVA>javac CreateCoffees.java
    CreateCoffees.java:6: unclosed string literal
    String url = "jdbc:oracle:thin:tem/manager@(
    ^
    CreateCoffees.java:10: unclosed string literal
    (connect_data=(sid=tks)))";
    ^
    CreateCoffees.java:30: cannot resolve symbol
    symbol : variable con
    location: class CreateCoffees
    con = DriverManager.getConnection(url, "tem", "manager");
    ^
    CreateCoffees.java:31: cannot resolve symbol
    symbol : variable con
    location: class CreateCoffees
    stmt = con.createStatement();
    ^
    CreateCoffees.java:34: cannot resolve symbol
    symbol : variable con
    location: class CreateCoffees
    con.close();
    ^
    5 errors
    Please give some advise.Thanks
    best regards,
    Tay

         String url = "jdbc:oracle:thin:tem/manager@(
         description=(address_list=(
         address=(protocol=tcp)
         (host=192.9.200.8)(port=1521)))(source_route=yes)
         (connect_data=(sid=tks)))";
    After that I saved the file as CreateCoffees.java and
    compiled it
    D:\KLTAY\JAVA>javac CreateCoffees.java
    CreateCoffees.java:6: unclosed string literal
    String url = "jdbc:oracle:thin:tem/manager@(
    ^
    CreateCoffees.java:10: unclosed string literal
    (connect_data=(sid=tks)))";
    ^I would suggest putting all code between the quotesj(") on one line and then attempting to recompile.

  • -How to use JDBC to connect the SQLServer and Oracle.

    Hi,
    I create a table in the WIP DB, I want to modify this table when use "PRE-START" activity in POD.
    SAPME version: 5.2.3.4     SDK:2.0    DB:SQL2005 and Oracle 10.2g
    SourceCode like below:
    public void execute(StartHookDTO dto) throws Exception {
              initServices();
              try{
                   Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
                   Connection conn = DriverManager.getConnection("jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=SAPMEWIP", "sa" ,"sap12345");
                   conn.close();
              }catch(Exception e){
                   e.printStackTrace();
    Besides, I already setup the JDBC ClassPath in ConfigTool, but it gets somes error when executing.
    the error code like below:
    java.sql.SQLException: No suitable driver
    Please give me some support or a example, thank you so much!
    Br,
    Alex

    You probably want to use the WIP Datasource defined in JNDI.

Maybe you are looking for

  • I get a ssl  Provider error while running a file..

    WHen I try to run a file <filename>.java (the file has no problem in compilation), I get an error that says - "Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider". What does this mean and how can I rectif

  • Urgent: vendor master data

    one of the scenario which i am working at my client place, we are actually getting vendor master data from other place, so what are the fields we need to get from that place actually we might use IDOC or batch job to upload data into your system plea

  • WLST setting the address of a machine

    Can anyone explain the following to me: cd("/") # Go to domain root mbean machine=create("unix","UnixMachine") cmo=machine cmo.setAddress("1.1.1.1") # FAILS???!!?? WHY? cmo.setName("Success") # SUCCESS cmo.setNotes("It doesn't make much sense") # SUC

  • FI report to provide the breakdown of the 4 accrual elements

    Dear all, Presently we have the following accrual charges during PO creation: 1 - Freight and Handling 2 - Insurance 3 - Custom tax. All of these components will be lump into one Accrual GL account. My question is .. is there any standard SAP report

  • I could not see photos after updated with ios 6(used wi-fi)

    I have upgraded with ios 6 on 21-Sep-2012, after that I could not see my photos on my phone 4. I used apple id for icould buy not able to verify. thanks, umapathi