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.

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

  • 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

  • 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

  • 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 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

  • 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.
    %

  • 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.

  • Best way to access JNDI configured DataSource from outside container

    I'm not sure if this is the right forum category, but it seemed like a good place to start.
    I have a DB2 database on an OS/390 mainframe that is configured as a JNDI datasource in WebSphere (WSAD) 5.1.x. I can get connections and do database transactions within my web-application just fine.
    Part of my project needs a cron managed stand-alone application to do some database clean up work. It essentially needs to query one database, and then based on the results stick some data into the DB2 database. Easy enough right?
    The issue here is that our Security department will not under any circumstances give us the passwords and users for either database. They give these only to the server admins who configure WSAD. We also can't use a properties file. The server admins either won't touch any properties file (it is considered "code" and they don't want to be responsible for problems) or they won't have access to the contents of the ears or jars we give them. This basically leaves us with our JNDI datasource as the only datasource we could access (because the admins will have it configured with a username and password). There is also no way to infer a valid username/password from the owner of the web-app since it will live on an NT box and the NT user won't have mainframe rights.
    There is also no possibility of bending these rules no matter how stupid or cumbersome they are.
    So my question is, what is the best method in which to gain access to this JNDI DataSource or a Connection from this DataSource? Can I even get a DataSource from a JNDI lookup? Is JMS/RMI or some other acronymn that I don't know about the only way to acomplish this?
    We're using Struts MVC -> Spring -> Hibernate in the webapp, if that helps.
    Thanks in advance.

    You seem to be asking: "how can a standalone app get a valid DB2 connection by leveraging the live objects in a WSAD application"?
    While this is pretty far from my area of expertise, I don't think you can. While both JMS and RMI (and other technologies) can export some types of Java objects, they have to be objects that implement the java.io.Serializable interface. Connections cannot be serialized because these objects (normally) encapsulate a live TCP/IP connection. I don't see any fundamental reason a DataSource object couldn't be serialized other than security, but that very reason means that no reasonable implementation is going to be serializable; if it were serializable, you could almost certainly extract the value of the username and password from the serialized object. In other words, what you're really trying to do is get around security and Java's security is probably robust enough to prevent it.
    If the DB credentials only live in the WSAD world, that's where the database work has to be done. However, there's no reason the work can't be driven by a servlet or JSP that is in turn invoked from a cron-driven script or application. Personally, I do such "event notifier" scripts in Perl; Java is a bit heavy for "start up, post to URL, shutdown", but if you have more work going on you could certainly use Java. If actually doing the work in the WSAD application is not acceptable, then you're probably stuck.

  • DataSource unavailable

    Hello,
    I deployed a web app into weblogic, but unable to reach the datasource.
    The web application has a web.xml and has the following resource configuration
    <!-- Reference for the store datasource -->
    <resource-ref id="STPResourceRef_1">
    <res-ref-name>STPDataSource</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    The weblogic is configured with the following Data Source.
    Data Sources
    Name : STPDataSource
    Type :Generic
    JNDI Name : jdbc/STPStoreDataSource
    Targets : myserver, Server-0
    The JNDI tree has the following entry
    JNDI Tree Structure
    Server-0
    __WL_GlobalJavaApp
    java:global
    javax
    jdbc
    STPStoreDataSource
    weblogic
    And the jndi entry for jdbc/STPStoreDataSource is
    Binding Name: jdbc.STPStoreDataSource
    Class: weblogic.jdbc.common.internal.RmiDataSource_1211_WLStub
    The error I recieve in the server-0.out is
    com.anitesolutions.utils.servlet.config.ConfigDatabaseException: Configuration Error: Datasource undefined - 'STPDataSource'
    The same code works in websphere, but not in weblogic. I tested the Datasource in weblogic if it connects to the DB and it does. The problem is the container is unable to reach the DataSource. I can't figure out what is wrong.
    Your suggestion will be useful.
    Thanks

    Hello,
    I have got a hint. I am migrating an application in Websphere to Weblogic. In Websphere, ibm-web-bnd.xml file handles the binding between the project resource name and the datasource in websphere. The id="STPResourceRef_1" mentioned above is resolved to jdbc/STPStoreDataSource in ibm-web-bnd.xml . The code continues to use ctx.lookup("STPDataSource"). Is there any such binding in Java EE 6 or weblogic specific files? If you can tell me this missing link, my problem will be solved.

  • Oracle 10gR3 BAM configuration on Websphere

    We are having issues with 10gR3 BAM configuration on Websphere 6.1.0.19. While running oraclebpmwarehouse.sh, the service does not run. Has anyone done a successful configuration of BAM for Websphere?
    Thanks in advance for any help.

    Here is the relevant message from logfile:(dwupdate-service.log)
    read a packet LOG(WARN) : Will not schedule service [O3CubeBuilderService] since it did not return the next due time. Maybe this service is disabled.
    DEBUG | wrapper | 2009/03/06 13:55:36 | Got a log message from JVM: Will not schedule service [O3CubeBuilderService] since it did not return the next due time. Maybe this service is disabled.
    WARN | jvm 1 | 2009/03/06 13:55:36 | Will not schedule service [O3CubeBuilderService] since it did not return the next due time. Maybe this service is disabled.
    DEBUG | wrapperp | 2009/03/06 13:55:36 | read a packet LOG(DEBUG) : Scheduling item [BAMUpdaterRunnerService] for time [2009-03-06 13:55:35.988000-06:00]
    DEBUG | wrapper | 2009/03/06 13:55:36 | Got a log message from JVM: Scheduling item [BAMUpdaterRunnerService] for time [2009-03-06 13:55:35.988000-06:00]
    DEBUG | jvm 1 | 2009/03/06 13:55:36 | Scheduling item [BAMUpdaterRunnerService] for time [2009-03-06 13:55:35.988000-06:00]
    DEBUG | wrapperp | 2009/03/06 13:55:36 | read a packet LOG(INFO) : Running item [BAMUpdaterRunnerService]
    DEBUG | wrapper | 2009/03/06 13:55:36 | Got a log message from JVM: Running item [BAMUpdaterRunnerService]
    INFO | jvm 1 | 2009/03/06 13:55:36 | Running item [BAMUpdaterRunnerService]
    DEBUG | wrapper | 2009/03/06 13:55:36 | Sending stop signal to JVM
    DEBUG | wrapperp | 2009/03/06 13:55:36 | send a packet STOP : NULL
    INFO | jvm 1 | 2009/03/06 13:55:36 | Mar 6, 2009 1:55:36 PM com.ibm.ws.naming.java.javaURLContextFactory
    INFO | jvm 1 | 2009/03/06 13:55:36 | SEVERE: javaAccessorNotSet
    INFO | jvm 1 | 2009/03/06 13:55:36 | Send a packet LOG(INFO) : Service execution [BAMUpdaterRunnerService] returned code [1]
    INFO | jvm 1 | 2009/03/06 13:55:36 | Send a packet LOG(DEBUG) : Scheduling item [BAMUpdaterRunnerService] for time [2009-03-06 14:05:35.988000-06:00]
    INFO | jvm 1 | 2009/03/06 13:55:36 | Thread, Wrapper-Connection, handling the shutdown process.
    INFO | jvm 1 | 2009/03/06 13:55:36 | calling listener.stop()
    INFO | jvm 1 | 2009/03/06 13:55:36 | WrapperSimpleApp: stop(0)
    INFO | jvm 1 | 2009/03/06 13:55:36 | returned from listener.stop()
    INFO | jvm 1 | 2009/03/06 13:55:36 | Send a packet STOPPED : 0
    DEBUG | wrapperp | 2009/03/06 13:55:36 | read a packet LOG(INFO) : Service execution [BAMUpdaterRunnerService] returned code [1]
    DEBUG | wrapper | 2009/03/06 13:55:36 | Got a log message from JVM: Service execution [BAMUpdaterRunnerService] returned code [1]
    INFO | jvm 1 | 2009/03/06 13:55:36 | Service execution [BAMUpdaterRunnerService] returned code [1]
    DEBUG | wrapperp | 2009/03/06 13:55:36 | read a packet LOG(DEBUG) : Scheduling item [BAMUpdaterRunnerService] for time [2009-03-06 14:05:35.988000-06:00]
    DEBUG | wrapper | 2009/03/06 13:55:36 | Got a log message from JVM: Scheduling item [BAMUpdaterRunnerService] for time [2009-03-06 14:05:35.988000-06:00]
    DEBUG | jvm 1 | 2009/03/06 13:55:36 | Scheduling item [BAMUpdaterRunnerService] for time [2009-03-06 14:05:35.988000-06:00]
    DEBUG | wrapperp | 2009/03/06 13:55:36 | read a packet STOPPED : 0
    DEBUG | wrapper | 2009/03/06 13:55:36 | JVM signalled that it was stopped.
    INFO | jvm 1 | 2009/03/06 13:55:37 | Closing socket.
    DEBUG | wrapperp | 2009/03/06 13:55:37 | socket read no code (closed?).
    INFO | jvm 1 | 2009/03/06 13:55:37 | calling System.exit(0)
    DEBUG | wrapper | 2009/03/06 13:55:37 | JVM process exited with a code of 0, leaving the wrapper exit code set to 0.
    DEBUG | wrapper | 2009/03/06 13:55:37 | JVM exited normally.
    STATUS | wrapper | 2009/03/06 13:55:37 | <-- Wrapper Stopped
    [Bam-dwupdater.log]
    Caused by: javax.naming.ConfigurationException: Name space accessor for the java: name space has not been set. Possible cause is that the user is specifying a java: URL name in a JNDI Context method call but is not running in a J2EE client or server environment.
         at com.ibm.ws.naming.java.javaURLContextFactory.isNameSpaceAccessable(javaURLContextFactory.java:98)
         at com.ibm.ws.naming.urlbase.UrlContextFactory.getObjectInstance(UrlContextFactory.java:73)
    There is some configuration missing to get to the JNDI to look for the BAM database configured as a datasource in Websphere?
    Any thoughts/documentation?

Maybe you are looking for

  • How can I publish a project so that the link to embedded flv is not lost?

    When publishing an Adobe Captivate 3 project, the embedded flv file does not play. How can I publish a project so that the link to embedded flv is not lost?

  • Apex_collection.add_member in-efficiencies

    http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21674/advnc_collections.htm#BABFFJJJ Collections enable you to temporarily capture one or more nonscalar values. You can use collections to store rows and columns currently in session state so they can

  • DW8 does not display my page

    http://www.direct2usales.com/CONTENT.HTM Just installed DreamWeaver 8.0.2 and loaded first file In CODE mode, I see the code... but no matter what I do in DESIGN mode, all I see is a "bar" across the top of the page (If I press F12 to view in browser

  • Localizing "The file could not be uploaded because it is too large"

    When uploading file af:inputFile in case of larger file as limited in web.xml then this message appears: Warning: The file upload failed The file could not be uploaded because it is too large How to localize this message (maybe some from http://docs.

  • Webdynpro table features

    Hello, I have a couple of clarifications on webdynpro table features. 1.webdynpro table heading currently comes only as one row.Is it possible to store the values in 2 rows.? 2.I would like to incorporate scrolling on webdynpro table both horizontall