Registering datasource in websphere

Hello,
I am trying to implement connection pooling in websphere. I am using version 3.5, alonside db2. I have set up in the datasource in websphere, I then try to use the following code to establish the datasource and retrieve a connection from the pool.
     try {
          Hashtable parms = new Hashtable();
          parms.put (Context.INITIAL_CONTEXT_FACTORY,"com.ibm.ejs.ns.jndi.CNInitialContextFactory");
          Context ctx = new InitialContext(parms);
          ds = (DataSource)ctx.lookup("jdbc/GFSI");
          ctx.close();
          con = ds.getConnection("uname","pword");
     } catch (Exception e) {}
The datasource seems to be set up, but when I try to connect to it, I get an error message saying ..."incorrect database name". I have seen some threads talking about setting up the JNDI name, but I dont where I should be doing this.Any ideas/suggestions gratefully recieved.
Thanks

The code seems to be fine. Problem should be somewhere else. Please check the name of the database that you created on the db2 server and check whether your datasource is pointing to the same database (check the url parameter).Also check whether you have bind the same datasource with jndi name "jdbc/GFSI" in your WAS datasource configuration.
You have :
1) actual database name which is referred by the datasource through the url parameter.
2) datasource name which is the reference for the naming server for binding the datasource with jndi name.
3) jndi name for the datasource which is referred by your code for doing a jndi lookup.
Probably one of the above names is miss-spelled somewhere.
Regards,
Ashoke Bhowmick

