How to use JDBC to connect Tomcat with database server?(Urgent!)

I try to deploy the tomcat and make it connect with databaser server.
I am using mysql connector J 3.0. I added the CLASSPATH of mysql-connector-java-3.0.7-stable-bin.jar in the tomcat.sh .
I also add the web application in server.xml.
When I start tomcat, I can see using Classpath including mysql-connector-java-3.0.7-stable-bin.jar .
But when i browse my jsp including the jdbc, wait for a while, I get a message as following: Timeout on server localhost. My web server and database server is same computer.
Could you tell me what's wrong?

Did you check to see that the MySQL database was indeed up and running, and accepting connections when you started Tomcat? Did you make sure that your firewall permits connections to the database?
Timeout errors generally occur when you send a request to a server and the server does nothing with it - i.e., it doesn't respond to it in any way. Most firewalls are configured this way. If I telnet to your machine and I get "connection refused", I know your machine exists and I can try hacking into it. If I telnet and get nothing at all, then I will either assume either there's no actual machine at that address or it's unresponsive.

Similar Messages

  • How to use jdbc to connect oracle

    I want use jdbc direct to connect oracle database,and I
    want to use sun Company or oracle Company driver. how can I get driver and how do I write connection string?
    Deeply to wait your reply,thank you!

    The correct format would be jdbc:oracle:thin@server:port:sidTry "jdbc:oracle:thin:@192.168.84.20:1521:ORDB","ysys","fareast"and see what happens.
    Note that you two formats for the DriverManager.getConnection() method; if DriverManager.getConnection(db_url, username, password) doesn't work, try the other call with a fully-qualified database url:DriverManager.getConnection("jdbc:oracle:thin:ysys/[email protected]:1521:ORDB")The SID is the server ID that was given to the instance when the database was installed; default is ORCL, but may have been changed. Port default is 1521, but again, this may be different for your system.

  • How to use JDBC driver (type 4) with struts?????

    Hi! have a nice day!!!!!
    i want to connect database use struts with JDBC driver type 4. i must add <data-source/> to <data-sources></data-sources> tag but i don't know how to use <data-source/> with it's properties. please tell me! thank very much

    thank for reply!!! :D
    my project require to use struts 1.2.8 with ODBC (i think so it's type 1) for connect to database (SQL server). i think so it has two step :
    1. edit file struts-config.xml with <data-sources> tag.
    2. programming in file java (which extends from Action class) connect to database.
    but how to programming in file java??? (i think so must use objects DataSource & Connection)

  • How to Use No DB connection App with task flow desined as 'New Transaction'

    Hi,
    My application is fully depend on Custom java datasource implmentation and it requires no DB connection at all. I've done necessary implementation (http://andrejusb.blogspot.in/2012/03/use-case-for-adf-bc-with-no-database.html) by creating CustomDatabaseConnectionStrategy that says
        @Override
        public ApplicationModule createApplicationModule(Hashtable env) {
          env.put(Configuration.DB_REQUIRES_CONNECTION,Boolean.FALSE);
          env.put(PropertyMetadata.ENV_DO_FAILOVER.pName, PropertyConstants.FALSE);
          return super.createApplicationModule(env);
        }My application works fine until i keep my task flow transaction as 'No Controller transaction'. Yes, I use Dynamic tab shell template as UI. But when I keep it as 'Always Begin with New Transaction' and not to share the Data control, Screen is not at all getting rendered. I get some exception (I guess the moment I try to open the task flow, it is trying to get the connection. Since there is no connection available, It gives me this error. Is it so?)
    One of my client requirement is to open the same screen under multiple tabs as a fresh screen (i.e. with different transaction. We do transaction through tuxedo transaction server). If I load a screen under first Tab with some data, added some record, deleted some record.. and If I load the same screen under another Tab, it should not refelect the same data whatever I have under first Tab.
    Requirement:
    I don't have DB connection in my app. But I should be able to define the task-flow to open with new instance of Application module whenever it is opened.
    Your help on this would be appreciated.
    Raghu

    If I understand you requirements correctly, you do not need ADF taskflow transactions but you just need fresh DataControls. If it is so, then you do not have to set the taskflow's transaction behaviour to "Always Begin with New Transaction" (e.g. keep it to "No Controller Transaction"), but set the DataControl frame to "isolated" (e.g. uncheck the "Share data controls with the calling task flow" checkbox in the taskflow's Property Inspector). In this way each taskflow instance will be started in a different DataControl frame (e.g. it will instantiate its own set of ApplicationModule instances).
    Dimitar

  • How to use JDBC to connect to oracle7.3.4 on remote host

    I have written a small applet which runs fine on one host(Solaris
    box)using appletviewer. In this program I am trying to connect
    to oracle on another host and the program is working fine. The
    same applet is not working from a web page.
    can anyone help me out?
    giving error like netscape.security.AppletSecurity.exception
    and lot more exception
    null

    You are restricted by the Java security sandbox from connecting
    directly to another machine through the applet. You have to use
    a JDBC driver located on the web server machine. Please make
    sure you have installed this properly, as in appended a valid
    JDBC .jar archive to your CLASSPATH.
    Openlink Software has robust JDBC drivers that enable scrollable
    (rowset driven) cursors. You may be interested in checking out
    http://www.openlinksw.com for further info.
    Our latest JDBC drivers are found at
    ftp://ftp.openlinksw.com/pre-3.2/index.html
    (scroll down to the very bottom - Windows section - don't worry,
    they're platform independent!)
    Best regards
    BVReddy (guest) wrote:
    : I have written a small applet which runs fine on one host
    (Solaris
    : box)using appletviewer. In this program I am trying to
    connect
    : to oracle on another host and the program is working fine.
    The
    : same applet is not working from a web page.
    : can anyone help me out?
    : giving error like netscape.security.AppletSecurity.exception
    : and lot more exception
    null

  • How to use JDBC to connect Oracle databse

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

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

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

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

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

  • How to use JDBC to connect informix database

    Dear all,
    I want my client application to connect informix database by using JDBC. The JDBC driver has been installed successfully in the client computer (Win2000). The informix 5.0 resides the a Unix server named "dbserver". The following is my java program.
    ========================
    import java.sql.*;
    import java.awt.event.*;
    public class Application1 {
    public static void main(String[] args) {
    Connection conn;
    try
    Class.forName("com.informix.jdbc.IfxDriver");
    catch (Exception e)
    System.out.println("Error "+e.getmessage());
    e.printStackTrace();
    return;
    System.out.println("It is ok");
    try
    conn = DriverManager.getConnection("jdbc:informix-sqli://dbserver:1526:INFORMIXSERVER=dbserver;username=test;password=******");
    catch (SQLException e)
    System.out.println("ERROR ."+e.getMessage());
    e.printStackTrace();
    return;
    System.out.println("All is fine");
    ===========================
    However, the error appears mentioning "Attempt to connect to database server (dbserver) failed." I don't know what the problem is because my informix database server is exactly "dbserver".
    Kindly need help from you guys. Thanks in advance.
    Kevin

    Hi,
    Plz try this (instead of 'username' use 'user') ...
    DriverManager.getConnection("jdbc:informix-sqli://dbserer:1526:INFORMIXSERVER=dbserver;user=test;password=*****");
    or this (pass the username and password as params)....
    DriverManager.getConnection( "jdbc:informix-sqli://dbserer:1526:INFORMIXSERVER=dbserver" , "test" , "*****" );
    Hope this helps
    ssa.
    >
    I want my client application to connect informix
    database by using JDBC. The JDBC driver has been
    installed successfully in the client computer
    (Win2000). The informix 5.0 resides the a Unix server
    named "dbserver". The following is my java program.
    ========================
    import java.sql.*;
    import java.awt.event.*;
    public class Application1 {
    public static void main(String[] args) {
    Connection conn;
    try
    Class.forName("com.informix.jdbc.IfxDriver");
    catch (Exception e)
    System.out.println("Error "+e.getmessage());
    e.printStackTrace();
    return;
    System.out.println("It is ok");
    try
    conn =
    onn =
    DriverManager.getConnection("jdbc:informix-sqli://dbser
    er:1526:INFORMIXSERVER=dbserver;username=test;password=
    catch (SQLException e)
    System.out.println("ERROR ."+e.getMessage());
    e.printStackTrace();
    return;
    System.out.println("All is fine");
    ===========================
    However, the error appears mentioning "Attempt to
    connect to database server (dbserver) failed." I don't
    know what the problem is because my informix database
    server is exactly "dbserver".
    Kindly need help from you guys. Thanks in advance.
    Kevin

  • Any Idears on how to use my D-Link Router with Print Server on my mac ?

    I just got recently a D-Link Router with Print Server.
    The Model is a DI-704UP. does anyone know how i can access the printer to my G5 ?
    talked to D-Link and Apple and they have no solution.
    IMac G5   Mac OS X (10.4.6)  

    According to this page on the D-Link website about your product, the router includes a print server for Windows and that the software is for Windows only.
    However, this page also on D-Link's website does offer you an unsupported solution.
    Hope this helps! bill
    1 GHz Powerbook G4   Mac OS X (10.4.6)  

  • How to use Icloud calendar and contacts with calendar server

    Hi
    I have a small network setup using a mountain lion server and a couple of mac mini's running snow leopard. In addition I have several iphones and ipads attached to the network.
    I want to syn calendars and contacts accross all devices but dont want to use icloud for the private stuff. I have the basics working but can not get the general icloud contacts and appointments to sync on the mac mini's. Is there a way to sync this data or do I have to duplicate each appointment , one to icloud the other to the server address book and calendar.
    I know that there is a way to sync snow leopard with icloud but I do not want all data on I could as some of it is sensative, so require to keep it internal.
    Any help would be appreciated.
    cheers

    Thanks for the help
    Not sure I have explained myself properly, I already have the server set up and have a local calendar and address book working.
    The issue I am having is how to integrate it with the icloud address book and appointments.
    for example,
    I have an appointment at 10.30 with a client, I need to have this show up on all mobile devices and the local network mini's. As it stands I have to put it in twice, once in the icloud calendar and once in the local network calendar. I would like to be able just to add it once and it show on all clients.

  • How to use JDBC Connection Pools in a standalone application?

    Hi, there,
    I have a question about how to use JDBC Connection Pools in an application. I know well about connection pool itself, but I am not quite sure how to keep the pool management object alive all the time to avoid being destroyed by garbage collection.
    for example, at the website: http://www.developer.com/java/other/article.php/626291, there is a simple connection pool implementation. there are three classes:JDBCConnection, the application's gateway to the database; JDBCConnectionImpl, the real class/object to provide connection; and JDBCPool, the management class to manage connection pool composed by JDBCConnectionImpl. JDBCPool is designed by Singleton pattern to make sure only one instance. supposing there is only one client to use connection for many times, I guess it's ok because this client first needs instantiate JDBCPool and JDBCConnectionImpl and then will hold the reference to JDBCPool all the time. but how about many clients want to use this JDBCPool? supposing client1 finishes using JDBCPool and quits, then JDBCPool will be destroyed by garbage collection since there is no reference to it, also all the connections of JDBCConnectionImpl in this pool will be destroyed too. that means the next client needs recreate pool and connections! so my question is that if there is a way to keep pool management instance alive all the time to provide connection to any client at any time. I guess maybe I can set the pool management class as daemon thread to solve this problem, but I am not quite sure. besides, there is some other problems about daemon thread, for example, how to make sure there is only one daemon instance? how to quit it gracefully? because once the whole application quits, the daemon thread also quits by force. in that case, all the connections in the pool won't get chance to close.
    I know there is another solution by JNDI if we develop servlet application. Tomcat provides an easy way to setup JNDI database pooling source that is available to JSP and Servlet. but how about a standalone application? I mean there is no JNDI service provider. it seems a good solution to combine Commons DBCP with JNID or Apache's Naming (http://jakarta.apache.org/commons/dbcp/index.html). but still, I don't know how to keep pool management instance alive all the time. once we create a JNDI enviroment or naming, if it will save in the memory automatically all the time? or we must implement it as a daemon thread?
    any hint will be great apprieciated!
    Sam

    To my knoledge the pool management instance stays alive as long as the pool is alive. What you have to figure out is how to keep a reference to it if you need to later access it.

  • How to use JDBC Lookup in PI 7.1 ?

    Hi,
    Please advise how to use JDBC lookup in message mapping PI 7.1 ? any reference link / document  ?
    I have followed this step below :
    1. Create the external definition for the database table.
    2. Use the external definition (table) in message mapping JDBC Lookup.
    But the target still "Yellow colour" meanint the mapping hasnot completed yet ? why ? and when i double click the JDBC lookup
    there some error message
    "No suitable parameter found; define new parameter of type 'Channel' first"
    Please advise.
    Thank You and Best Regards
    Fernand

    Hi Fernand,
    JDBC Lookup can be done in PI 7.1 using below mentioned steps :
    1) Create a communication channel between PI and the database to connect to database.
    2) Import the table data as External Definition.
    3) In message mapping where this lookup is to be used select JDBC Lookup under Conversions and map
    4) Double Click on JDBC Lookup
    5) Select parameter and a database table (imported as the external definition). All the elements of the table will appear in the middle column. Select and move the input parameters to the left side column and the output parameters to the right side column. Click OK. 
    6) Under message mapping go to signature tab and define the parameter as channel and category as JDBC Adapter Type. 
    7) Under Operation mapping define the parameter & associate it with parameter defined in Message Mapping.
    Thanks
    Amit

  • Connection pooling with SQL Server 2008 and Tomcat 6.0

    Hello Everybody,
    I'm creating a web application using struts 2.0 , tomcat 6.0 and sql server 2008.
    Everything works fine but i'm unable to create connection pooling with sql server 2008.Please help me to solve this issue.
    Code for this is as foolows:
    in my META-INF/context.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <Context path="/spas" docBase="spas"
    debug="5" reloadable="true" crossContext="true">
    <Resource
    name="jdbc/spas_new"
    auth="Container"
    type="javax.sql.DataSource"
    maxActive="20"
    maxIdle="10"
    maxWait="-1"
    user="spas_user"
    password="spas123"
    driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
    url="jdbc:sqlserver://HGL-0053\dbo:1433;databaseName=spas_new;responseBuffering=adaptive;"/>
    </Context>
    in my web.xml
    <resource-ref>
    <description>SQL Server Datasource</description>
    <res-ref-name>jdbc/spas_new</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    and in my ConnectionThread.java file i've used:
    Context ctx = new InitialContext();
    if(ctx == null )
    throw new Exception("Sorry! No Context Exception");
    DataSource ds = (DataSource)ctx.lookup("java:/comp/env/jdbc/spas_new");
    System.out.println("ds:"+ds);
    conn=ds.getConnection();
    Following is the exception:
    org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Login failed for user ''.)
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
    at login.V_SPAS_ConnectionThread.getConnection(V_SPAS_ConnectionThread.java:87)
    at org.apache.jsp.login.v_005fspas_005flogin_005fpage_jsp._jspService(v_005fspas_005flogin_005fpage_jsp.java:95)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
    at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
    at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
    at org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1023)
    at org.apache.struts.tiles.TilesRequestProcessor.internalModuleRelativeForward(TilesRequestProcessor.java:345)
    at org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:572)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:221)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
    at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:694)
    at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:665)
    at org.apache.jsp.index_jsp._jspService(index_jsp.java:54)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at login.V_SPAS_SecurityCheckFilter.doFilter(V_SPAS_SecurityCheckFilter.java:108)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user ''.

    Hi Karthikeyan,
    This is not the issue at all. I can open the management studio by the same login id and password and also i can make the database jdbc connection from plain java file.
    It does not give me any problem by them.
    I'm unable to find the actual problem. May be i'm missing something in connection pooling.
    Please help.
    Regards
    Mina

  • Is there any documentation on how to use JDBC in ALBPM?

    I'm trying to connect to a DB using DriverManager class.
    1) I've defined an externalResource of type SQL Database.
    2) When I execute the following code:
    //externalResourceURL is the URL of the SQL Database external resource created in 1), same for user and password
    con as java.sql.Connection = DriverManager.getConnection(arg1=externalResourceURL, arg2=user, arg3=password)
    3) I get the following error: This driver is locked for use with embedded applications.
    Is there any tutorial or documentation on how to use JDBC in ALBPM?
    Thanks in advance

    I don't know of any documentation off hand... but what are you trying to do? I haven't needed to to make a connection using the DriverClass....
    If you aren't using dynamicSQL... you can just catalog the database, and make direct sql calls (not recommended)... but if you catalog it, then just an INSERT command works... or UPDATE... etc
    logMessage "Starting insert."
    INSERT INTO MYTABLE(id, name) VALUES ("2", "kevin");
    logMessage "Finished insert."Check out the studio help under SQL Keywords for more info on that...
    HTH
    -Kevin

  • I want to use jdbc to connect MS SQL SERVER

    hi,
    I want to use jdbc to connect MS SQL SERVER,not the jdbc-odbc bridge.
    I download the driver from MS,deploy it,but when I connect the database such as:
    <%Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");%>
    <%String sConnStr="jdbc:microsoft:sqlserver://computer2000:1433";%>
    <%Connection conn=DriverManager.getConnection(sConnStr,"sa","123");%>
    <%Statement stmt=conn.createStatement();%>
    but it said
    javax.servlet.ServletException: com.microsoft.jdbc.sqlserver.SQLServerDriver
    java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver
    how can i work out this problem
    maybe my configure is wrong,please give me a successful sample configuration
    thanks a lot

    Hi,
    I am not sure where you have got the following code from
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    What happens here, is Java Runtime will search for the Class named:
    com.microsoft.jdbc.sqlserver.SQLServerDriver
    If this Class is not in the Runtime Classpath, it will throw the Error that you have got. Kindly get the proper driver as well as ensure that the Class is available in the Runtime Classpath.
    Thanks and regards,
    Pazhanikanthan. P

Maybe you are looking for