Simple DB Connection using DSN

Hi,
I compiled this code in Unix and try to run it, but I'm getting error "java.sql.SQLException: No Suitable driver" although i've already defined my dsn in ODBC connections ("system dsn"). What's wrong?
import javax.swing.JOptionPane;
import java.sql.*;
/home/users/almong/.J[GARY]>more Connect.java
import javax.swing.JOptionPane;
import java.sql.*;
public class Connect{
public static void main(String args[])
String dataSourceName="XYZDummy";
String dbURL="jdbc:odbc" + dataSourceName;
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection(dbURL,"","");
Statement s = con.createStatement();
s.execute("select * from employee_v where staff_num='5377' ");
ResultSet rs = s.getResultSet();
if (rs != null)
while(rs.next())
JOptionPane.showMessageDialog(null,"Employee:" + rs.getString(
2),"TEST ONLY",JOptionPane.INFORMATION_MESSAGE);
s.close();
con.close();
catch(Exception err){
System.out.println("ERROR:" + err);
}

There are a couple of reasons for the No Suitable Driver error (see the following thread for more detail: http://forum.java.sun.com/thread.jspa?forumID=48&threadID=656329). In your case it happens to be a malformed JDBC URL that is the problem. A JDBC URL is comprised of three parts separated by colons. You have the following code:
String dbURL="jdbc:odbc" + dataSourceName;You are missing a colon between the sub-protocol name (odbc) and the datasource name. Your code should read:
String dbURL="jdbc:odbc:" + dataSourceName;

Similar Messages

  • Simple remote connection using Cisco AnyConnect and ISR router

    Hi all,
    I am just wondering what the easiest and simplest method would be to make remote PCs (running Cisco AnyConnect) establish a VPN IPsec to a Cisco ISR (881/887, 1900s,2900s series). I used to use EasyVPN method (simple and fast to configure and no need for special licences other than crypto licence) but since Cisco VPN Client is no longer supported I had to resort to WebVPN which requires a licence depending on the number of clients to support (SSL licences for 10,20 users and so forth). I've read a bit about FlexVPN but I can't find an easy example to what I want to do. The closest is this one (FlexVPN and Anyconnect IKEv2 Client Configuration Example):
    http://www.cisco.com/c/en/us/support/docs/security/flexvpn/115941-flexvpn-ikev2-config-00.html
    But that example makes use of RADIUS. Is there a way to make use of local database (users configured on the router) instead of RADIUS?
    Basically what I am after is the following
    - Remote users install Cisco AnyConnect to establish a VPN connection to HQ
    - HQ ISR (880s, 1900s, 2900s) terminates that VPN connections and allows access to local resources (shared drives, applications...).Authentication method would be local database on the router. No need of RADIUS/ACS as this is for very small companies with no IT resources to maintain and configure a RADIUS/ACS server.
    I think what I need is this AnyConnect to IOS Headend Over IPsec with IKEv2 and Certificates Configuration Example:
    http://www.cisco.com/c/en/us/support/docs/security/flexvpn/115014-flexvpn-guide-cert-00.html
    But the example is too highlevel for me to follow, basically I don't know how to generate such certificates and distribute it to remote clients.
    Any help as to how to create such certificates or how to configure FlexVPN to just requiring the user to enter usr/pass (using local database not RADIUS nor ACS) would be highly appreciated.
    Cheers
    Alvaro

    If you insist .. try this:
    http://www.cisco.com/c/en/us/support/docs/security/flexvpn/116032-flexvpn-aaa-config-example-00.html
    http://www.cisco.com/c/en/us/support/docs/security/flexvpn/115907-config-flexvpn-wcca-00.html
    http://www.cisco.com/c/en/us/support/docs/security-vpn/ipsec-negotiation-ike-protocols/50282-ios-ca-ios.html

  • How to connect oracle database using DSN  from jsp

    hello, can any know how can i connect to[b] oracle database using DSN name from jsp .I am using oracle 9i and Tomcat 5
    Using odbc tool i have created the dsn name but ithe connection does not make .here is the code that i have tried
    Connection connection = null;
         try
              Class.forName("oracle.jdbc.driver.OracleDriver");
         catch(ClassNotFoundException Exception)
              out.println("error occoured during loading the driver ");
         try
              out.println("getting the connection");
              connection = DriverManager.getConnection("jdbc:oracle:deepak","scott","tiger");
              out.println("connection getted");
         catch(Exception exception1)
              out.println("error occoured ");
    pls help as soon as possible
    Sorry, for my english

    you are actually using JDBC so the DSN entry does not matter.
    2 things.
    Make sure that your oracle database driver is in your classpath on your tomcat server.
    I.E. copy the file classes12.jar into your common/lib folder of tomcat, or into your WEB-INF/lib folder of your application. and RESTART your server. classes12.jar can be found on the internet or more easily somewhere within your oracle installation. just search for it.
    Make sure your jdbc url is correct. I believe it goes like this.... fill in the blacks
    connection conn = DriverManager.getConnection("jdbc:oracle:thin:scott/tiger@MyOracleHost:1521:MyDB");Note how the username are passed in the first string there fore there is no need to pass additional parameters. This method may be depriciated, but if so, just take out the user and pass from the string and continue to pass them as 3 seperate strings.
    connection conn = DriverManager.getConnection("jdbc:oracle:thin:MyOracleHost:1521:MyDB","scott","tiger");That should get your connection. if not, post your errors.

  • How to create a dsn less connection using a jsp

    hi,
    presently i have created a web site using jsp..i used a dsn connection to access the database.i used the basic jdbc:odbc type one driver..the issue is that when i tried to webhost my website they told me that i have to use a dsn less connection ....code anyone refer me the code as to how i could a dsn less connection jsp...i am using a access database..

    Well Friend,
    This is not the right form to post this query i would advice u to post this query in the JDBC thread
    If U are not satisfied with the resolution provided below
    Howevr as per my experience
    If U wanna use DSN less Connection U may go ahead and use TYPE II/III/IV drivers which would be Application(database) specific in general.
    u wud have to include the driver specific .jar files (to load drivers) in your classpath for few specific type of drivers like thin/OCI/.......
    And it wud be different for different Databases U can easily get information and downloadables about those drivers from db vendors web portals.
    Just for U reference check the links below
    http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm
    http://forums.oracle.com/forums/thread.jspa;jsessionid=8d92200830de37db8191784349ff8c14cef5a6d94e36.e34QbhuKaxmMai0MaNeMb3aTbxz0?messageID=901133��
    http://www.kitebird.com/articles/jdbc.html
    http://www.developer.com/java/data/article.php/3417381
    http://www.akadia.com/services/sqlsrv_jdbc.html
    http://www.thescripts.com/forum/thread182937.html
    Else where U can make use of Hibernate/ EJB/.....
    which would include support for Dbconnection internally.

  • How to create a DSN Less Connection using MySQL

    Hi All
    How to create a DSN Less Connection using MySQL?
    http://www.caucho.com/projects/jdbc-mysql/index.xtp and downloaded Caucho driver and installed the jar ---- caucho-jdbc-mysql-0.2.7.jar in my classpath..
    this is how i embedded the code
    try
    driver = (Driver) Class.forName("com.caucho-jdbc-mysql-0.2.7.Driver").newInstance();
    catch (Exception e)
    lastErr = "Cannot load the driver, reason:"+e.toString();
    nothing seems to work with code..
    Unable to proceed..Any piece of code would be of great help..
    Thanks and regds
    Gautam

    According to the installation instructions for that driver:
    The driver is com.caucho.jdbc.mysql.Driver
    The url is jdbc:mysql-caucho://hostname:port/database
    You used something else for the driver name. So it doesn't work. By the way, I found those instructions here: http://www.caucho.com/projects/jdbc-mysql/

  • Oracle database Connectivity using OCI driver

    I am getting the error only when ever I am using oci driver
    oracle.url=jdbc:oracle:oci:@(description=(address=(host=url.name.com)(protocol=tcp)(port=1521))(connect_data=(sid=user)))
    04:52:55,093 ERROR [STDERR] java.sql.SQLException: ???S???Y??x??
    04:52:55,094 ERROR [STDERR] at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
    04:52:55,094 ERROR [STDERR] at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:131)
    04:52:55,095 ERROR [STDERR] at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:204)
    04:52:55,095 ERROR [STDERR] at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:650)
    04:52:55,095 ERROR [STDERR] at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:338)
    04:52:55,095 ERROR [STDERR] at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:508)
    04:52:55,095 ERROR [STDERR] at oracle.jdbc.driver.T2CConnection.<init>(T2CConnection.java:133)
    04:52:55,096 ERROR [STDERR] at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:53)
    04:52:55,096 ERROR [STDERR] at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:510)
    04:52:55,096 ERROR [STDERR] at java.sql.DriverManager.getConnection(DriverManager.java:582)
    04:52:55,096 ERROR [STDERR] at java.sql.DriverManager.getConnection(DriverManager.java:185)
    04:52:55,097 ERROR [STDERR] at org.apache.jsp.index_jsp._jspService(index_jsp.java:68)
    04:52:55,097 ERROR [STDERR] at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    04:52:55,097 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
    04:52:55,097 ERROR [STDERR] at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
    04:52:55,097 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326)
    04:52:55,098 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253)
    04:52:55,098 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
    04:52:55,098 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324)
    04:52:55,098 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)
    04:52:55,099 ERROR [STDERR] at org.jboss.resteasy.plugins.server.servlet.FilterDispatcher.doFilter(FilterDispatcher.java:63)
    04:52:55,099 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274)
    04:52:55,099 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)
    04:52:55,099 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
    04:52:55,099 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    04:52:55,100 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181)
    04:52:55,100 ERROR [STDERR] at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285)
    04:52:55,100 ERROR [STDERR] at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261)
    04:52:55,100 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88)
    04:52:55,101 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100)
    04:52:55,101 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    04:52:55,101 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    04:52:55,101 ERROR [STDERR] at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
    04:52:55,101 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    04:52:55,102 ERROR [STDERR] at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53)
    04:52:55,102 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)
    04:52:55,102 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
    04:52:55,102 ERROR [STDERR] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)
    04:52:55,102 ERROR [STDERR] at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)
    04:52:55,103 ERROR [STDERR] at java.lang.Thread.run(Thread.java:619)
    04:52:55,105 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[Test].[jsp]] Servlet.service() for servlet jsp threw exception: java.sql.SQLException: ???S???Y??x??
    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70) [ojdbc5.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:131) [ojdbc5.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:204) [ojdbc5.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
    at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:650) [ojdbc5.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
    at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:338) [ojdbc5.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:508) [ojdbc5.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
    at oracle.jdbc.driver.T2CConnection.<init>(T2CConnection.java:133) [ojdbc5.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
    at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:53) [ojdbc5.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:510) [ojdbc5.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
    at java.sql.DriverManager.getConnection(DriverManager.java:582) [:1.6.0_13]
    at java.sql.DriverManager.getConnection(DriverManager.java:185) [:1.6.0_13]
    at org.apache.jsp.index_jsp._jspService(index_jsp.java:68)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) [:6.0.0.20100911-M5]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [:1.0.0.Beta2]
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369) [:6.0.0.20100911-M5]
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326) [:6.0.0.20100911-M5]
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253) [:6.0.0.20100911-M5]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [:1.0.0.Beta2]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.20100911-M5]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.20100911-M5]
    at org.jboss.resteasy.plugins.server.servlet.FilterDispatcher.doFilter(FilterDispatcher.java:63) [:6.0.0.20100911-M5]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.0.0.20100911-M5]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.20100911-M5]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [:6.0.0.20100911-M5]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [:6.0.0.20100911-M5]
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.0.0.20100911-M5]
    at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) [:1.1.0.CR3]
    at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.CR3]
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.0.0.20100911-M5]
    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.0.0.20100911-M5]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [:6.0.0.20100911-M5]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.0.0.20100911-M5]
    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.0.0.20100911-M5]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.0.0.20100911-M5]
    at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.0.0.20100911-M5]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:6.0.0.20100911-M5]
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [:6.0.0.20100911-M5]
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [:6.0.0.20100911-M5]
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [:6.0.0.20100911-M5]
    at java.lang.Thread.run(Thread.java:619) [:1.6.0_13]
    When I am using thin driver, I am successful in connecting to the database
    oracle.url=jdbc:oracle:thin:@(description=(address=(host=url.name.com)(protocol=tcp)(port=1521))(connect_data=(sid=user)))
    I am using JBOSS 1.6 with oracle 11.1.0 and jdk 1.6
    Please help me resolve the problem
    Thanks,
    Kumar

    You should confirm that you can connect to the DB with a simple Java class using the url that the code you posted is using.
    This will show that the OCI client is installed and executing properly. If you can't connect externally you will need to fix that first.
    Is the Oracle client installed on the same machine the JDBC code is running on?

  • How do I troubleshoot "A non-SQL error occurred while requesting a connection from DSN ." errors?

    Hello,
    Last week we began seeing some timeout errors, but today there have been much more of them and I’m not sure how to proceed in troubleshooting.
    We have 2 load balanced app servers:
    Windows Server 2008 R2 (virtualized)
    ColdFusion 8, Enterprise
    And a database server:
    Windows Server 2008 R2
    SQL 2012
    The error in “coldfusion-out.log” is:
    A non-SQL error occurred while requesting a connection from <DSN>.
    Timed out trying to establish connection
    This only happens on one of the web servers, but it happens more frequently when the app servers is under a heavier load. Most of the day it works fine, but 4 or 5 times throughout the day we will have 1 – 15 requests timeout in a row(always varies), and then things will be fine again w/out restarting or doing anything.
    The database server is much more powerful than the app server, and I don't believe the issue involves long running queries or the DB server being under heavy load.
    I’m a DBA who is temporarily handling System Admin responsibilities, and I’m not sure how to further trouble shoot this. I just started some pings going from the app server to the database using IP and the listeners name. How else can I prepare for the next time it happens. What other logs should I be looking at to gain some insight? Are there PerfMon counters I could use to help troubleshoot?
    Thanks for your help!

    I've had several timeout since the pings were started. Got a some response times > 1ms (nothing greater than 7 or 8ms), but no timeouts.

  • Error while connecting using Papi

    Hi All
    I facing some issue while connecting to ALBPM Studio 6.x using PAPI.
    Exception is as follows
    java.lang.NoClassDefFoundError: fuego/papi/exception/NoPermissionException
         at pageflows.bpmRedirect.TestController.begin(TestController.java:67)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.apache.beehive.netui.pageflow.FlowController.invokeActionMethod(FlowController.java:878)
         at org.apache.beehive.netui.pageflow.FlowController.getActionMethodForward(FlowController.java:808)
         at org.apache.beehive.netui.pageflow.FlowController.internalExecute(FlowController.java:477)
         at org.apache.beehive.netui.pageflow.PageFlowController.internalExecute(PageFlowController.java:305)
         at org.apache.beehive.netui.pageflow.FlowController.execute(FlowController.java:335)
         at org.apache.beehive.netui.pageflow.internal.FlowControllerAction.execute(FlowControllerAction.java:51)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
    I am calling an external servlet(controller) on click of an interactive activity.
    e.g
    Let my process Test is waiting at an interactive activity 'A' which on executing calls an external resource say 'TestController'. For this I had created a 'Server Configuration' in external resources and selected this configuration in Interactive Activity 'A'.
    On the 'TestController' when I able to fetch instanceId, activity name, but when I try to create Papi session I am getting exception mentioned above
    Code used for creating session is as follows
    Properties prop = new Properties();
    prop.setProperty(ProcessService.DIRECTORY_ID,"default");
    prop.setProperty(ProcessService.PROJECT_PATH,"D:/ALBPM6_Workspace/Testing");
    ProcessService processService;
    ProcessServiceSession bpmSession = null;
    try {
         processService = ProcessService.create(prop); //Exception at this line
         try {
              bpmSession = processService.createSession("test","test","localhost");
              } catch (OperationException e) {
              e.printStackTrace();
    } catch (CommunicationException e) {
         e.printStackTrace();
    Also when I run the above mentioned code by just creating a simple java program using main() it runs successfully.
    Please help me in this regard
    Thanks

    This is resolved it was the jar issue.
    Thanks

  • Error connecting using RemoteObject

    I've developed a simple flex app for listing data in a grid,
    which works just fine locally when the remoteobject call is made to
    the cfc. However, once the file was moved to a testing server, I
    receive the following error when the object call fires off:
    [RPC Fault faultString="Send failed"
    faultCode="Client.Error.MessageSend"
    faultDetail="Channel.Connect.Failed error
    NetConnection.Call.BadVersion: : url:
    http://www.website.edu/flex2gateway/
    The site does have a firewall in place, but the call to the
    page is being made from a pc inside the network. Are there any
    specific cf config files that need modified to allow the AMF
    message to get through?
    Thanks!

    Hi
    1.May be JCO's are not configured properly.Check your JCO's are up and running by pinging it in ContentAdmin->WebDynpro.
    2. its a simple problem of connection pooling. In your JCO connection settings change the maximum connections to 200. It will work.it  is good After you execute the Model please release the connection. The reason you are getting this JCO Client null is because the connection is not getting released.
    When you say the following code
    wdContext.current<BAPI_INPUT>.modelObject().execute();
    //Get the reference to the model and release the connection
    If your Model name is say "MO_Mymodel"  then
    MO_Mymodel model = (MO_Mymodel) WDModelFactory.getModelInstance(MO_Mymodel.class);
    model.disconnectIfAlive();
    This should release your connections. Also ensure you release the connections even if there is a exception :).
    Please refer the below forum also:
    Error connection using  JCO.Client :null
    JCO.Client: null
    com.sap.mw.jco.JCO$Exception: (102) JCO_ERROR_COMMUNICATION: JCO.Client not
    Thanks
    susmita

  • I am new on flex, and i would like to create a simple login + password using amfphp

    Hi all,
    I try to make a simple login password using mysql and amfphp, i have a little quesiton, i dont' know how to get back my response from php. Thanks in advance if anyone could help me.
    Best regards
    i would like to tell to the label    <mx:Label x="380" y="10" id="lResponse"/> the response from php
    I juste want to take back response from php.
    Here is my mxml :
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/halo" minWidth="1024" minHeight="768">
        <fx:Script>
            <![CDATA[
                import mx.controls.dataGridClasses.DataGridColumn;
                import flash.net.Responder;
                import mx.events.DataGridEvent;
                import org.corlan.VOAuthor;
                private function checkpassword():void {
                    var newauthor:VOAuthor=new VOAuthor();
                    newauthor.lname_aut = nom.text;
                    newauthor.fname_aut = prenom.text;
                    myRemote.validate(newauthor);
                private function checkInput():void
                    if(nom.text == "" || prenom.text == "")
                        lResponse.text = "Veuillez completer tout les champs";
                    else
                        lResponse.text = "connecter";
                        checkpassword();
                    //    checkLogin("login.Verify.validate",[nom.text,prenom.text]);
            ]]>
        </fx:Script>
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
            <mx:RemoteObject id="myRemote" destination="MyService" source="MyService"
                             endpoint="http://localhost/amfphp/gateway.php" showBusyCursor="true"/>
            </fx:Declarations>
        <s:Panel x="334" y="168" width="245" height="135" title="Identifiez vous" textAlign="center">
            <s:TextInput x="102" y="10" textAlign="left" id="nom" />
            <s:TextInput x="102" y="40" textAlign="left" id="prenom" />
            <s:RichText x="50" y="6" text="Login :" height="22" width="56" textAlign="left" verticalAlign="bottom"/>
            <s:RichText x="27" y="46" text="Password :" height="20"/>
            <s:Button x="125" y="70" label="Connecter" width="105" click="checkInput()"/>
            <mx:Label x="380" y="10" id="lResponse"/>
        </s:Panel>
    </s:Application>
    Here is my php code :
    <?php
    session_start();
    require_once ('./vo/org/corlan/VOAuthor.php');
    //conection info
    define( "DATABASE_SERVER", "127.0.0.1");
    define( "DATABASE_USERNAME", "root");
    define( "DATABASE_PASSWORD", "xxxx");
    define( "DATABASE_NAME", "flex360");
    class MyService {
        function validate($author){
            $mysql = mysql_connect(DATABASE_SERVER, DATABASE_USERNAME, DATABASE_PASSWORD);
            mysql_select_db(DATABASE_NAME);
            $user = $author[0];
            $pass = $author[1];
            $query = "SELECT DISTINCT * FROM authors_aut WHERE fname_aut = '$user' AND lname_aut = '$pass'";
            $rs = mysql_query($query);
            $var = mysql_fetch_assoc($rs);
            $u = $var["fname_aut"];
            $p = $var["lname_aut"];
            if ($pass != $p){
                $response[0] = "INVALID";
                $response[1] = "Invalid username and/or password";
            } else {
                $response[0] = "VALID";
                $response[1] = "Welcome $u";
            return $response;
    ?>

    I usually have a resultHandler function, to handle stuff from the server.
    resultHandler(event:ResultEvent):void

  • Unable to connect using Enterprise Manager

    I have Oracle 9.2 installed on w2000 server and it was working fine when I use isqlplus and sqlplus. However, after I type in the userID:SYS and password to expand the tree of the database when I use Enterprise Manager , it gives me the error ORA-12520. I got the same error when trying to create DSN in ODBC driver configuration.

    Solution:
    I ran into the same problem. You have to first create a password file. Run
    orapwd file=<fname> password=<password> entries=<users>
    The file will usually be in the dbs by default. You may have to play with the file name. I had to make it orapwd in dbs to make it recognize correctly.
    Next you need to modify your startup parameter for your instance to use the remote_login_passwordfile='shared' or 'exclusive'
    Set it to exclusive if you have only one instance or shared if you have multiple instances. I had to use the pfile and start the instance with that. Just rename your spfile and type 'sql>create pfile from spfile' and then edit it. Set your parameter and restart your instance. The do 'sql>create spfile from pfile' to make your spfile again. Now you should be able to connect as sys remotely from sql or OEM!!!
    Doc:
    Setting REMOTE_LOGIN_ PASSWORDFILE
    In addition to creating the password file, you must also set the initialization parameter REMOTE_LOGIN_PASSWORDFILE to the appropriate value. The values recognized are described as follows:
    Value Description
    NONE
    Setting this parameter to NONE causes Oracle to behave as if the password file does not exist. That is, no privileged connections are allowed over non-secure connections. NONE is the default value for this parameter.
    EXCLUSIVE
    An EXCLUSIVE password file can be used with only one database. Only an EXCLUSIVE file can contain the names of users other than SYS. Using an EXCLUSIVE password file allows you to grant SYSDBA and SYSOPER system privileges to individual users and have them connect as themselves.
    SHARED
    A SHARED password file can be used by multiple databases. However, the only user recognized by a SHARED password file is SYS. You cannot add users to a SHARED password file. All users needing SYSDBA or SYSOPER system privileges must connect using the same name, SYS, and password. This option is useful if you have a single DBA administering multiple databases.

  • How to connect using netbean 6.5 and oracle lite 10g

    Hello everyone.. I am really really new in this kind of thing. My task is that I need to develop a simple system using netbean and oracle lite 10g..Does anyone can at least give me a little bit tutorial for a head start in order to connect them.. I really appreciate for those who answer this.. Thank you guys...

    you mean to connect from java to oracle lite server or client?
    -if it is server you mean then you probably need to run some oracle apis (e.g. the consolidator aps).
    String url="MOBILEADMIN/123@jdbc:oracle:thin:@MYSERVER:1521:MYDB" ;
    ResourceManager.initialize(url);
    rm = ResourceManager.getInstance();
    User usr = rm.getUser(user);
    for (Enumeration e = usr.getDevices(); e.hasMoreElements();) {
    Device dev = (Device)e.nextElement();
    }//AND you may continue from here in order to send commands to the devices
    -if you have a oracle repository at the back end and you want to connect to that then you can connect like:
    DriverManager.registerDriver ((Driver)Class.forName ("oracle.jdbc.driver.OracleDriver").newInstance ());
    String url="jdbc:oracle:thin:@myserver:port:database;
    c=DriverManager.getConnection( url,"username", "password" );
    s=c.createStatement();
    s.executeQuery("Select TRIM(CODES) AS CODES,TRIM(SURNAME)||'_'||TRIM(FIRSTNAME) AS NAME from MYDB.USERS");
    ResultSet rs =s.getResultSet();
    -now if you want to connect to the oracle lite client database then you may connect using the polite
    you should write something like (i havent tried it because i use handheld clients)
    String ConnectMe=("jdbc:polite:SCOTT/tiger:polite;DataDirectory=c:\Oracle_Home;Database=polite;IsolationLevel=SINGLE;USER;Autocommit=ON;CursorType=DYNAMIC")
    try {
    Connection conn = DriverManager.getConnection(ConnectMe)
    catch (SQLException e)
    (check the internet for jdbc:polite connection strings)
    gl

  • Oracle Database Connection using JSP

    I am attempting to create a simple web app using Oracle 9i and JSP. I am trying to create a connection to my database and do not seem to be having much luck. I have worked with ASP and can find my way around fairly well in that environment, however, JSP seems to be not as closely related as I initially thought. Can anyone point me to a good site that can give a beginner the basics on using this technology. I have been to several sites off of Oracle and Sun, but I seem to be more confused after reading them. With JSP, can I code as I would in ASP i.e JavaScript, etc? I have downloaded and installed the JDBC drivers from Oracle's website, but I receive errors when trying to establish a connection. If there is a site that can explain from the ground up how to set up a connection, I would be very greatful!

    Hi,
    This example uses Interbase, but hopefully you will find it useful anyway -
    http://www.kpi.com.au/interbase/connect.jsp
    Cheers,
    Lars

  • Help me understand JDBC connections using DataSource objects

    I'm writing a simple Java server application that accepts connections from multiple clients via RMI, connects to a SQL Server 2000 database via Microsoft's SQL 2000 JDBC driver, gets some data, and returns it to the client. The server application will handle every SQL database connection. However, it must be able to establish multiple simultaneous connections, since multiple clients may connect at the same time and request data.
    Sounds like a simple multi-threaded server that utilizes a connection pool for database connectivity, right? Well, if I want to do that, I have to register a PooledDataSource object with JNDI. My server threads that are handling requests will simply grab connections out of the pool to retrieve data (presumably).
    This seems like a fairly simple server application; however, all the information and tutorials I've read on using DataSource objects for database connections rather than DriverManager.getConnection() mention XML config files, J2EE application servers, Tomcat, WebSphere, etc. I really don't want to have to deal with all that just to get connection pooling and not have to use the DriverManager.getConnection() method.
    Is there a simple way to use DataSource objects without installing a lot of extra junk on my server?

    Thanks, diazlara. Your response was exactly what I needed to know. All the information I've read prior to this suggested that I had to have a J2EE server running, and that I had to register the DataSource object with JNDI. If you ladies and gents could take a quick look at this and let me know if I'm doing it correctly, I'd appreciate it.
    As proflux suggested, I wrote a connection manager:
    import java.sql.*;
    import javax.sql.*;
    import com.microsoft.jdbcx.sqlserver.*;
    public class SQLConnectionManager {
       private static ConnectionPoolDataSource connectionPool;
       // Initialize the connection manager
       public SQLConnectionManager() {
          init();
       // Retrieve a connection from the connection pool and return it
       public static Connection getConnection() {
          Connection connection = null;
          try {
             connection = connectionPool.getPooledConnection("myUsername", "myPassword").getConnection();
          catch (SQLException ex) {
             System.err.println("A problem occurred while getting a connection from the pool.");
             ex.printStackTrace();
          return connection;
       // Initialize the datasource and connection pool
       private static void init() {
          SQLServerDataSource mds = new SQLServerDataSource();
          mds.setDescription("MS SQLServerDataSource");
          mds.setServerName("127.0.0.1");
          mds.setPortNumber(1433);
          mds.setDatabaseName("SomeTable");
          mds.setSelectMethod("cursor");
          connectionPool = (ConnectionPoolDataSource) mds;
    }As you can see, I'm hard-coding the username and password for testing purposes. I'll incorporate a login/authentication system for any production code that I use this in.
    Once the SQLConnectionManager is created, connections can be retrieved as follows:
          Connection connection = null;
          try {
             connection = SQLConnectionManager.getConnection();
             System.out.println("** Got a SQL database connection from the pool");
             DatabaseMetaData metaData = connection.getMetaData();
             ResultSet rs = metaData.getCatalogs();
             while (rs.next()) {
                System.out.println("\tcatalog: " + rs.getString(1));
             rs.close();
             connection.close();
          catch (SQLException ex) {
             System.out.println("An exception occurred while connecting to the SQL Database:");
             ex.printStackTrace();
          }So, how does that look? I tested it out, and it seems to work just fine. Using this code, I am getting a connection from a pool, correct? I want to make sure of that. Also, are there any inherent weaknesses or flaws with this method that I need to be aware of?
    Thanks so much for all the helpful responses.

  • Opening connection using full path.

    Hello.
    How do i open database connection using the database full path ?
    Thanks, Tal.

    both examples don't use full database path.
    in those cases you should declare a DSN or ODBC first.
    it is not what i am looking for.
    i want to specify the exact path to my database.
    thanks, tal.
    p.s.
    are the duke dollars are given automaticly or should i give them after someone has replied to me ? (if the second option is the right one, than OOPS).

Maybe you are looking for

  • ITunes 6 and External Hard Drive issue. Please Help!!

    Hi Gang! I'm having problems when using iTunes 6 to work with my external HD as my iTunes Music library vault. Under iTunes Advanced section I have set my Preference to change my music library from my iMac G5 to my external HD. Everything works fine,

  • Home Directory Script Question

    Im not sure if this is the right area but i figured people in the automator section would know the most about this........anyways im trying to write a script and i need to know how to make the file path go to the non-specific users home directory for

  • Number of Copies Question

    Hi All, Is there an easy way to control the no.of copies created or printed? Here's an example scenario: -- Managers make request for travel invoice report, some ask for 2 copies, some ask for 3 copies ect. -- When the report is run, it should pick u

  • Music purchased via iphone now on pc itunes

    I have recently purchased 2 albums via my iphone - great no problems. I then synced my phone with itunes on my pc. The two albums moved from my phone to my pc and I cannot get them back??? Does anyone have the answer?

  • What is local data?

    and why does it say that our of the 174.72GB I have used 174.51? My Mac used to be a school laptop then they were wiped and we paid for them to keep them. However, all of my local data is almost completely used?