Similar Messages

  • Setting up Microsoft SQL Server datasource in Websphere 4.0

    Does anyone know how to setup an SQL Server jdbc driver in Websphere 4.0? I am using jdbc driver from jTurbo. But I am having trouble specifying the proper URL and other datasource settings in Websphere 4.0 (or WTE) server configuration.

    Hi,
    Please find the extract from jTurbo site (http://www.newatlanta.com/support/jturbo/third-party.jsp#WebSphere)
    which will explain the steps to follow for setting up Microsoft SQL Server datasource
    in Websphere 4.0 using jTurbo jdbc driver.
    1.Always make sure the JTurbo.jar is set in your classpath.
    2.Started "WebSphere Admin Server"
    3.Open "WebSphere Administrative Console"
    4.Install the JTurbo Driver into WAS by modifying the following field of "Admin DB Driver"
    Name: JTurbo
    Class Name: com.ashna.jturbo.driver.Driver
    URL prefix: jdbc:JTurbo://localhost/pubs
    JTA Enabled: false
    (apply changes which resulted in the installation of JTurbo Driver)
    5.Selected "Create Data Source" in Console "Wizards" drop down
    6.Selected "Use an already installed JDBC Driver" JDBC Option
    7.Specified "my ds name" as the "Data Source Name"
    Specified "pubs" as the "Database Name" pull down is showing "JTurbo"
    This should sucessfully create a new data source by the name of "my ds name".
    Also there is an excellent document on "Configuring the Merant ConnectJDBC data source for MS SQL Server for the WebSphere Application Server Advanced Single Server Edition" at http://www-4.ibm.com/software/webservers/appserv/doc/v40/ae/infocenter/was/was402/rn112253.4.html .
    Hope this helps. Good luck.
    Best Regards
    Gayam_Slash

  • Using DataSource in Websphere

    We are using websphere WAS and informix data base and while using DataSource for connection pooling we are getting a Forwarding exception and Illegal state exception apparently thrown by WAS and we tried getting over that by switching to Driver Manager instead of data source but that started giving a corba.rollback exception ! our whole implementation is running on WCS 5.1 using WAS and informix database. Any suggestions on why we are getting forwarding exceptions on using data source with WAS? we have registered the look up in the administrative console and there seems to be no problems with that. please let me know if there are any opinions regarding this. Thanks for your time.

    we are getting the error using the data source in a jsp/ejb . the error is actually printed out to a log file and this happens only when multiple users hit the server at the sam time and not when the server is interacting with a single user. we are somewhat stumped by this right now. i am pasting the actual error message in the log file below this. pls pardon me if that is too verbose ! you may see a writer stream not obtained message in it, but that does not seem to be the root cause , that comes since we had not set the printwriter object in the datasource and hence it is redirecting the actual message to screen rather than log file. Thanks for your time.
    An error has occurred: Error Code Message Target Servlet Name
    500 ERROR: Cannot forward. Writer or Stream already obtained. null
    Stack Trace:
    java.lang.IllegalStateException: ERROR: Cannot forward. Writer or Stream already obtained. at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleOutputStreamPrinterWriterObtained(WebAppRequestDispatcher.java:595) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:112) at com.ibm.commerce.command.HttpForwardViewCommandImpl.forwardDocument(HttpForwardViewCommandImpl.java) at com.ibm.commerce.command.HttpForwardViewCommandImpl.performExecute(HttpForwardViewCommandImpl.java(Compiled Code)) at com.ibm.commerce.command.ECCommandImpl.execute(ECCommandImpl.java) at com.ibm.commerce.webcontroller.ErrorCmdExecUnit.execute(ErrorCmdExecUnit.java) at com.ibm.commerce.webcontroller.WebController.executeTransaction(WebController.java(Compiled Code)) at com.ibm.commerce.webcontroller.WebController.processRequest(WebController.java) at com.ibm.commerce.adapter.HttpAdapterImpl.processRequest(HttpAdapterImpl.java) at com.ibm.commerce.server.RequestServlet.service(RequestServlet.java) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:626) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java:160) at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:287) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:105) at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:360) at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:775) at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:701) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:478) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:234) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:138) at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:77) at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:67) at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:155) at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:300) at com.ibm.servlet.engine.oselistener.SQEventListenerImp$ServiceRunnable.run(SQEventListenerImp.java:230) at com.ibm.servlet.engine.oselistener.SQEventListenerImp.notifySQEvent(SQEventListenerImp.java:104) at com.ibm.servlet.engine.oselistener.serverqueue.SQEventSource.notifyEvent(SQEventSource.java:212) at com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRunnable.notifyService(SQWrapperEventSource.java:353) at com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRunnable.run(SQWrapperEventSource.java:220) at com.ibm.servlet.engine.oselistener.outofproc.OutOfProcThread$CtlRunnable.run(OutOfProcThread.java(Compiled Code)) at java.lang.Thread.run(Thread.java:481)
    Root Cause: java.lang.IllegalStateException: ERROR: Cannot forward. Writer or Stream already obtained.
    **************************************************************

  • Error in pointing Identity Manager Repository to Datasource in Websphere

    I'd installed SJIM 7 in Websphere 6.0.2 and I'm trying to configure the datasource. I tested the connection successfully via Admin Console. The JNDI name is defined as jdbc/DataSource. But when I try to point the respository to new location by running the ln script (shown as below), I run into error as follow.
    I wonder if anyone have a resolution for this.
    [*** AIX Steps ***:]
    cd /home/apps/idm/idm_war_V1.ear/idm.war/bin
    ./lh -Djava.ext.dirs=$JAVA_HOME/jre/lib/ext:$WAS_HOME/lib setRepo -Uwaveset -Pwaveset123 -toracle -icom.ibm.websphere.naming.WsnInitialContextFactory -fjdbc/SJIMDataSource
    [*** Error ***]
    javax.naming.NameNotFoundException: Context: pidmap01Cell01/nodes/pidmap01Node01/servers/nodeagent, name: jdbc/SJIMDataSource: First component in name jdbc/SJIMDataSource not found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
    Failed to load JDBC DataSource 'jdbc/SJIMDataSource':
    ==> javax.naming.NameNotFoundException: Context: pidmap01Cell01/nodes/pidmap01Node01/servers/nodeagent, name: jdbc/SJIMDataSource: First component in name jdbc/SJIMDataSource not found.

    Had worked with SUN engineer who suggested the following steps. It worked.
    1. Please run the command as indicated below to create
    ServerRepository.xml into tmp folder
    ./lh -Djava.ext.dirs=$JAVA_HOME/jre/lib/ext:$WAS_HOME/lib setRepo -n
    -tOracle
    -icom.ibm.websphere.naming.WsnInitialContextFactory
    -fjdbc/SJIMDataSource -uiiop://localhost:9811
    -U"Websphere Admin console USERID" -P"Websphere Admin console PASSWORD"
    -o"/tmp/ServerRepository.xml"
    Remark
    ======
    -n option will bypass any checking and ignore any error message.
    -o option is used to generate the ServerRepository.xml in a specific folder.
    -Assuming jdbc/SJIMDataSource is a valid jndi name and is resolveable
    within the app server container
    2. Stop the websphere app server where IDM is deployed.
    3. Copy /tmp/ServerRepository.xml into WSHOME
    (/home/apps/idm/idm_war_V1.ear/idm.war/WEB-INF)
    4. Restart app server
    5. Bring up the Idm Admin Console and try to login as Configurator
    (default admin user)
    6. Check app server log and command line console to check any error.
    Also the lh command will not test connection to
    the repository when configuring the ServerRepository.xml file. It is
    just generating the ServerRepository.xml which contains the data needed to connect to the backend repository. That's why you are seeing "No check means no guarantee...caveat emptor.".
    If the App Server start up properly and user is able to access the Admin
    UI after copying the generated "ServerRepository.xml" to the WEB-INF
    folder, then it does prove that IDM is working fine.

  • Please help: problem configuring a SQL server datasource in Websphere.

    I am using Rational Developer 6 and its integrated testing server (websphere v6). When configuring a data source for SQL server, I did the following steps in admin console of the test server:
    1. Created a JDBC provider, using WebSphere embedded ConnectJDBC driver for MS SQL Server;
    2. Created a datasource under the previously created JDBC provider, filled in the server name, DB name and port number (1433 for SQL server);
    3. Created a J2C authentication alias that has the login info of SQL server;
    4. Assigned the created J2C alias to both component and container managed authentication alias;
    However, when I click "Test Connection", it always gets back to me with an error "java.lang.Exception: java.sql.SQLException: [IBM][SQLServer JDBC Driver]Error establishing socket. Connection refused: connectDSRA0010E: SQL State = 08001, Error Code = 0.".
    My ultimate goal is to configure a SQL server datasource so that I can configure Kodo to use this datasource.
    Can some one please help? Thanks in advance.

    Try this:
    http://www-1.ibm.com/support/docview.wss?uid=swg21210871
    I am yet to test this. I am going to download latest SP for SQL Server 2000 and install it. I hope it will do the magic.

  • BUG: Business Components using Datasources on Websphere - statement closed

    Hi,
    This is an unusual combinatation, we are deploying business components projects on websphere with a SQL Server database. This was originally deployed all to Oracle. We have managed to convert the project sucessfully (JDeveloper 10.1.3) and on Websphere, however when we moved our application module configurations (bc4j.xcfg) to use JNDI data sources which works in Jdeveloper, we are encountering problems using websphere with business components and datasources.
    The statement closed error occurs when trying to calling executequery() method on the view object, not the first time the JSP page is accessed, but the second time. Refresh page all is good. Access page again error occurs. Very consistent.
    Our code will often do applicationmodule.findViewObject("name"), if not found then create it, otherwise use the vo and kapow bombs out on the executequery method if reusing the view object.
    ERROR
    DSRA9110E: Statement is closed.oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation.
    Statement: SELECT Groups.GROU_ID FROM GROUPS Groups WHERE (GROU_ID=1)
    at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java(Compiled Code))
    at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java(Compiled Code))
    at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java(Compiled Code))
    at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java(Compiled Code))
    at oracle.jbo.server.ViewRowSetImpl.executeQueryForMasters(ViewRowSetImpl.java(Inlined Compiled Code))
    at oracle.jbo.server.ViewRowSetImpl.executeQuery(ViewRowSetImpl.java(Inlined Compiled Code))
    at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java(Compiled Code))The datasource uses the connection pooling driver class com.microsoft.sqlserver.jdbc.SQLServerConnectionPoolDataSource.
    Ampooling is on. It appears the jdbc prepared statement is being closed but bc4j is expecting to still be open?
    Any ideas on diagnosing the issue or app module config changes greatly appreciated.
    Mark

    Hi Steve,
    This is not a composition association. Actually, this is an association from a table to an intersection (many-to-many) table. The code in my service is based on the SRDemo, see SRServiceImpl#updateSkillsForCurrentStaff(List) and is called on a save button from a shuttle page.
    The current master is the master I want it to belong to. The link to the master gets correctly saved in the database (just as in the SRDemo). We can also navigate from the master view row to the find the detail view row using the generated RowIterator. However, this does not work from the master entity row to the detail entity row. The problem is really at the entity level.
    Thanx
    Olivier

  • Error Registering Datasource

    Hi, I am having difficulty registering a datasource to iAS. The server
    instance of iAS I am using is named crgserver(10817).
    When I use the [register] feature in Forte Runtime tab to register a
    datasource, I get this error:
    "crgserver :Error : could not log on to crgserver"
    If I try to use iasdeploy from command line with the string:
    "iasdeploy regdatasource MembershipDS.xml" I get this response:
    "iasdeploy for iPlanet Application Server 6.0 SP3
    Connected to LDAP server on crgserver port 389
    No servers registered in the registry"
    I also cannot register a server in iASAT. I get a logon error.
    Thanks for your help

    Hi,
    The error "No servers registered in the registry" makes me to feel
    that your iAS is not registered using the iASAT. Please open the iASAT and
    check if your server has been registered. Now, if you are not able to
    register iAS using iASAT then here are the following posibilities...
    - check if iAS is running properly(you may check this in windows by
    enabling the option interact with desktop in the services. In Unix systems
    you can check the KJS logs)
    - your logon credentials are wrong(either username/password)
    - ensure that your LDAP server is running.
    - check what your ip address is(is it static or dynamically generated
    using dhcp server ? also 127.0.0.1 will not help)
    - check what your DNS name is ?
    Please let me know if this helps.
    Regards
    Raj
    Raymond Gerz wrote:
    Hi, I am having difficulty registering a datasource to iAS. The server
    instance of iAS I am using is named crgserver(10817).
    When I use the [register] feature in Forte Runtime tab to register a
    datasource, I get this error:
    "crgserver :Error : could not log on to crgserver"
    If I try to use iasdeploy from command line with the string:
    "iasdeploy regdatasource MembershipDS.xml" I get this response:
    "iasdeploy for iPlanet Application Server 6.0 SP3
    Connected to LDAP server on crgserver port 389
    No servers registered in the registry"
    I also cannot register a server in iASAT. I get a logon error.
    Thanks for your help

  • Datasources (in Websphere)

    Hi,
    I am using a datasource to connect to a pool defined in my server (Websphere).
    This is my code:
    java.util.Hashtable env = new java.util.Hashtable();
    env.put(Context.PROVIDER_URL, "iiop://192.168.23.10:900/");
    env.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.ejs.ns.jndi.CNInitialContextFactory");
    Context ctx = new InitialContext(env);
    ds = (DataSource) ctx.lookup("jdbc/"+myDsName);
    java.sql.Connection lConn = ds.getConnection(myUid,myPwd);
    This code is correct, and when i use it I obtain connections to a remote database pool defined in my websphere.
    The problem is that, probably, I don't understand the datasource. I thought that the datasource is unique, and limit the number of connections created.
    If I use this code from differents computers, It creates differents datasources. For example, If I define my datasource to manage 10 connections, two differents user running this code, can manage up to 10 connections. So, if I have n user running this code in their computers, there can be up to n*10 differents connection to the database.
    What I want is a unique datasource that limits and manage the number of connection to the database.
    How can I make this using JNDI and JDBC to connect to a remote datasource defined in my server (Websphere). Is this possible?
    Best regards,
    Damian

    WebSphere handles your connection pooling but there is connection pooling
    setting in the admin console(AE4.0) which have an idle time, the connection will
    close till your idled time, But in websphere's suggested "best_practice.pdf"
    it says close the connection as you finish using it, about the DataSource,
    i dont think you need to worry about that, its just a linkage between database and your codes(JSP,Servlet...)
    I have a question:
    I'm using WebSphere and doing the same thing to get a
    DataSource. I am also using a Connection Pool. That
    being the case, I get a DataSource from JNDI, and then
    get a Connection from the DataSource. I'm wondering,
    since WebSphere is handling my connections, do I need
    to release the connection when done? Do I close it? Do
    I give it back or what? Just let it fall out of scope?
    What do I do with the DataSource? There is no close()
    method for DataSource.

  • Error when Websphere try to load  datasource

    hi,
    I'm working with websphere 5.
    I create a EJB project with oracle 9i database, when i execute the application and for example, from my session bean I try to call a findByPrimaryKey() method over my entity bean the WebSphere container load the datasource (my database is configured as 'desa' ) and show me the following error :
    FreePool J2CA0046E: The method createManagedConnctionWithMCWrapper got a excepci�n when create a ManagedConnection for resource jdbc/desa, genering ResourceAllocationException.
    Original excepci�n: com.ibm.ws.exception.WsException: DSRA8100E: Unable to get a PooledConnection from the DataSource.
    Nested exception is: javax.ejb.EJBException: nested exception is: com.ibm.ws.ejbpersistence.utilpm.ResourceAdapterException: PMGR6020E: Error when connect with com.ibm.ws.rsadapter.cci.WSRdbConnectionFactoryImpl@1687178e adapter
    I defined my datasource on websphere with all required parameters. I don't know what's can be happening.
    sombody can help me ?
    thanks

    could u tell me which driver u r using, brief u r environmat

  • Timesten Datasource configuration on WebSphere

    Hi,
    I have created a timesten datasource...and I was able to connect to oracle database by ttisql command.
    Now I am trying to configure datasource on websphere for usage of the timesten datasource by an application...
    After I configure everything on Websphere according to timesten documentation...I get the below error when I do a test connection from WebSphere Admin Console...
    Test connection failed for data source bridgesDS on server brg-tt-intAS at node hco431brgeda002ANode01 with the following exception: java.lang.Exception: java.sql.SQLException: Problems with loading native library/missing methods: /opt/TimesTen/tt70/lib/libttJdbc.so: ld.so.1: java: fatal: libtten.so: open failed: No such file or directoryDSRA0010E: SQL State = null, Error Code = 0. View JVM logs for further details.
    I have made sure that libttJdbc and libtten.so are available in the above path...but I seem to be getting the error still...
    Any help on this would be appreciated...thanks

    hi Chris,
    Here is the output of ttversion command
    # ./ttversion
    TimesTen Release 7.0.5.0.0 (32 bit Solaris) (tt70:17000) 2008-04-04T01:33:06Z
    Instance admin: root
    Instance home directory: /opt/TimesTen/tt70
    Daemon home directory: /var/TimesTen/tt70
    Access control enabled.
    Here is the output, when i run TTJdbcExamples redirected to a text file...
    # java TTJdbcExamples ttdemo > /tmp/timesten.txt
    java.lang.ClassNotFoundException: com.timesten.jdbc.TimesTenDriver
    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 TTJdbcExamples.loadDriver(TTJdbcExamples.java:485)
    at TTJdbcExamples.runExamples(TTJdbcExamples.java:447)
    at TTJdbcExamples.main(TTJdbcExamples.java:313)
    java.lang.ClassNotFoundException: com.timesten.jdbc.TimesTenDriver
    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 TTJdbcExamples.loadDriver(TTJdbcExamples.java:485)
    at TTJdbcExamples.connectAndDisconnect(TTJdbcExamples.java:502)
    at TTJdbcExamples.runExamples(TTJdbcExamples.java:449)
    at TTJdbcExamples.main(TTJdbcExamples.java:313)
    ----- SQL Error -----
    Error Message: No suitable driver
    java.sql.SQLException: No suitable driver
    at java.sql.DriverManager.getConnection(DriverManager.java:545)
    at java.sql.DriverManager.getConnection(DriverManager.java:193)
    at TTJdbcExamples.connectAndDisconnect(TTJdbcExamples.java:510)
    at TTJdbcExamples.runExamples(TTJdbcExamples.java:449)
    at TTJdbcExamples.main(TTJdbcExamples.java:313)
    SQL State: 08001
    Native Error Code: 0
    java.lang.ClassNotFoundException: com.timesten.jdbc.TimesTenDriver
    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 TTJdbcExamples.loadDriver(TTJdbcExamples.java:485)
    at TTJdbcExamples.elementaryOperations(TTJdbcExamples.java:552)
    at TTJdbcExamples.runExamples(TTJdbcExamples.java:451)
    at TTJdbcExamples.main(TTJdbcExamples.java:313)
    ----- SQL Error -----
    Error Message: No suitable driver
    java.sql.SQLException: No suitable driver
    at java.sql.DriverManager.getConnection(DriverManager.java:545)
    at java.sql.DriverManager.getConnection(DriverManager.java:193)
    at TTJdbcExamples.elementaryOperations(TTJdbcExamples.java:560)
    at TTJdbcExamples.runExamples(TTJdbcExamples.java:451)
    at TTJdbcExamples.main(TTJdbcExamples.java:313)
    SQL State: 08001
    Native Error Code: 0
    java.lang.ClassNotFoundException: com.timesten.jdbc.TimesTenDriver
    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 TTJdbcExamples.loadDriver(TTJdbcExamples.java:485)
    at TTJdbcExamples.changeQueryPlan(TTJdbcExamples.java:720)
    at TTJdbcExamples.runExamples(TTJdbcExamples.java:453)
    at TTJdbcExamples.main(TTJdbcExamples.java:313)
    ----- SQL Error -----
    Error Message: No suitable driver
    java.sql.SQLException: No suitable driver
    at java.sql.DriverManager.getConnection(DriverManager.java:545)
    at java.sql.DriverManager.getConnection(DriverManager.java:193)
    at TTJdbcExamples.changeQueryPlan(TTJdbcExamples.java:726)
    at TTJdbcExamples.runExamples(TTJdbcExamples.java:453)
    at TTJdbcExamples.main(TTJdbcExamples.java:313)
    SQL State: 08001
    Native Error Code: 0
    java.lang.ClassNotFoundException: com.timesten.jdbc.TimesTenDriver
    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 TTJdbcExamples.loadDriver(TTJdbcExamples.java:485)
    at TTJdbcExamples.batchExecution(TTJdbcExamples.java:917)
    at TTJdbcExamples.runExamples(TTJdbcExamples.java:455)
    at TTJdbcExamples.main(TTJdbcExamples.java:313)
    ----- SQL Error -----
    Error Message: No suitable driver
    java.sql.SQLException: No suitable driver
    at java.sql.DriverManager.getConnection(DriverManager.java:545)
    at java.sql.DriverManager.getConnection(DriverManager.java:193)
    at TTJdbcExamples.batchExecution(TTJdbcExamples.java:923)
    at TTJdbcExamples.runExamples(TTJdbcExamples.java:455)
    at TTJdbcExamples.main(TTJdbcExamples.java:313)
    SQL State: 08001
    Native Error Code: 0
    Contents inside the text file
    TTJdbcExamples.connectAndDisconnect()
    TTJdbcExamples.loadDriver()
    Open a connection.
    TTJdbcExamples.elementaryOperations()
    TTJdbcExamples.loadDriver()
    Open a connection.
    Change and Print a Query Plan
    TTJdbcExamples.loadDriver()
    Open a connection.
    Execute Statement and PreparedStatement Batch Updates
    TTJdbcExamples.loadDriver()
    Open a connection.
    Done.
    thanks...
    Rakesh

  • Oracle Datasource V5 error in Websphere 5.1.2

    Hi
    I have created a datasource in websphere using console and able to Test connection succesfully, however when i try to access through my application (from DAO) it throws following exception
    before I was able to setup datasource locally using WSAD, but not able to do same on App server on Unix box.
    [11/2/04 10:41:05:560 EST] 29ad5b4e Helpers W NMSV0605W: A Reference object looked up from the context "java:" with the name "comp/env/jdbc/SRSDataSource" was sent to the JNDI Naming Manager and an exception resulted. Reference data follows:
    Reference Factory Class Name: com.ibm.ws.util.ResRefJndiLookupObjectFactory
    Reference Factory Class Location URLs: <null>
    Reference Class Name: java.lang.Object
    Type: ResRefJndiLookupInfo
    Content: com.ibm.ws.util.ResRefJndiLookupInfo@5c8c5b56 ResRefJndiLookupInfo: Look up Name="jdbc/SRSDataSource";JndiLookupInfo: jndiName="jdbc/SRSDB"; providerURL=""; initialContextFactory=""
    Exception data follows:
    javax.naming.NameNotFoundException: Context: srs-was-dev/nodes/srs-was-dev/servers/server1, name: jdbc/SRSDB: First component in name jdbc/SRSDB not found. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
    at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.handleNameNotFound(WsnOptimizedNamingImpl.java:1983)
    at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.getNextWsnOptimizedNamingContext(WsnOptimizedNamingImpl.java:1320)
    at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.getTargetContext(WsnOptimizedNamingImplBase.java:2424)
    at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase$LeafOperationData.<init>(WsnOptimizedNamingImplBase.java:2877)
    at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.resolve_complete_info(WsnOptimizedNamingImplBase.java:1390)
    at com.ibm.WsnOptimizedNaming._NamingContextStub.resolve_complete_info(Unknown Source)
    at com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:3491)
    at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1519)
    at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1480)
    at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1187)
    at com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory$1.run(IndirectJndiLookupObjectFactory.java:372)
    Here is my java code
    Context ctx = new javax.naming.InitialContext();
    ds = (javax.sql.DataSource) ctx.lookup("java:comp/env/jdbc/SRSDataSource");
    Here is my ds setting in console
    Name : SRSDataSource
    JNDI Name : jdbc/SRSDB
    I also have references to the datasources from my EJBS defined in ejb-jar.xml and ibm-ejb-jar-bnd.xmi files - same setting and same code works great in WSAD.
    any help ?
    thank you

    Sorry for late reply,
    Yes I am exporting ear from WSAD and then deploying It on WAS using console, with out using DS settings(jdbc 1 way of creating connections) my ear file works fine on was.
    I tried using directly JNDI name from my my class, again it worked on WSAD but throws following exception on WAS.
    here is CODE
    ds = (javax.sql.DataSource) ctx.lookup("jdbc/SRSDB");
    ERROR
    [04 Nov 2004 09:32:02,298] [Servlet.Engine.Transports : 1] ERROR (DBConnection.java:148) - javax.naming.NameNotFoundException: Context: srs-was-dev/nodes/srs-was-dev/servers/server1, name: jdbc/SRSDB: First component in name jdbc/SRSDB not found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
    [04 Nov 2004 09:32:02,300] [Servlet.Engine.Transports : 1] DEBUG (DBConnection.java:127) - caught Exception
    [04 Nov 2004 09:32:02,301] [Servlet.Engine.Transports : 1] DEBUG (DBConnection.java:128) - error class name javax.naming.NameNotFoundException
    [04 Nov 2004 09:32:02,301] [Servlet.Engine.Transports : 1] ERROR (DBConnection.java:130) - javax.naming.NameNotFoundException: Context: srs-was-dev/nodes/srs-was-dev/servers/server1, name: jdbc/SRSDB: First component in name jdbc/SRSDB not found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
    [04 Nov 2004 09:32:02,302] [Servlet.Engine.Transports : 1] ERROR (UserAuthDAO.java:95) - javax.naming.NameNotFoundException: Context: srs-was-dev/nodes/srs-was-dev/servers/server1, name: jdbc/SRSDB: First component in name jdbc/SRSDB not found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
    [04 Nov 2004 09:32:02,303] [Servlet.Engine.Transports : 1] DEBUG (UserAuthDAO.java:99) - closing con
    [04 Nov 2004 09:32:02,305] [Servlet.Engine.Transports : 1] ERROR (CreateProgramBean.java:373) - javax.naming.NameNotFoundException: Context: srs-was-dev/nodes/srs-was-dev/servers/server1, name: jdbc/SRSDB: First component in name jdbc/SRSDB not found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
    [04 Nov 2004 09:32:02,324] [Servlet.Engine.Transports : 1] ERROR (ProgramInfoCommandDelegate.java:76) - java.rmi.MarshalException: CORBA MARSHAL 0x4942f896 No; nested exception is:
    org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge : The repository ID is not of an RMI value type (Expected ID = RMI:java.lang.Throwable:F8678B4F4D2EB705:D5C635273977B8CB; Received ID = IDL:omg.org/CosNaming/NamingContext/NotFound:1.0) vmcid: IBM minor code: 896 completed: No

  • Remove registered JDBC datasource

    Hi all,
    How do I remove a registered datasource. I tried
    iAS admin by standing at the datasource and tried
    Edit/Delete and I got not implemented (SP3)
    is there a command line much like iasdeploy removeapp
    but to remove registered datasource.
    Thanks,

    Hi,
    You can remove it by opening registry. you can use kregedit command to
    open the registry.
    Then browse to: SOFTWARE\iPlanet > Application server > 6.0 >
    DataSource. And then click on the data source you would wish to
    delete/remove and click edit from the menu bar. Select "Delete" to
    delete.
    If you still have any thing further to be clarified please get back to
    the news group.
    Thanks,
    Rakesh,
    Developer-Support Team, iAS.
    Bilal Chouman wrote:
    Hi all,
    How do I remove a registered datasource. I tried
    iAS admin by standing at the datasource and tried
    Edit/Delete and I got not implemented (SP3)
    is there a command line much like iasdeploy removeapp
    but to remove registered datasource.
    Thanks,
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

  • Websphere 6.0 DataSource, Microsoft JDBC driver

    I am trying to configure a DataSource using Websphere 6.0 and Microsoft's JDBC Driver for SQL Server 2000.
    I am configuring a V4 DataSource (not a V6 DataSource).
    After configuring the JDBC Provider and the DataSource, the Test Connection operation generates this message:
    DSRA8101E: DataSource class cannot be used as one-phase:
    ClassCastException: com/microsoft/jdbc/sqlserver/SQLServerDriver incompatible with javax/sql/ConnectionPoolDataSource,
    error code: NOT_A_1_PHASE_DS
    How can I fix this? Is anybody using Microsoft�s JDBC driver and Websphere 6.0?

    looks like it's a problem between single phase and two-phase commit drivers. They're different, of course. there are extra steps required to get SQL Server to participate in 2 phase XA.
    I know how to do it in WebLogic. Not sure about WebSphere.
    %

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

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

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

  • Error when we try to load the datasource

    Hi all,
    We create a EJB project with oracle 9i database, when we execute the application and, for example, from our session bean we try to call a findByPrimaryKey() method over our entity bean, the container load the datasource (the database is configured as 'desa' ) and show the
    following error :
    FreePool J2CA0046E: The method
    createManagedConnctionWithMCWrapper got a
    exception when create a ManagedConnection
    for resource jdbc/desa, genering
    ResourceAllocationException.
    Original exception: com.ibm.ws.exception.WsException:
    DSRA8100E: Unable to get a PooledConnection
    from the DataSource.
    Nested exception is: javax.ejb.EJBException:
    nested exception is:
    com.ibm.ws.ejbpersistence.utilpm.ResourceAdapterException:
    PMGR6020E: Error when connect with
    com.ibm.ws.rsadapter.cci.
    WSRdbConnectionFactoryImpl@1687178e adapter
    We�re working with WebSphere 5. We defined the datasource on websphere with all required parameters.
    We don't know what could be happening.
    Thanks and regards!

    Hi,
    Even I was getting this exception.
    but now i got it working for me.
    Steps
    1)Visit the link already suggested and configure everything according to it.(http://www.webagesolutions.com/knowledgebase/waskb/waskb001/index.html)
    2) Most important is you must place your classes12.zip in system classpath. and even more imp is it must come in classpath before anyother .jars from IBM Studio.
    Hope this will solve the problem.

Maybe you are looking for

  • Total Qty in Audit Report

    Hi, In the Audit report for the items,it is showing the total value of the items at the end.But it is not showing the total qty.Can somebody guide me how to get that. Thanks and Regards, S.G.Sekar

  • Logon to VZ router (192.168.1.1) on iphone/ipad

    Has anyone been able to logon to their Fios VZ router from their iphone or Ipad? I can access the router no problem from my PC or my Laptop, but from my ipad or iphone, no luck... It keeps getting invalid logon... (I even cut/paste the password so I

  • Macbook pro wont start up and clicking sound

    Hi everyone My girlfriend spilled a coke on my computer couple days ago and my MBP shut down immediately. After all i took it to the apple store in Turkey and they said the problem is from the battery and they took it off and I started to use it on c

  • Importing Flash into FCP

    I have Flash Pro 8 and FCP Pro HD and am still trying to learn both. Can I create a piece in Flash and import it into FCP? If I need to upgrade FCP, I will - I just need to know if it's possible, and how to do it. thanks a lot. j.

  • Java Class Upload Option In Portal

    Hello, In portal under tab database objects-->under schema--> u have an option to create Java Object right. Could some one explain how to call the uploaded java class from a portlet? Any help is highly appreciable. Thanks Arun