JavaFX Composer and jdbc datasource

I'm trying to build a javafx application that is basically a CRUD interface for a Microsoft SQLServer DB. I can drag and drop the jdbc datasource into my scene, and I can execute the select query against the table. I have copied over the jar file containing the sqlserver driver (using the Project->Properties dialog). When I try to run the project, I get an error message that no suitable driver is found for the connection string that is being used.
The connection string for the sqlserver driver is: jdbc:sqlserver://DEVSQL-SERVER:1433;databaseName=User;
Does anyone know if it's not currently possible to use datasources other than the built-in derby db?
Seems like you should be able to use any datasource if you have the required jar file for the drivers.
TIA,
Kevin

Hi,
The JDBCDataSource is using JDBC API but it does not register/initialize any particular driver.
Therefore you should have the following line of code added at the beginning (right after the package statements) of the Main_run.fx file:
Class.forName ("jdbc.Driver");
where jdbc.Driver is a fully-qualified class name of your JDBC driver.
Regards,
David

Similar Messages

  • Connecting locally with BC4J and JDBC DataSource

    I have a BC4J project/module which I'm using as the data access layer for a web application, and that is deployed in 'local' mode on the OC4J server. In the config for the BC4J Module, I'm using the 'JDBC DataSource' connection type. When I deploy to OC4J, the appropriate entries are made in data-sources.xml and things run fine.
    W/in JDev, however, I'd like to be able to use the BC4J Tester and/or some local java classes (ie, run with a main method, outside the context of OC4J) to do some testing as I develop, including accessing the DB via my BC4J module, with the JDBC DataSource connection type. Currently, in order to run outside of the context of OC4J, I need to modify my config to use a connection type of 'JDBC URL' in order to successfully connect via the tester or via a main method driven class. (But then must be sure to change it back to 'JDBC DataSource' prior to redeploying.) If don't do this, and instead try to use the DataSource connection type, I get the errors "oracle.jbo.JboException: JBO-27200: JNDI failure. Unable to lookup Data Source at context jdbc/ADD_OWNER_DEV2DS" and "javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial" (among others)
    It seems pretty clear that I need to somehow/somewhere specify the context factory or such when running in JDev vs under OC4J, or somehow point the IDE to the local OC4J instance as the source of the info, etc?
    When trying to connect from the development environment, I have a local OC4J instance up and running, and I have what I think is an appropriate entry in data-sources.xml (I've tried this in 4 locations - j2ee\home\config, multi\system\oc4j-config, system9.0.3.1035\oc4j-config and as a new Data Sources Descriptor in the project.)
    Is there a way to set things up such that I can use the 'JDBC DataSource' connection type regardless of whether I'm running inside or outside of OC4J?
    Thanks,
    Jim

    Jim,
    You need some jndi implementation to bind(define) the datasource that can be looked up at runtime. Unfortunately, currently the only jndi implementation available in which you can bind datasources comes from oc4j. So you have to run in oc4j for using the datasource as your connection type.
    Dhiraj

  • XSQLServlet and JDBC Datasource

    Hi,
    Is is possible to use connections from a JDBC Datasource
    that is defined in the JNDI context w/ the XSQL servlet, instead of specifying the connection paramters separately in
    the XSQConfig.xml file?
    Would appreciate it if someone would point me in the right direction.
    TIA,
    Vijay

    To specify a data source in a XSQL page:
    1. In the XSQLConfig.xml file set
    <connection-manager>
    <factory>
    oracle.xml.xsql.XSQLDatasourceConnectionManager
    </factory>
    </connection-manager>2. In the oc4j-config/data-sources.xml file set
    <data-source
              class="oracle.jdbc.pool.OracleConnectionPoolDataSource"
              name="OracleDS"
              location="jdbc/DS"
              xa-location="jdbc/xa/OracleXADS"
              ejb-location="jdbc/OracleDS"
              connection-driver="oracle.jdbc.driver.OracleDriver"
              username=""
              password=""
              url="jdbc:oracle:thin:@<host>:<port>:<SID>"
              inactivity-timeout="30"
         />3. In the web.xml of the XSQL page specify resource-ref
    <resource-ref>
      <res-ref-name>jdbc/OracleDS</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
    </resource-ref>3. In the XSQL page specify the data source in the connection attribute of the page tag with
    connection="java:comp/env/jdbc/OracleDS"

  • Reef Shark and JDBC datasources

    In the pre-Reef Shark version I was able to include and build using Sybase's 12.5 jconn2.jar class files. Since the upgrade, the following error has occurred:
    com.sybase.jdbc2.jdbc.SybConnection.prepareStatement(Ljava/lang/String; III)Ljava/sql.PreparedStatement;
    In previous in IDE version I found I needed Sybase's jconnect-5_5 jar file to successfully call and process stored procedures. Since the Reef upgrade all previously functioning jConnect have failed with the above error.
    Has anyone else seen this error? or knows of a workaround....
    Thanks

    This is a known issue that Sybase JConnect 5.5 JDBC Driver doesn't support the JDBC 3.0 features that Creator needs.
    Even jConnect 6.0 (not available as separate download but it gets installed with newer versions of Sybase) has not yet implemented any JDBC 3.0 methods --
    http://www.sybase.com/detail/1,6904,1033283,00.html
    If you are deploying to Sun AppServer then using Sun JDBC drivers would be free and easy.
    Thanks,
    Sakthi

  • Whats is JDBC DataSource Factory ??

    What is the biggest different between from JDBC DataSource and JDBC DataSource
    Factory ??
    It says that JDBC DataSource Factory enables the EJB to map a resource factory
    reference in the EJB deployment descriptor. But can't I do the same thing to JDBC
    DataSource ????

    Did you target your datasource when you created it?
    Did you look at the server output log to if that the connection pool and
    data source had any errors in deploying to the target?
    <Muthukumaran Shanmuga> wrote in message
    news:[email protected]..
    I defined a datasource for sybase named let us say "SDS".
    I get error with my test program as follows.
    javax.naming.NameNotFoundException: Unable to resolve 'SDS'. Resolved '';
    remaining name 'SDS'
    How do I troubleshoot this error?
    Is there a way to list names of JNDI datasources for a WLS instance?
    I am sure I created jdbc datasource "SDS" under base_domain via console
    and tested the connection
    My current test program code is as follows.
    Properties prop = new Properties();
    prop.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    prop.put(Context.PROVIDER_URL,
    "t3://localhost:7001");
    System.out.println("DEBUG: create initialConext:start");
    InitialContext ic = new InitialContext(prop);
    System.out.println("DEBUG: create initialConext:end");
    DataSource ds =null;
    System.out.println("DEBUG: looking up datasource:start");
    ds = (DataSource)ic.lookup("SDS");
    System.out.println("DEBUG: looking up datasource:end");
    System.out.println("DEBUG: get Connection:start");
    Connection c = ds.getConnection();
    System.out.println("DEBUG: get Connection:end");
    }catch( Exception ex){
    System.out.println(ex.toString());
    Thanks

  • TableView - support for datasource (on-demand loading and JDBC)

    Hi,
    I'm new to JavaFX and I was wondering if anybody knows any good practices for TableView with large datasets. Any API extension that supports datasources for on-demand loading and JDBC. Or any good tutorial, example or ideas. I was looking at DataFX but I don't see any datasource for JDBC in the javadocs even when it's mention their website.
    Thanks in advance, any help or ideas are appreciated.

    Hello,
    here is some pseudocode for your requirement.
    max pagesize is 100 per query request
    i=0
    While(!Lastpage)
    request.startrownum=i;
    response=LeadQuery(request);
    Lastpage=response.lastpage;
    i+=100
    }

  • Cannot deploy application because of JDBC datasource target misconfigured

    --- environnement ---
    Weblogic 10.3.2
    Windows 2008 R2
    Sun Java 6
    Hello, I'd like to have your advices on my issue.
    I tried to deploy an application in my weblogic domain but it kept on status deploy running
    My domain is configured as follow
    clusterA and clusterB
    JDBC datasource targets on clusterA and clusterB
    Today we had to rename clusterB to clusterC
    and we cannot start the managed servers (they stayed in ADMIN state) so we tried to redeploy the application but the deployment process'status was deploy running
    After investigating for a very long time, we finaly noticed that our JDBC datasource was misconfigured. After correcting this, the deployement was successfull.
    now I'm wondering how a misconfigured JDBC datasource can prevent a deployement of an ear, maybe the code is requesting something during its deployement but I don't know the application and looking at the stacktrace didn't give me any clue except the hibernate message.
    Thanks in advance for your advices.
    For info here's the stacktrace:
    ####<Apr 13, 2011 5:32:24 PM CEST> <Error> <Deployer> <EQDG1UZSMRTD001> <SmartDispatcherNodeConsole1> <[STANDBY] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1302708744385> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1302708738983' for task '36'. Error is: 'weblogic.management.DeploymentException: '
    weblogic.management.DeploymentException:
         at weblogic.application.internal.BaseDeployment.throwAppException(BaseDeployment.java:157)
         at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:371)
         at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:54)
         at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
         at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:207)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:98)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:747)
         at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1216)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:250)
         at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:157)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:12)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:45)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused By: org.hibernate.HibernateException: 'hibernate.dialect' must be set when no Connection avalable
         at org.hibernate.dialect.resolver.DialectFactory.buildDialect(DialectFactory.java:107)
         at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:138)
         at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2119)
         at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2115)
         at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1339)
         at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
         at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
         at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:132)
         at weblogic.deployment.PersistenceUnitInfoImpl.createEntityManagerFactory(PersistenceUnitInfoImpl.java:343)
         at weblogic.deployment.PersistenceUnitInfoImpl.createEntityManagerFactory(PersistenceUnitInfoImpl.java:323)
         at weblogic.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:125)
         at weblogic.deployment.AbstractPersistenceUnitRegistry.storeDescriptors(AbstractPersistenceUnitRegistry.java:336)
         at weblogic.deployment.EarPersistenceUnitRegistry.initialize(EarPersistenceUnitRegistry.java:75)
         at weblogic.application.internal.flow.InitJpaFlow.prepare(InitJpaFlow.java:38)
         at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:1221)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
         at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:367)
         at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:54)
         at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
         at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:207)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:98)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:747)
         at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1216)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:250)
         at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:157)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:12)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:45)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

    Hello,
    Here is the solution...
    Solution 1:
    Undeploy sap.com/cafUIservicebrowser from SP06 or SP07 before starting upgrade to SP11.
    Solution 2:
    Upgrade to SP08 first and than to SP11.
    The Solution was discussed on NW04s STAB and accepted due to following reasons:
    - There will be not much customers upgrading from SP06 or SP07 to SP11. The most of customers have already upgraded to SP08 and will not be affected by this issue.
    - Unchecking the Web Dynpro check before upgrades from from SP06 or SP07 to SP11 is unacceptable.
    For More info, check the SAP Note 1010640
    Reward points of my reply was useful..

  • What's the difference between using a connection pool and a datasource

    Howdy. I figure this is a newbie question, but I can't seem to find an
    answer.
    In the docs at bea, the datasource docs say
    "DataSource objects provide a way for JDBC clients to obtain a DBMS
    connection. A DataSource is an interface between the client program and the
    connection pool. Each data source requires a separate DataSource object,
    which may be implemented as a DataSource class that supports either
    connection pooling or distributed transactions."
    In there it says the datasource uses the connection pool, but other than
    that, what is the difference between a connection pool and a datasource?

    Thanks for the info. I think it makes some sense. But it's a bit greek.
    I'm sure it'll make more sense the more I work with it. Thanks.
    "Chuck Nelson" <[email protected]> wrote in message
    news:3dcac1f5$[email protected]..
    >
    Peter,
    Here is a more formal definition of a DataSource from the Sun site
    "A factory for connections to the physical data source that thisDataSource object
    represents. An alternative to the DriverManager facility, a DataSourceobject
    is the preferred means of getting a connection. An object that implementsthe
    DataSource interface will typically be registered with a naming servicebased
    on the JavaTM Naming and Directory (JNDI) API.
    The DataSource interface is implemented by a driver vendor. There arethree types
    of implementations:
    Basic implementation -- produces a standard Connection object
    Connection pooling implementation -- produces a Connection object thatwill automatically
    participate in connection pooling. This implementation works with amiddle-tier
    connection pooling manager.
    Distributed transaction implementation -- produces a Connection objectthat may
    be used for distributed transactions and almost always participates inconnection
    pooling. This implementation works with a middle-tier transaction managerand
    almost always with a connection pooling manager.
    Does that help clarify the distinction?
    Chuck Nelson
    DRE
    BEA Technical Support

  • Error in creating JDBC datasource

    I would like to create a new JDBC datasource using WLST script.
    There are 2 problems with it:
    1. Running the script an error message will be displayed:
    Creating JDBCSystemResource with name DBonHelium5
    JDBCSystemResource with name 'DBonHelium5' has been created successfully.
    Problem invoking WLST - Traceback (innermost last):
    File "/opt/wls9/jdbc_data_source_creation.py", line 30, in ?
    AttributeError: addJndiName
    I don’t understand why it is wrong and how could I fix the bug...
    2. After running the script I looked at the current state on the console.
    The datasource has been created but the target isn’t set.
    Could you help me what’s wrong?
    Thanks in advice!
    Zsigmond
    The script:
    connect("xxx","xxx")
    edit()
    startEdit()
    # Change these names as necessary
    dsname="DBonHelium5"
    cd("Servers/AdminServer")
    #target=getMBean("Servers/AdminServer")
    target=cmo
    cd("../..")
    # start creation
    print 'Creating JDBCSystemResource with name '+dsname
    jdbcSR = create(dsname,"JDBCSystemResource")
    theJDBCResource = jdbcSR.getJDBCResource()
    theJDBCResource.setName("DBonHelium5")
    connectionPoolParams = theJDBCResource.getJDBCConnectionPoolParams()
    connectionPoolParams.setConnectionReserveTimeoutSeconds(25)
    connectionPoolParams.setMaxCapacity(100)
    connectionPoolParams.setTestTableName("SYSTABLES")
    dsParams = theJDBCResource.getJDBCDataSourceParams()
    <b>dsParams.addJndiName("DBonHelium5")</b>
    driverParams = theJDBCResource.getJDBCDriverParams()
    driverParams.setUrl("jdbc:bea:oracle://helium.lsy.bud.dlh.de:1521")
    driverParams.setDriverName("weblogic.jdbcx.oracle.OracleDataSource")
    driverParams.setPassword("LSY")
    driverProperties = driverParams.getProperties()
    proper = driverProperties.createProperty("user")
    proper.setValue("LSY")
    proper1 = driverProperties.createProperty("DatabaseName")
    proper1.setValue("dbc:bea:oracle://helium.lsy.bud.dlh.de:1521")
    <b>jdbcSR.addTarget(target)</b>
    try:
    save()
    activate(block="true")
    print "script returns SUCCESS"
    except:
    print "Error while trying to save and/or activate!!!"
    dumpStack()
    disconnect()
    exit()

    Hi Manfed,
    I've got exactly the same problem mit j2sdkee 1.3.1. Have yor resolved the problem in the meantime?
    If so, please post the solution. Thanks.
    Helmut

  • Trying to switch from JDBC URL - JDBC DataSource

    I have built and run a JHeadstart 10.1.2 application using JDBC URL defined database connections.
    I am now trying to switch to use JDBC DataSource definitions to make the database connection independant from the application so that the same ear file can be deployed to different application servers (dev vs test environments).
    I have tried changing the Connection Type of the Business Component:
    Configurations > Edit > Connection Type
    from the previously defined JDBC URL to a JDBC Datasource defined within the embedded OC4j Application server. After making the change, rebuilding and restarting the server it still retrieves information from the previously defined URL.
    Is there something I need to regenerate/rebuild/reconfigure?
    Thanks,
    Kevin

    Hi Steven,
    I've seen that article. It's quite detailed and certainly helped until I ran into a VerifyError something like:
    java.lang.VerifyError: (class: oracle/ord/im/OrdDocBase, method: create signature: (Loracle/ord/im/OrdDocBase;Loracle/sql/Datum;I)Loracle/sql/CustomDatum;) Incompatible object argument for function call at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:140) at oracle.jheadstart.util.BindingUtils.class$(BindingUtils.java:66) at oracle.jheadstart.util.BindingUtils.isIntermediaBinding(BindingUtils.java:169) at oracle.jheadstart.controller.strutsadf.action.JhsDataAction.setBindingInputHandlers(JhsDataAction.java:1159) at oracle.jheadstart.controller.strutsadf.action.JhsDataAction.processUpdateModel(JhsDataAction.java:622) at oracle.adf.controller.struts.actions.DataAction.processUpdateModel(DataAction.java:508) at oracle.adf.controller.lifecycle.PageLifecycle.handleLifecycle(PageLifecycle.java:112)
    I found this forum posting helped me...
    Re: JHeadstart Deployment Issue
    I couldn't run the application in a standalone instance of oc4j 9.0.4 even after following the deployment instructions found in this and other posts. It wasn't until I came upon a JavaWorld article from 2001 about VerifyError...
    http://www.javaworld.com/javaworld/jw-06-2001/jw-0615-howto.html
    I added -noverify to the startup arguments and the application ran fine.
    I admit I am a little concerned that I need to run without jar verification. Have you seen this before? Is there another way to deal with this?
    thanks,
    Kevin

  • How to include new driver and configure datasource in NW 7.0

    Hi,
    I have deployed my application in the app server and now i need to add the ms sql drivers to the application server and configure datasource to it.
    Can any one help me to configure the datsource in Nw 7.0 and also how to add the driver files tp app server..?
    thanks in advance
    jayakumar

    Hi,
    Follow these links:
    How To Install and Configure External Drivers for the JDBC & JMS
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f04ce027-934d-2a10-5a8f-fa0b1ed4d88f
    http://saphelp.border-states.com/EN/b3/cc633c3a892251e10000000a114084/content.htm
    http://www.sapag.co.in/JDBC%20Adapter-Type2JDBCDriver%20Deployment.html
    Regards,
    Nithiyanandam
    Reward points

  • Maximum Number of JDBC Datasources

    Does anyone know if there is a limit or if there is a
    recommended max to the number of JDBC datasources that a standard
    version of CF8 can handle?
    We have approx. 500 on our server and occasionally the server
    restarts due to Out of Memory errors. This most recently happened
    when adding a new datasource through the CF Admin, which is what
    led me to asking this question.
    Thanks, Chris

    > Does anyone know if there is a limit or if there is a
    recommended max to the
    > number of JDBC datasources that a standard version of
    CF8 can handle?
    >
    > We have approx. 500 on our server and occasionally the
    server restarts due to
    > Out of Memory errors. This most recently happened when
    adding a new datasource
    > through the CF Admin, which is what led me to asking
    this question.
    A datasource is just a bunch of setting which get stuck in an
    XML file.
    THey don't have any RAM footprint in and of themselves.
    However, the more DSNs you have, it suggests the more DB
    traffic you have,
    and indeed probably more activity on the box.
    How much RAM have you got allocated to the JVM?
    Have you used FusionReactor or similar to monitor what's
    going on with the
    RAM the JVM has?
    Adam

  • How to create a JDBC datasource thru script/xml?

    Hello All,
    Is there any way to create a JDBC datasource using some script or xml file that
    can be deployed to WLS 7.x?
    This feature is required for our J2EE application installation program.
    rgds
    MS

    Hi
    See this thread for connecting SQL Server
    Re: what is the process to connect to database from webdynpro ?
    For Oracle
    try
    {DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@Oracle_server_ip:Oracle port:SID of the Database","user_name","password");
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery("your query");
    }catch(Exception e){
    see this thread
    Webdynpro and Oracle
    Kind Regards
    Mukesh

  • JNDI lookup() for sql server jdbc datasource returns null

    Hi,
    I am trying to use a jdbc datasource in tomcat 5 to access a sql server 2000 database. I had many common problems and did found an answer to them in the forums but I'm having one last (I hope) problem. My program is also using a mySQL datasource and it works fine.
    The problem is that my lookup returns null. No exception, just null. It seems that many people had this problem but I didn't found any answer to it.
    This is the lookup code:
        Context ctx = new InitialContext();
        Context envCtx = (Context)ctx.lookup("java:comp/env");
        axaptaDS = (DataSource) envCtx.lookup("jdbc/axapta"); //returns null :(This my context.xml config:
    <ResourceParams name="jdbc/axapta">
        <parameter>
          <name>factory</name>
          <value>com.microsoft.jdbcx.sqlserver.SQLServerDataSourceFactory</value>
        </parameter>
        <parameter>
          <name>url</name>
          <value>jdbc:microsoft:sqlserver://hostname:1433</value>
        </parameter>
        <parameter>
          <name>password</name>
          <value>password</value>
        </parameter>
        <parameter>
          <name>maxActive</name>
          <value>4</value>
        </parameter>
        <parameter>
          <name>maxWait</name>
          <value>5000</value>
        </parameter>
        <parameter>
          <name>driverClassName</name>
          <value>com.microsoft.jdbcx.sqlserver.SQLServerDataSource</value>
        </parameter>
        <parameter>
          <name>username</name>
          <value>username</value>
        </parameter>
        <parameter>
          <name>maxIdle</name>
          <value>2</value>
        </parameter>
      </ResourceParams>And I also put these lines in my web.xml file:
    <resource-ref id="ResourceRef_1092254277306">
         <res-ref-name>jdbc/axapta</res-ref-name>
         <res-type>javax.sql.DataSource</res-type>
         <res-auth>Container</res-auth>
         <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>Thanks for helping!

    I finally found a remedy to this problem:
    specify this driver instead and remove the entry about the factory in the context's .xml file:
    com.microsoft.jdbc.sqlserver.SQLServerDriver

  • BC4J and JNDI DataSource Configuration

    Hi,
    I need help in making the BC4J use a DataSource for creating connections. Could you anyone tell me step by step instructions to do it?
    I have created a Database Connection using JDBC for creating a BC4J App Module, View Objects etc.
    Then I created a Business Component Package by using the wizard. Everything worked fine till now. But I was to use a connection pool that is created in my App Server which happens to be a WebLogic 7.0 App Server. I have created a JDBCConnection pool and a JDBCDataSource in the App Server. The configuration for it is as follows in the weblogic configuration file.
    <JDBCConnectionPool DriverName="oracle.jdbc.driver.OracleDriver"
    MaxCapacity="5" Name="OracleConnectionPool"
    Password="{3DES}n51DlVgPmmQ="
    Properties="user=empac;dll=ocijdbc9;protocol=oci"
    Targets="myserver" URL="jdbc:oracle:oci:@DB921C"/>
    <JDBCDataSource JNDIName="OCIDataSource" Name="OCIDataSource"
    PoolName="OracleConnectionPool" Targets="myserver"/>
    I wanted to edit the "Configurations" to specify the JDBC DataSource. When I saved the configuration for the App Module this is how my bc4j.xcfg looks.
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <BC4JConfig>
    <AppModuleConfigBag>
    <AppModuleConfig name="BuyerModuleLocal">
    <java.naming.security.principal>system</java.naming.security.principal>
    <DeployPlatform>LOCAL</DeployPlatform>
    <jbo.TypeMapEntries>Java</jbo.TypeMapEntries>
    <JDBCDataSource>OCIDataSource</JDBCDataSource>
    <jbo.project>BC4JTry</jbo.project>
    <AppModuleJndiName>com.explore.bc4j.BuyerModule</AppModuleJndiName>
    <ApplicationName>com.explore.bc4j.BuyerModule</ApplicationName>
    <java.naming.security.credentials>security</java.naming.security.credentials>
    </AppModuleConfig>
    </AppModuleConfigBag>
    <ConnectionDefinition name="DB921C">
    <ENTRY name="JDBC_PORT" value="1521"/>
    <ENTRY name="ConnectionType" value="JDBC"/>
    <ENTRY name="HOSTNAME" value="joshua"/>
    <ENTRY name="user" value="empac"/>
    <ENTRY name="ConnectionName" value="DB921C"/>
    <ENTRY name="SID" value="DB921C"/>
    <ENTRY name="JdbcDriver" value="oracle.jdbc.driver.OracleDriver"/>
    <ENTRY name="password" value="empac"/>
    <ENTRY name="ORACLE_JDBC_TYPE" value="thin"/>
    <ENTRY name="DeployPassword" value="true"/>
    </ConnectionDefinition>
    </BC4JConfig>
    When I tried to run a testClient which uses the App Module it is failing giving me an exception saying could not lookup for the DataSource. In one of the detailed error messages, I got this error.
    javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
    I checked the "Configurations" window and it was having
    "oracle.jbo.common.JboInitialContextFactory" for the property "java.naming.factory.initial".
    Could anyone tell me how to solve this issue. I did read the BC4J & JNDI Datasource configuration thread in the same forum and unfortunately that did not help.
    Krish

    What does you test client code look like and can you give us the complete stack trace.
    Dhiraj

Maybe you are looking for

  • How old a version of Calendar will work with syncML?

    I need to know if our version of the calendar server will work with Oracle Sync Server or Oracle mobile data, and therefore syncML. How old of a version of calendar will work? We are running corporate time 5.4 (don't laugh too hard). Thanks Roger

  • Expand All Mail Conversations by Default

    There are quite a few threads out there on this topic but none with any suitable response.  Has anyone figured out a terminal command that might force this, sort of like we do for forcing font size?  Its frustrating to have to keep going to view and

  • Sat A100-593: Should I install 64-bit or 32-bit version of Win Vista

    A100-593 Centrino Duo T2300, 1 Gb RAM 533 FSB I have already installed 32-bit version. Everything works fine. But I read 64 bit can give problems with hardware laptop (lack of 64-bit drivers) http://www.tech-recipes.com/microsoft_vista_tips1426.html

  • Interactive  Form  Attach File

    Hi All...., How can I attach a file inside form and send via email ? Thanks in Advance. Best Regards, Sheetal.

  • Error 801 when executing external command

    Dear all, One of our PRODcution system (PI) system getting lot of  below error in SM21. 00:07:17 sappip_PIP_03 BTC  038 400 BASIS                LC  2 Error 801 when executing external command on (xpgid=0,convid=.) 00:07:17 sappip_PIP_03 BTC  038 400