Connecting servlets to database

Hello,
Currently i,m facing this problem when trying to establish a connection to Microsoft Access Database.
"Servlet invoker is currently unavailable"
I already restart my Tomcat and run the servlet again but the problem is still occurring.
I appreciate for your help....thanks in advance
Regards,
Lawrence

Hello again,
Well, you might want to see my code, coz probably is the coding problem.
import java.sql.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class Hive extends HttpServlet {
     Connection con;     
     public void doGet(HttpServletRequest req, HttpServletResponse res)
               throws ServletException, IOException {
          res.setContentType("text/html");
          PrintWriter out = res.getWriter();
          String docType = "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 3.2 Final//EN'>\n";
               /* HTML CODE here, is too long so i didn't post it */
public void doPost(HttpServletRequest req, HttpServletResponse res)
          throws ServletException, IOException {
doGet(req, res);
handleform(req, res);
public void init() throws ServletException {
               try {
                    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                    con = DriverManager.getConnection("jdbc:odbc:b33");//, "user", "passwd");
               catch (ClassNotFoundException e) {
                    throw new UnavailableException("Couldn't load JdbcOdbcDriver");
               catch (SQLException e) {
                    throw new UnavailableException("Couldn't get db connection");
          private void handleForm(HttpServletRequest req, HttpServletResponse res)
                                   throws ServletException {
               String user = req.getParameter("user");
               String product = req.getParameter("product");
               String title = req.getParameter("title");
               String INSERT =
                    "INSERT INTO go (Product ID, Title) VALUES ('" + product + "', '" + title + "');
               PreparedStatement pstmt = null;
               try{
                    pstmt = con.prepareStatement(INSERT);
                    //long time = System.currentTimeMillis();
                    //pstmt.setString(1, product);
                    //pstmt.setString(2, title);
                    pstmt.executeUpdate();
               catch (SQLException e) {
                    throw new ServletException(e);
               finally {
               try {
                    if (pstmt != null)pstmt.close();
               catch (SQLException ignored){
here is the code,

Similar Messages

  • Connecting to MySQL Database with Servlet

    Hi All,
    I want to connect to MySQL Database from servlet.
    I am using Tomcat websever 3.3.1, where i have to set classpath of mysql jdbc driver.
    I tried by copying mysql jdbc driver in so many directiories of Tomcat server but it is
    giving me error like "no specified driver find"
    So please send me all the solutions and how to set the classpath to connect to
    mysql database.
    Thanks

    U r correct that so many people are giving me solutions but that are not working for me
    I think i not correct in setting the classapath to mysql jdbc driver.
    1)I have unjarred correctly and all the classes are present in that.
    yes driver class is there in that .
    2)Now i am using new version of the mysqljdbc that is 2.0.13
    If now any driver after this send me url i will download it and use it
    3)I am unable to under stand what is yourcontext in
    yourcontext/web-inf/lib?
    This is my directory structure.
    c:tomcat in this i have
    bin
    conf
    doc
    lib
    logs
    modules
    native
    webapps
    work
    in bin there are no subdirectories
    in conf i have
    auto,jserv,jk,users
    in doc i have
    appdev,images
    sample( in appdev)
    etc,lib,src,web(in sample)
    images(in sample\web)
    in lib i have
    apps
    common
    container(c:\tomcat\lib)
    in logs,modules there are no subdirectories
    in native (c:\tomcat\native) i have
    mod_jk
    mod_jserv
    in mod_jk i have
    apache 1.3
    common
    iis
    jni
    netscape
    nt_service
    in webapps i have (c:tomcat\webapps)
    Admin,Examples,root
    in Admin i have (c:\tomcat\webapps\admin)
    contextadmin
    Meta-inf
    Test
    Web-inf
    in web-inf (c:\tomcat\webapps\admin\web-inf)
    Classes,lib,script
    in classes i have (c:\tomcat\webapps\admin\web-inf\classes)
    tadm
    in examples (c:\tomcat\webapps\examples) i have
    Images,Jsp,Meta-inf,Servlets,Web-inf
    in web-inf (c:\tomcat\webapps\examples\web-inf) i have
         Classes,jsp
    in classed (c:\tomcat\webapps\examplesweb-inf\classes) i have
    Cal
    Checkbox
    Colors
    Dates
    Error
    Examples
    Num
    Sessions
    in jsp (c:\tomcat\webapps\examples\web-inf\jsp) i have
    applet          
    I think this is enough to give correct answer for me .
    Thanks

  • Servlet and Database Connectivity

    Hi,
    I have got a basic question. I am connecting to a database through a servlet and displaying a table. What I need to do is have three buttons at the bottom of the table like "ADD", "DELETE" "MODIFY". I am wondering how I can add buttons to the HTML page through the servlet, select a row and click on one of the buttons to MODIFY/DELETE and how to capture the actions of each button when clicked like when "ADD" button is clicked it should pass control to a servlet "add.java". If i plan to include a javascript how can i call from the servlet, is there a way. If anyone could throw me some light or atleast point me in the right direction that would be great.
    Thanks
    Chak

    you can even use buttons!
    HTML:
    <input type="submit" name="add" value="Add">
    <input type="submit" name="modify" value="Modify">
    <input type="submit" name="delete" value="Delete">
    Servlet:
    String addButton = req.getParameter("add");
    String modifyButton = req.getParameter("modify");
    String deleteButton = req.getParameter("delete");
    So when the add-Button is clicked, addButton equals to "add", modifyButton==null and deleteButton==null, and vice versa

  • Connection to the Database thru Servlet

    Hello:
    I have just read some threads in this forum and noticed that people saying that connecting to the database in JSP is not a good Java Programming Habit. So, could you please give a little guidance on connection to the Oracle database in servlet. Thank you very much.
    Oscar.

    You use standard JDBC:
    http://java.sun.com/docs/books/tutorial/jdbc/index.htmlIn a servlet container, most of the time, you set up a connection pool that you access through JNDI
    http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.htmlFor larger applications you might want to use "Data Access Objects"
    http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.htmlCheers,
    evnafets

  • Problem with EM (Enterprise Manager is not able to connect to the database)

    Hi all,
    I've Oracle DB 11g Rel.1 installed on Windows XP SP3. The database is up and running i.e. everyone can connect to the DB by using any App tool e.g. SQL*Plus, Forms, or Reports. It means that the listener and the service is running. But the problem is that when I try to start the EM I see some error messages on the webpage.
    It says:
    Enterprise Manager is not able to connect to the database instance. The state of the components are listed below.Database Instance (Green arrow)
    Status     Open                         Details     The instance is open.
    Host          shiman
    Port          *1521*
    SID          orcl
    Oracle Home     d:\Oracle\product\11.1.0\db_1
    Agent Connection to Instance (Green arrow)
    Status Succeeded
    Details
    Listener (Green arrow)
    Status     Up
    Host          shiman
    Port          *1521*
    Name          LISTENER
    Oracle Home     d:\Oracle\product\11.1.0\db_1
    Location     d:\Oracle\product\11.1.0\db_1\network\admin
    Details          
    please see the attached file:
    http://rapidshare.com/files/404840300/em.JPGI've already checked all the services, they are running. And when I execute emctl command I got the following message.
    emctl status dbconsole
    Oracle Enterprise Manager 11g Database Control Release 11.1.0.6.0
    Copyright (c) 1996, 2007 Oracle Corporation. All rights reserved.
    http://shiman:1158/em/console/aboutApplication
    Oracle Enterprise Manager 11g is running.I have checked some documents around config files in sysman and test_orcl\sysman directories. Moreover, I have checked dbsnmp and sysman account for unlockness and password accuracy. But they did not help me to solve the problem.
    My question is if every thing is working fine then what is the problem with the EM? Why it is not connecting to the DB?
    Thanks.
    Iman

    emdctl.trc2010-07-13 18:42:21 Thread-2196 WARN http: snmehl_connect: connect failed to (shiman:1158): No connection could be made because the target machine actively refused it.
    (error = 10061)
    2010-07-13 18:42:26 Thread-4856 WARN http: snmehl_connect: connect failed to (shiman:1158): No connection could be made because the target machine actively refused it.
    (error = 10061)
    2010-07-13 18:42:28 Thread-5684 ERROR ssl: nzos_Handshake failed, ret=28864
    2010-07-13 18:42:28 Thread-5684 ERROR http: 1704: Unable to initialize ssl connection with server, aborting connection attempt
    2010-07-13 18:42:28 Thread-5684 ERROR main: nmectla_agentctl: Error connecting to https://shiman:3938/emd/main. Returning status code 1
    emoms.trc2010-07-13 18:45:44,562 [ApplicationServerThread-1] ERROR conn.ConnectionService verifyRepositoryEx.818 - Invalid Connection Pool. ERROR = Locale not recognized
    2010-07-13 18:45:46,875 [ApplicationServerThread-2] ERROR conn.ConnectionService verifyRepositoryEx.818 - Invalid Connection Pool. ERROR = Locale not recognized
    2010-07-13 18:45:46,921 [ApplicationServerThread-0] ERROR conn.ConnectionService verifyRepositoryEx.818 - Invalid Connection Pool. ERROR = Locale not recognized
    2010-07-13 18:45:47,078 [ApplicationServerThread-2] ERROR conn.ConnectionService verifyRepositoryEx.818 - Invalid Connection Pool. ERROR = Locale not recognized
    2010-07-13 18:45:47,125 [ApplicationServerThread-1] ERROR conn.ConnectionService verifyRepositoryEx.818 - Invalid Connection Pool. ERROR = Locale not recognized
    2010-07-13 18:45:47,140 [ApplicationServerThread-3] ERROR conn.ConnectionService verifyRepositoryEx.818 - Invalid Connection Pool. ERROR = Locale not recognized
    2010-07-13 18:45:47,187 [ApplicationServerThread-0] ERROR conn.ConnectionService verifyRepositoryEx.818 - Invalid Connection Pool. ERROR = Locale not recognized
    2010-07-13 18:45:47,234 [ApplicationServerThread-5] ERROR conn.ConnectionService verifyRepositoryEx.818 - Invalid Connection Pool. ERROR = Locale not recognized
    2010-07-13 18:45:47,281 [ApplicationServerThread-4] ERROR conn.ConnectionService verifyRepositoryEx.818 - Invalid Connection Pool. ERROR = Locale not recognized
    2010-07-13 18:45:47,328 [ApplicationServerThread-6] ERROR conn.ConnectionService verifyRepositoryEx.818 - Invalid Connection Pool. ERROR = Locale not recognized
    2010-07-13 18:45:48,984 [ApplicationServerThread-2] ERROR conn.ConnectionService verifyRepositoryEx.818 - Invalid Connection Pool. ERROR = Locale not recognized
    2010-07-13 18:45:49,000 [EMUI_18_45_48_/console/aboutApplication] ERROR svlt.PageHandler handleRequest.639 - java.lang.IllegalStateException: Response has already been committed
    java.lang.IllegalStateException: Response has already been committed
         at com.evermind.server.http.EvermindHttpServletResponse.resetBuffer(EvermindHttpServletResponse.java:1853)
         at com.evermind.server.http.ServletRequestDispatcher.unprivileged_forward(ServletRequestDispatcher.java:260)
         at com.evermind.server.http.ServletRequestDispatcher.access$100(ServletRequestDispatcher.java:42)
         at com.evermind.server.http.ServletRequestDispatcher$2.oc4jRun(ServletRequestDispatcher.java:204)
         at oracle.oc4j.security.OC4JSecurity.doPrivileged(OC4JSecurity.java:283)
         at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:209)
         at oracle.sysman.emSDK.svlt.PageHandler.render(PageHandler.java:1113)
         at oracle.sysman.emSDK.svlt.PageHandler.myRender(PageHandler.java:1173)
         at oracle.sysman.emSDK.svlt.PageHandler.handleRequest(PageHandler.java:597)
         at oracle.sysman.emSDK.svlt.EMServlet.myDoGet(EMServlet.java:781)
         at oracle.sysman.emSDK.svlt.EMServlet.doGet(EMServlet.java:337)
         at oracle.sysman.eml.app.Console.doGet(Console.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
         at oracle.sysman.eml.app.EMRepLoginFilter.doFilter(EMRepLoginFilter.java:87)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
         at oracle.sysman.db.adm.inst.HandleRepDownFilter.doFilter(HandleRepDownFilter.java:134)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
         at oracle.sysman.eml.app.BrowserVersionFilter.doFilter(BrowserVersionFilter.java:122)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
         at oracle.sysman.emSDK.svlt.EMRedirectFilter.doFilter(EMRedirectFilter.java:102)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
         at oracle.sysman.eml.app.ContextInitFilter.doFilter(ContextInitFilter.java:306)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:627)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:230)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:33)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:831)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    2010-07-13 18:45:49,000 [EMUI_18_45_48_/console/aboutApplication] ERROR em.console doGet.357 - java.lang.IllegalStateException: Response has already been committed, be sure not to write to the OutputStream or to trigger a commit due to any other action before calling this method.
    java.lang.IllegalStateException: Response has already been committed, be sure not to write to the OutputStream or to trigger a commit due to any other action before calling this method.
         at com.evermind.server.http.EvermindHttpServletResponse.sendRedirect(EvermindHttpServletResponse.java:1339)
         at oracle.sysman.emSDK.svlt.EMServlet.myDoGet(EMServlet.java:806)
         at oracle.sysman.emSDK.svlt.EMServlet.doGet(EMServlet.java:337)
         at oracle.sysman.eml.app.Console.doGet(Console.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
         at oracle.sysman.eml.app.EMRepLoginFilter.doFilter(EMRepLoginFilter.java:87)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
         at oracle.sysman.db.adm.inst.HandleRepDownFilter.doFilter(HandleRepDownFilter.java:134)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
         at oracle.sysman.eml.app.BrowserVersionFilter.doFilter(BrowserVersionFilter.java:122)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
         at oracle.sysman.emSDK.svlt.EMRedirectFilter.doFilter(EMRedirectFilter.java:102)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
         at oracle.sysman.eml.app.ContextInitFilter.doFilter(ContextInitFilter.java:306)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:627)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:230)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:33)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:831)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)

  • Enterprice manager is not able to connect to the database instance

    hello,
    I have problem with EM. I have some databases, and I worked with Enterprice Manager on this databases. First DB when I have repository is ok and EM always connect with this, but I worked on another DB some time and was ok, but three days ago when I start EM I get message 'Enterprice Manager is not able to connect to the database instance'. When I couldn't resolve this problem, I make new DB and this worked two days ok, and today I get this same message. I don't make any changes in listener and tns files.
    any idea?
    # listener.ora Network Configuration File: C:\oracle\product\10.2.0\db_1\network\admin\listener.ora
    # Generated by Oracle configuration tools.
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
    (PROGRAM = extproc)
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = ORACLE)(PORT = 1521))
    # tnsnames.ora Network Configuration File: C:\oracle\product\10.2.0\db_1\network\admin\tnsnames.ora
    # Generated by Oracle configuration tools.
    SZDTEST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oracle)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = szdtest.localhost)
    SZD =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oracle)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = szd)
    TEST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oracle)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = test)
    ORCL =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oracle)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = orcl)
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    This is strange because when I working on EM get in some event errors
    500 Internal Server Error
    java.lang.NullPointerException
         at java.util.Hashtable.put(Hashtable.java:393)
         at oracle.sysman.emSDK.svc.conn.FGAConnectionCache.getFGAConnection(FGAConnectionCache.java:182)
         at oracle.sysman.emSDK.svc.conn.ConnectionService.getConnection(ConnectionService.java:289)
         at oracle.sysman.emSDK.svc.conn.ConnectionService.getConnection(ConnectionService.java:261)
         at oracle.sysman.db.util.DBJobController.getRepositoryConnection(DBJobController.java:458)
         at oracle.sysman.db.util.DBJobController.initializeBean(DBJobController.java:326)
         at oracle.sysman.db.util.rec.RecoveryController.getBean(RecoveryController.java:262)
         at oracle.sysman.db.util.DBJobController.setPageSequence(DBJobController.java:384)
         at oracle.sysman.db.util.DBJobController.resetPageSequence(DBJobController.java:404)
         at oracle.sysman.db.util.DBJobController.handleStart(DBJobController.java:645)
    ....................

    yes DBConsole services are started:
    OracleDBConsoleorcl running
    OracleDBConsoleszd running
    results emctl status and start
    C:\oracle\product\10.2.0\db_1\BIN>emctl status dbconsole
    Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
    Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
    http://ORACLE:5502/em/console/aboutApplication
    Oracle Enterprise Manager 10g is running.
    Logs are generated in directory C:\oracle\product\10.2.0\db_1/ORACLE_szd/sysman/log
    C:\oracle\product\10.2.0\db_1\BIN>emctl start dbconsole
    Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
    Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
    http://ORACLE:5502/em/console/aboutApplication
    Agent Version : 10.1.0.4.1
    OMS Version : Unknown
    Protocol Version : 10.1.0.2.0
    Agent Home : C:\oracle\product\10.2.0\db_1\ORACLE_szd
    Agent binaries : C:\oracle\product\10.2.0\db_1
    Agent Process ID : 2960
    Agent Process ID : 2960
    Agent URL : http://ORACLE:1832/emd/main
    Started at : 2010-06-25 09:58:05
    Started by user : SYSTEM
    Last Reload : 2010-06-25 09:59:53
    Last successful upload : (none)
    Last attempted upload : (none)
    Total Megabytes of XML files uploaded so far : 0.00
    Number of XML files pending upload : 244
    Size of XML files pending upload(MB) : 1.56
    Available disk space on upload filesystem : 55.04%
    Agent is already started. Will restart the agent
    This will stop the Oracle Enterprise Manager 10g Database Control process. Continue [y/n] :
    but still I get this message
    EM was started and I see this message and that database is open and listener is up and agent connection to instance is succed
    Edited by: user515960 on 2010-06-25 01:08
    view logs in emoms.log after emctl status dbconsole
    2010-06-25 11:38:45,796 [HttpRequestHandler-23814595] ERROR conn.ConnectionService verifyRepositoryEx.433 - Invalid Connection Pool. ERROR = ORA-06550: linia 1, kolumna 7:
    PLS-00201: identyfikator 'SETEMUSERCONTEXT' powinien być zadeklarowany
    ORA-06550: linia 1, kolumna 7:
    PL/SQL: Statement ignored
    2010-06-25 11:38:45,875 [HttpRequestHandler-23814595] ERROR eml.OMSHandshake getParameterFromDB.402 - ORA-06550: linia 1, kolumna 7:
    PLS-00201: identyfikator 'SETEMUSERCONTEXT' powinien być zadeklarowany
    ORA-06550: linia 1, kolumna 7:
    PL/SQL: Statement ignored
    2010-06-25 11:38:45,875 [HttpRequestHandler-23814595] ERROR eml.OMSHandshake processFailure.619 - OMSHandshake failed.(AGENT URL = http://ORACLE:1832/emd/main)(ERROR = INTERNAL_ERROR)
    2010-06-25 11:38:58,437 [OmsServiceDriver thread] ERROR conn.ConnectionService verifyRepositoryEx.433 - Invalid Connection Pool. ERROR = ORA-06550: linia 1, kolumna 7:
    PLS-00201: identyfikator 'SETEMUSERCONTEXT' powinien być zadeklarowany
    ORA-06550: linia 1, kolumna 7:
    PL/SQL: Statement ignored
    2010-06-25 11:39:00,968 [HttpRequestHandler-23814595] ERROR conn.ConnectionService verifyRepositoryEx.433 - Invalid Connection Pool. ERROR = ORA-06550: linia 1, kolumna 7:
    PLS-00201: identyfikator 'SETEMUSERCONTEXT' powinien być zadeklarowany
    ORA-06550: linia 1, kolumna 7:
    PL/SQL: Statement ignored
    2010-06-25 11:39:00,984 [EMUI_11_39_00_/console/aboutApplication] ERROR em.console doGet.311 - java.lang.IllegalStateException: Response has already been committed
    java.lang.IllegalStateException: Response has already been committed
         at com.evermind.server.http.EvermindHttpServletResponse.resetBuffer(EvermindHttpServletResponse.java:1901)
         at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:211)
         at oracle.sysman.emSDK.svlt.PageHandler.render(PageHandler.java:773)
         at oracle.sysman.emSDK.svlt.PageHandler.handleRequest(PageHandler.java:396)
         at oracle.sysman.emSDK.svlt.EMServlet.myDoGet(EMServlet.java:688)
         at oracle.sysman.emSDK.svlt.EMServlet.doGet(EMServlet.java:291)
         at oracle.sysman.eml.app.Console.doGet(Console.java:135)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
         at oracle.sysman.emSDK.svlt.EMRedirectFilter.doFilter(EMRedirectFilter.java:101)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
         at oracle.sysman.db.adm.inst.HandleRepDownFilter.doFilter(HandleRepDownFilter.java:123)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:20)
         at oracle.sysman.eml.app.ContextInitFilter.doFilter(ContextInitFilter.java:239)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:600)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:793)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    2010-06-25 11:39:01,078 [HttpRequestHandler-23814595] ERROR conn.ConnectionService verifyRepositoryEx.433 - Invalid Connection Pool. ERROR = ORA-06550: linia 1, kolumna 7:
    PLS-00201: identyfikator 'SETEMUSERCONTEXT' powinien być zadeklarowany
    ORA-06550: linia 1, kolumna 7:
    PL/SQL: Statement ignored
    2010-06-25 11:39:01,093 [EMUI_11_39_01_/console/aboutApplication] ERROR em.console doGet.311 - java.lang.IllegalStateException: Response has already been committed
    java.lang.IllegalStateException: Response has already been committed
         at com.evermind.server.http.EvermindHttpServletResponse.resetBuffer(EvermindHttpServletResponse.java:1901)
         at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:211)
         at oracle.sysman.emSDK.svlt.PageHandler.render(PageHandler.java:773)
         at oracle.sysman.emSDK.svlt.PageHandler.handleRequest(PageHandler.java:396)
         at oracle.sysman.emSDK.svlt.EMServlet.myDoGet(EMServlet.java:688)
         at oracle.sysman.emSDK.svlt.EMServlet.doGet(EMServlet.java:291)
         at oracle.sysman.eml.app.Console.doGet(Console.java:135)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
         at oracle.sysman.emSDK.svlt.EMRedirectFilter.doFilter(EMRedirectFilter.java:101)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
         at oracle.sysman.db.adm.inst.HandleRepDownFilter.doFilter(HandleRepDownFilter.java:123)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:20)
         at oracle.sysman.eml.app.ContextInitFilter.doFilter(ContextInitFilter.java:239)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:600)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:793)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    2010-06-25 11:39:02,015 [HttpRequestHandler-23814595] ERROR conn.ConnectionService verifyRepositoryEx.433 - Invalid Connection Pool. ERROR = ORA-06550: linia 1, kolumna 7:
    PLS-00201: identyfikator 'SETEMUSERCONTEXT' powinien być zadeklarowany
    ORA-06550: linia 1, kolumna 7:
    PL/SQL: Statement ignored
    2010-06-25 11:39:02,093 [HttpRequestHandler-23814595] ERROR eml.OMSHandshake getParameterFromDB.402 - ORA-06550: linia 1, kolumna 7:
    PLS-00201: identyfikator 'SETEMUSERCONTEXT' powinien być zadeklarowany
    ORA-06550: linia 1, kolumna 7:
    PL/SQL: Statement ignored
    2010-06-25 11:39:02,093 [HttpRequestHandler-23814595] ERROR eml.OMSHandshake processFailure.619 - OMSHandshake failed.(AGENT URL = http://ORACLE:1832/emd/main)(ERROR = INTERNAL_ERROR)
    2010-06-25 11:39:05,687 [HttpRequestHandler-23814595] ERROR conn.ConnectionService verifyRepositoryEx.433 - Invalid Connection Pool. ERROR = ORA-06550: linia 1, kolumna 7:
    PLS-00201: identyfikator 'SETEMUSERCONTEXT' powinien być zadeklarowany
    ORA-06550: linia 1, kolumna 7:
    PL/SQL: Statement ignored
    2010-06-25 11:39:05,750 [HttpRequestHandler-23814595] ERROR eml.OMSHandshake getParameterFromDB.402 - ORA-06550: linia 1, kolumna 7:
    PLS-00201: identyfikator 'SETEMUSERCONTEXT' powinien być zadeklarowany
    ORA-06550: linia 1, kolumna 7:
    PL/SQL: Statement ignored
    2010-06-25 11:39:05,765 [HttpRequestHandler-23814595] ERROR eml.OMSHandshake processFailure.619 - OMSHandshake failed.(AGENT URL = http://ORACLE:1832/emd/main)(ERROR = INTERNAL_ERROR)
    2010-06-25 11:39:05,812 [HttpRequestHandler-23814595] ERROR conn.ConnectionService verifyRepositoryEx.433 - Invalid Connection Pool. ERROR = ORA-06550: linia 1, kolumna 7:
    PLS-00201: identyfikator 'SETEMUSERCONTEXT' powinien być zadeklarowany
    ORA-06550: linia 1, kolumna 7:
    PL/SQL: Statement ignored
    2010-06-25 11:39:05,843 [HttpRequestHandler-23814595] ERROR eml.OMSHandshake getParameterFromDB.402 - ORA-06550: linia 1, kolumna 7:
    PLS-00201: identyfikator 'SETEMUSERCONTEXT' powinien być zadeklarowany
    ORA-06550: linia 1, kolumna 7:
    PL/SQL: Statement ignored
    2010-06-25 11:39:05,843 [HttpRequestHandler-23814595] ERROR eml.OMSHandshake processFailure.619 - OMSHandshake failed.(AGENT URL = http://ORACLE:1832/emd/main)(ERROR = INTERNAL_ERROR)
    2010-06-25 11:39:16,187 [HttpRequestHandler-23814595] ERROR conn.ConnectionService verifyRepositoryEx.433 - Invalid Connection Pool. ERROR = ORA-06550: linia 1, kolumna 7:
    PLS-00201: identyfikator 'SETEMUSERCONTEXT' powinien być zadeklarowany
    ORA-06550: linia 1, kolumna 7:
    PL/SQL: Statement ignored
    2010-06-25 11:39:16,187 [EMUI_11_39_16_/console/aboutApplication] ERROR em.console doGet.311 - java.lang.IllegalStateException: Response has already been committed
    java.lang.IllegalStateException: Response has already been committed
         at com.evermind.server.http.EvermindHttpServletResponse.resetBuffer(EvermindHttpServletResponse.java:1901)
         at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:211)
         at oracle.sysman.emSDK.svlt.PageHandler.render(PageHandler.java:773)
         at oracle.sysman.emSDK.svlt.PageHandler.handleRequest(PageHandler.java:396)
         at oracle.sysman.emSDK.svlt.EMServlet.myDoGet(EMServlet.java:688)
         at oracle.sysman.emSDK.svlt.EMServlet.doGet(EMServlet.java:291)
         at oracle.sysman.eml.app.Console.doGet(Console.java:135)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
         at oracle.sysman.emSDK.svlt.EMRedirectFilter.doFilter(EMRedirectFilter.java:101)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
         at oracle.sysman.db.adm.inst.HandleRepDownFilter.doFilter(HandleRepDownFilter.java:123)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:20)
         at oracle.sysman.eml.app.ContextInitFilter.doFilter(ContextInitFilter.java:239)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:600)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:793)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    2010-06-25 11:39:16,281 [HttpRequestHandler-23814595] ERROR conn.ConnectionService verifyRepositoryEx.433 - Invalid Connection Pool. ERROR = ORA-06550: linia 1, kolumna 7:
    PLS-00201: identyfikator 'SETEMUSERCONTEXT' powinien być zadeklarowany
    ORA-06550: linia 1, kolumna 7:
    PL/SQL: Statement ignored
    2010-06-25 11:39:16,281 [EMUI_11_39_16_/console/aboutApplication] ERROR em.console doGet.311 - java.lang.IllegalStateException: Response has already been committed
    java.lang.IllegalStateException: Response has already been committed
         at com.evermind.server.http.EvermindHttpServletResponse.resetBuffer(EvermindHttpServletResponse.java:1901)
         at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:211)
         at oracle.sysman.emSDK.svlt.PageHandler.render(PageHandler.java:773)
         at oracle.sysman.emSDK.svlt.PageHandler.handleRequest(PageHandler.java:396)
         at oracle.sysman.emSDK.svlt.EMServlet.myDoGet(EMServlet.java:688)
         at oracle.sysman.emSDK.svlt.EMServlet.doGet(EMServlet.java:291)
         at oracle.sysman.eml.app.Console.doGet(Console.java:135)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
         at oracle.sysman.emSDK.svlt.EMRedirectFilter.doFilter(EMRedirectFilter.java:101)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
         at oracle.sysman.db.adm.inst.HandleRepDownFilter.doFilter(HandleRepDownFilter.java:123)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:20)
         at oracle.sysman.eml.app.ContextInitFilter.doFilter(ContextInitFilter.java:239)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:600)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:793)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    Edited by: user515960 on 2010-06-25 02:41

  • I can't connect to MySQL database from The JSP Standard Tag Library

    Hi All !
    I have a problem, please help me anybody !
    I don't connect to MySQL database from jsp page using JSTL tag but from servlet all work correctly. I set my path and put �mysql-connector-java-3.1.13-bin.jar� in ENVIRONMENT WinXP(classpath=C:\Java\jdk1.5.0_10\jre\lib\ext\mysql-connector-java-3.1.13-bin.jar) and in War project folder �WEB-INF/lib� and in [TomcatServer]\common\lib.
    I have in folder�WEB-INF/lib� following files:
    antlr.jar
    commons-beanutils.jar
    commons-collections.jar
    commons-digester.jar
    commons-fileupload.jar
    commons-logging.jar
    commons-validator.jar
    jakarta-oro.jar
    jsf-api.jar
    jsf-impl.jar
    jstl.jar
    mysql-connector-java-3.1.13-bin.jar
    standard.jar
    struts.jar
    I'm using:
    NetBeans 5.5 Build200610171010 (bundled Tomcat 5.5.17)
    Ent.Pack 20061020 Visual Wb Pack 061103
    OS WinXP SP2
    Java 1.5.0_10
    MySQL 5.0.18-nt
    1:<%@page contentType="text/html"%>
    2:<%@page pageEncoding="UTF-8"%>
    8: <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    9: <%@taglib uri="http://java.sun.com/jstl/sql" prefix="sql"%>
    10:
    11: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    12: "http://www.w3.org/TR/html4/loose.dtd">
    13:
    14: <sql:setDataSource var="ds"
    15: driver="com.mysql.jdbc.Driver"
    16: url="jdbc:mysql://localhost:3306/test"
    17: user="root"
    18: password="xxxx"/>
    19:
    20:
    21:<sql:query sql="select name, age from People" var="res"
    22: dataSource="${ds}"/>
    I have received report on mistake when entered code at the top:
    �/index.jsp [21;0] According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions�
    I used instead of (dataSource="${ds}")->(dataSource="ds") but this did not work.
    After build and run I have received
    =========================================START=================================
    HTTP Status 500
    type Exception report:
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: /index.jsp(21,0) According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    root cause
    org.apache.jasper.JasperException: /index.jsp(21,0) According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:146)
    org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:955)
    org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:710)
    org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
    org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
    org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
    org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
    org.apache.jasper.compiler.Validator.validate(Validator.java:1489)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:166)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
    Apache Tomcat/5.5.17
    =======================================END================================
    Error: "According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions" - but according to documentation such parameter possible.
    BUT WHEN JOINING With DATABASE FROM SERVLET ALL WORK FINE.
    I read this doc - [http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html], this applicable if I Tomcat Admin, but i'am not Admin
    I simply user, i.e. I want to place its database on virtual host (Tomcat+(JSP-JSTL)+MySQL).
    There is idea how can resolve this problem
    Thank you in advance ;)

    For all how have similar problem.
    Decision instead of these ways
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
    it is necessary to indicate these
    <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

  • How can I connect to a database from ipaq with cldc??

    how can I connect to a database from ipaq with cldc??

    Hi Again
    There is a library by Mimer which allows you do connect to a Mimer SQL Server, don't know must about it, but here is a link.
    http://developer.mimer.com/
    If that doesn't suit you, I suspect that you will have to use some sort of proxy solution. Either by creating a servlet to accept the sql string you want to send, or by creating your own custom proxy server running J2EE. The servlet or the proxy server must be able to receive an SQL String, do the query to the actual database and return the results in some sort of format to the mobile device. Maybe just a space delimited string.
    Hope this helps
    -Daur

  • Connecting to a database on a hosted site

    I have a mysql database on the site where my web page is hosted.
    I would like to write an application that sits on a users computer and allows them to send data to this database. Ther server has a firewall and its linux.
    How would anyone suggest I do this.
    How would I connect to the database ?
    Would I need JDBC?
    if so what would the connection look like ie
    connection con = DriverManager.getConnection( url, "mylogin", "thepassword");
    what would url =?
    look forward to hearing from you
    Gina1234

    I would like to write an application that sits on a
    users computer and allows them to send data to this
    database. Ther server has a firewall and its linux.
    How would anyone suggest I do this.
    How would I connect to the database ?I s'pose the JDBC code could be called from a server-side component (like servlet). This will prevent the users from requiring the driver JAR on their computers.
    Would I need JDBC?Yes.
    if so what would the connection look like ie
    connection con = DriverManager.getConnection( url,
    "mylogin", "thepassword");
    what would url =?Check the MySql driver documentation. A quick Google search would also give the connection URL.

  • Connecting to a database over the internet

    Hello ,
    Ok heres an interesting question -
    I would like to have an applet running on my browser which needs to connect to a central server over the internet, which in turn will need to connect to a database and query some results. These results will be stored as flat files within the server.
    At the moment, I have a URL that connects to the database via the
    internet and that is working. However I don't think my applet on my browser will be able to create a flat file on that server direclty.
    Could some one please tell me how to go about this problem?
    Shalini

    Yes, put a servlet in between the applet and database. Let the servlet interace with the database on the applet's behalf and write that file on the server side.
    %

  • Help with connection to mysql database, Getting error : No suitable Driver

    Below is my code :
    1) i have added the mysql driver (mm.mysql-2.0.14-bin.jar)in my classpath
    2) the code is getting compiling properly
    3) while running it using tomcat, it says "NO SUITABLE DRIVER"
    PLEASE HELP !!
    import java.io.*;
    import java.text.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class logincheck extends HttpServlet {
    public void doGet(HttpServletRequest request,HttpServletResponse response)
    throws IOException, ServletException
    Connection con = null;
    PrintWriter out = response.getWriter();
    response.setContentType("text/html");
    PreparedStatement stmt = null;
    ResultSet rs = null;
    String userid = request.getParameter("userid");
    String password = request.getParameter("password");
    try {
    /** LOADING THE DRIVER FOR MYSQL DATABASE ***/
    Class.forName ("org.gjt.mm.mysql.Driver";
    } catch (ClassNotFoundException e) {
    e.printStackTrace();
    } //End of try-catch 1
    try{
         /*** CONNECTING TO THE DATABASE USING DATABASE NAME, USERNAME AND PASSWORD */
    con = DriverManager.getConnection("jdbc:mysql://localhost:8080/own");
    /****** this checks whether the entry for the user is in the database *****/
    stmt = con.prepareStatement("SELECT *FROM userinfo WHERE userid = ? AND passwd = ?");
    stmt.setString(1,userid);
    stmt.setString(2,password);
    rs = stmt.executeQuery();
    if(!rs.next())
    else
         /****************** IF THE USER AND PASSWORD ARE VALID *****************/
    //} // END OF RS.....
    // NEED HTML FOR INVALID USERID SHOWING MESSAGE ...
    con.close();
    }catch(SQLException esql){
    System.out.println(esql.getMessage());
    } // End of try-catch 2
    } // goGet
    public void doPost(HttpServletRequest request,HttpServletResponse response)
    throws IOException, ServletException {
    doGet(request, response);
    } // goPost
    } // end logincheck function ...

    And i see another thing that confuses me. Your URL connection string is
    con = DriverManager.getConnection("jdbc:mysql://localhost:8080/own"); meaning that your database is in your machine and listens in port 8080 for incoming connections. But that is the default port that Tomcat listens! Maybe you should change this line to
    con = DriverManager.getConnection("jdbc:mysql://localhost:3306/own");where 3306 is MySQL's default port.
    Hope these help.

  • Connection to oracle database using jdbc

    i am using eclipse as editor.
    How to connect to the database?
    How to create a new table in oracle database through a servlet invoked
    program.
    My servlet receives input from an html page and then it can either do the above mentioned activities by itself or can invoke any other java class if necessary.

    This doesn't seem to have anything to do with JavaMail.
    You need to post this question to a more appropriate forum.

  • Unable to connect to the database through OEM

    Hi,
    ORACLE VERSION: 10.2.0.1.0
    OPERATING SYSTEM:LINUX
    I was unable to connect to my database through OEM.It is showing error like this in my OEM .
    Enterprise Manager is not able to connect to the database instance. The state of the components are listed below.
    The below is the list of errors written in the trace file .
    2009-07-13 14:55:18,351 [EMUI_14_55_18_/console/aboutApplication] ERROR em.console doGet.311 - java.lang.IllegalStateException: Response has already been committed
    java.lang.IllegalStateException: Response has already been committed
         at com.evermind.server.http.EvermindHttpServletResponse.resetBuffer(EvermindHttpServletResponse.java:1901)
         at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:211)
         at oracle.sysman.emSDK.svlt.PageHandler.render(PageHandler.java:773)
         at oracle.sysman.emSDK.svlt.PageHandler.handleRequest(PageHandler.java:396)
         at oracle.sysman.emSDK.svlt.EMServlet.myDoGet(EMServlet.java:688)
         at oracle.sysman.emSDK.svlt.EMServlet.doGet(EMServlet.java:291)
         at oracle.sysman.eml.app.Console.doGet(Console.java:135)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
         at oracle.sysman.emSDK.svlt.EMRedirectFilter.doFilter(EMRedirectFilter.java:101)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
         at oracle.sysman.db.adm.inst.HandleRepDownFilter.doFilter(HandleRepDownFilter.java:123)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:20)
         at oracle.sysman.eml.app.ContextInitFilter.doFilter(ContextInitFilter.java:239)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:600)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:793)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    2009-07-13 14:55:20,893 [HttpRequestHandler-25640626] ERROR conn.ConnectionService verifyRepositoryEx.433 - Invalid Connection Pool. ERROR = ORA-01017: invalid username/password; logon denied
    2009-07-13 14:55:20,925 [HttpRequestHandler-25640626] ERROR eml.OMSHandshake getParameterFromDB.402 - ORA-01017: invalid username/password; logon denied
    2009-07-13 14:55:20,926 [HttpRequestHandler-25640626] ERROR eml.OMSHandshake processFailure.619 - OMSHandshake failed.(AGENT URL = http://VTL3200DB:3938/emd/main)(ERROR = INTERNAL_ERROR)
    2009-07-13 14:55:20,959 [HttpRequestHandler-23946437] ERROR conn.ConnectionService verifyRepositoryEx.433 - Invalid Connection Pool. ERROR = ORA-01017: invalid username/password; logon denied
    2009-07-13 14:55:20,990 [HttpRequestHandler-23946437] ERROR eml.OMSHandshake getParameterFromDB.402 - ORA-01017: invalid username/password; logon denied
    2009-07-13 14:55:20,991 [HttpRequestHandler-23946437] ERROR eml.OMSHandshake processFailure.619 - OMSHandshake failed.(AGENT URL = http://VTL3200DB:3938/emd/main)(ERROR = INTERNAL_ERROR)
    2009-07-13 14:55:42,047 [OmsServiceDriver thread] ERROR conn.ConnectionService verifyRepositoryEx.433 - Invalid Connection Pool. ERROR = ORA-01017: invalid username/password; logon denied
    2009-07-13 14:55:51,030 [HttpRequestHandler-12767107] ERROR conn.ConnectionService verifyRepositoryEx.433 - Invalid Connection Pool. ERROR = ORA-01017: invalid username/password; logon denied
    2009-07-13 14:55:51,062 [HttpRequestHandler-12767107] ERROR eml.OMSHandshake getParameterFromDB.402 - ORA-01017: invalid username/password; logon denied
    2009-07-13 14:55:51,063 [HttpRequestHandler-12767107] ERROR eml.OMSHandshake processFailure.619 - OMSHandshake failed.(AGENT URL = http://VTL3200DB:3938/emd/main)(ERROR = INTERNAL_ERROR)
    2009-07-13 14:55:51,096 [HttpRequestHandler-28346522] ERROR conn.ConnectionService verifyRepositoryEx.433 - Invalid Connection Pool. ERROR = ORA-01017: invalid username/password; logon denied
    2009-07-13 14:55:51,127 [HttpRequestHandler-28346522] ERROR eml.OMSHandshake getParameterFromDB.402 - ORA-01017: invalid username/password; logon denied
    2009-07-13 14:55:51,127 [HttpRequestHandler-28346522] ERROR eml.OMSHandshake processFailure.619 - OMSHandshake failed.(AGENT URL = http://VTL3200DB:3938/emd/main)(ERROR = INTERNAL_ERROR)
    2009-07-13 14:56:21,162 [HttpRequestHandler-32110028] ERROR conn.ConnectionService verifyRepositoryEx.433 - Invalid Connection Pool. ERROR = ORA-01017: invalid username/password; logon denied
    2009-07-13 14:56:21,193 [HttpRequestHandler-32110028] ERROR eml.OMSHandshake getParameterFromDB.402 - ORA-01017: invalid username/password; logon denied
    2009-07-13 14:56:21,194 [HttpRequestHandler-32110028] ERROR eml.OMSHandshake processFailure.619 - OMSHandshake failed.(AGENT URL = http://VTL3200DB:3938/emd/main)(ERROR = INTERNAL_ERROR)
    2009-07-13 14:56:21,227 [HttpRequestHandler-12767107] ERROR conn.ConnectionService verifyRepositoryEx.433 - Invalid Connection Pool. ERROR = ORA-01017: invalid username/password; logon denied
    2009-07-13 14:56:21,258 [HttpRequestHandler-12767107] ERROR eml.OMSHandshake getParameterFromDB.402 - ORA-01017: invalid username/password; logon denied
    2009-07-13 14:56:21,259 [HttpRequestHandler-12767107] ERROR eml.OMSHandshake processFailure.619 - OMSHandshake failed.(AGENT URL = http://VTL3200DB:3938/emd/main)(ERROR = INTERNAL_ERROR)

    Invalid Connection Pool. ERROR = ORA-01017: invalid username/password; logon denied
    Don't say password is correct, if password is correct then tell us what last changes you did. did you change SYSMAN password throught alter user ...identified ... ?
    Regards,
    Taj

  • Servlet and Database access

    This is my first database program using servlet. Also I use ECS to create the HTML document.
    I accept data from a HTML page and display on the screen as well as writing to a TABLE (in instantDB)
    Do I have to have the database connection in INIT() method ?
    -------------Here's the code ---------------------------------------------------
    public class work2_db extends HttpServlet {
    public void doPost(HttpServletRequest request,
              HttpServletResponse response)
    throws ServletException, IOException {
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    String dbName = "db";
         String tableName = "survey";
         Connection conn = null;
         Statement stmt = null;
         System.out.print("\nLoading JDBC driver...\n\n");
         try {
         // InstantDB JDBC driver
         Class.forName("com.lutris.instantdb.jdbc.idbDriver");
         // MS Access, use default JDBC-ODBC driver
         // Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         } catch(ClassNotFoundException e) {
         e.printStackTrace();
         System.exit(1);
         try {
         System.out.print("Connecting to " + dbName + " database...\n\n");
         // InstantDB
         String url = "jdbc:idb:" + dbName;
         // InstantDB, specify the configuration file name in URL
         conn = DriverManager.getConnection(url + ".prp");
         // MS Access
         //conn = DriverManager.getConnection(url);
         System.out.println("Connected to and created database " + dbName);
         System.out.print("Accessing new " + tableName + " table...\n\n");
         stmt = conn.createStatement();
         } catch (SQLException se) {
         se.printStackTrace();
         System.exit(1);
    int id=0;
    //Go to the last record of the result set to get the next Survey ID
    String queryString = "SELECT * FROM " + tableName ;
         ResultSet rset = stmt.executeQuery(queryString);
         while (rset.next()) {
         id = rset.getInt("surveyid");
         id++; // This is the Survey ID for this new survey.
    rset.close();
    int service[] = {0,0,0,0,0,0};
    int level[] = {0,0,0,0,0};
    Body body = new Body();
    Html html = new Html()
    .addElement(new Head()
         .addElement(new Title("Survey Conformation")))
    .addElement(body);
    body.addElement(new H1("Thank you! Your Survey is accepted."));
    body.addElement(request.getParameter("salutation") + " " +
              request.getParameter("firstname") + " " +
              request.getParameter("lastname"))
    .addElement(new BR());
    body.addElement(request.getParameter("company"))
    .addElement(new BR());
    body.addElement(request.getParameter("street"))
    .addElement(new BR());
    body.addElement(request.getParameter("city") + " " +
              request.getParameter("state") + " " +
              request.getParameter("postal"))
    .addElement(new BR());
    body.addElement(request.getParameter("country"))
    .addElement(new BR());
    body.addElement("Email: " + request.getParameter("email"))
    .addElement(new BR())
    .addElement(new BR());
    body.addElement("You Travelled with us to : " +
              request.getParameter("destination"))
    .addElement(new BR());
    body.addElement("You used our following Services : ");
    body.addElement(new BR());
    String values[] = request.getParameterValues("service");
    if (values != null) {
    UL list = new UL();
    for (int i = 0; i < values.length; i++) {
         list.addElement(new LI(values));
         // setup category 1 feedback
         if (values[i] != null)
         service[i] = 1;
    body.addElement(list);
    body.addElement(new BR());
    body.addElement("Your satisfaction level : ");
         body.addElement(request.getParameter("level") + " " +
                   request.getParameter("good") + " " +
                   request.getParameter("better") + " " +
                   request.getParameter("best") + " " +
                   request.getParameter("very poor quality") + " " +
                   request.getParameter("none"))
    .addElement(new BR());
    body.addElement("You said we Can improve our Service as follows: " +
              request.getParameter("comments"));
    out.println(html.toString());
    //set up category level feed back
         if (request.getParameter("good") != null)
         level[1] = 1;
         else if (request.getParameter("better") != null)
         level[2] = 1;
         else if (request.getParameter("best") != null)
         level[3] = 1;
         else if (request.getParameter("very poor quality") != null)
         level[4] = 1;
         else if (request.getParameter("none") != null)
    level[5] = 1;
    //Now write the collected data into the database
    String insertString = "INSERT intO" + tableName+
    id + "," + service[1] + "," + service[2] + "," + service[3] + "," +
    + service[4] + "," + service[5] + "," + service[6] + "," +
    + level[1] + "," + level[2] + "," + level[3] + "," +
    + level[4] + "," + level[5] ;
    stmt.close();
    conn.close();
    -------------------------Compile Errors ---------------------------------------------------------------------------------
    I am getting following error for the exception handling. Can someone help me !!! PLEASE

    Hi JDKPSSH,
    Do I have to have the database connection in INIT() method ?not mandatory to have it in init() ( not INIT() ) method.
    I am getting following error for the exception handling. Can someone help me !!! PLEASE Check out by putting the following statements in try block
    stmt.close();
    conn.close();otherwise you get a compile time error.
    unreported exception java.sql.SQLException; must be caught or declared to be thrown
    Thanks,
    Sanath Kumar.

  • Servlet with Database Access!!!

    Hi !!!!
    I have deployed HelloServlet with Oracle Application Server 4.0.8.1.
    Now I want to connect from Servlet to Oracle8i 8.1.5.
    But, when I try to deploy a Servlet with Database Access, I receive the next:
    "Get operation not allowed"
    The URL used is:
    http://host.domain:port/virtual_path/class_name
    The servlet was compiled using the Sun's jdk from command line. There wasn't compilation errors.
    I run a simple application with database access from command line without problems.
    The drivers and JDBC libraries are operating for this simple application.
    Any help will be appreciated.
    Many thanks
    Sergio

    If you are running OAS 4.0.8.1 and Oracle 8.1.5 on the same machine then this could be the problem. These products are not certified to run on the same machine as they give a path conflict.
    Hope this helps.

Maybe you are looking for