Results 1 to 12 of 12
Like Tree1Likes
  • 1 Post By Tolls

Thread: java.sql.SQLException: Column 'dccyn' not found.

  1. #1
    Rasmeet is offline Member
    Join Date
    Apr 2012
    Posts
    6
    Rep Power
    0

    Post java.sql.SQLException: Column 'dccyn' not found.

    Hello,

    I have a problem...I have two servers (test & real)... I compiled my .java file & .class file is generated...
    There is no problem with the test server, the code works fine, I get the output as desired... but in the real server it gives me below error..
    java.sql.SQLException: Column 'dccyn' not found.

    Below is my code...

    sbQuery.append(" select ");
    sbQuery.append(" merchantno, krname ");
    sbQuery.append(", dccyn, mcpyn, mcayn, mpiyn ");
    sbQuery.append(" from ");
    sbQuery.append(" keb_merchant ");
    sbQuery.append("where pg='KP' ");

    pstmt = con.prepareStatement(sbQuery.toString());
    rs = pstmt.executeQuery();
    while(rs.next()){

    KEBLimitEntity entity = new KEBLimitEntity();

    entity.setMerchantNo(rs.getString("merchantno"));
    entity.setKrName(rs.getString("krname"));
    entity.setDccYN(rs.getString("dccyn"));
    entity.setMcpYN(rs.getString("mcpyn"));
    entity.setMcaYN(rs.getString("mcayn"));
    entity.setMpiYN(rs.getString("mpiyn"));

    entityList.add(entity);
    }
    rs.close();
    pstmt.close();
    }



    I have selected 'dccyn' in my query & also added it to the arrayList.

    Please somebody help me, Its urgent...
    Thanks in advance

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,407
    Rep Power
    20

    Default Re: java.sql.SQLException: Column 'dccyn' not found.

    BB Code List - Java Programming Forum

    Quote Originally Posted by Rasmeet View Post
    Its urgent...
    Really?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    12,089
    Rep Power
    20

    Default Re: java.sql.SQLException: Column 'dccyn' not found.

    You don't have a column 'dccyn' in the 'keb_merchant ' table.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  4. #4
    Rasmeet is offline Member
    Join Date
    Apr 2012
    Posts
    6
    Rep Power
    0

    Default Re: java.sql.SQLException: Column 'dccyn' not found.

    I do have a column 'dccyn' in my table... My site works perfectly with test database & server but it gives error for the real... cannot find why?

  5. #5
    Rasmeet is offline Member
    Join Date
    Apr 2012
    Posts
    6
    Rep Power
    0

    Default Re: java.sql.SQLException: Column 'dccyn' not found.

    Below is the table structure for the table 'keb_merchant'

    MERCHANTNO varchar(20) NO PRI
    KRNAME varchar(50) NO
    ENNAME varchar(50) NO
    APPRVCURRENCY char(3) NO
    SETTLEDCURRENCY char(3) NO
    REMITCURRENCY char(3) NO
    LIMITCURRENCY char(3) NO
    LIMITAMOUNT decimal(18,2) NO 0.00
    KSNETTID varchar(10) YES
    KICCTID varchar(10) YES
    SMARTROTID varchar(10) YES
    PG varchar(10) YES
    WORKERID varchar(20) NO
    REGDT datetime YES
    MODDT datetime YES
    MPIYN char(1) NO N
    DCCYN char(1) NO N
    MCPYN char(1) NO N
    MCAYN char(1) NO N

  6. #6
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    12,089
    Rep Power
    20

    Default Re: java.sql.SQLException: Column 'dccyn' not found.

    The table you are calling that SQL on does not have a 'dccyn' column.
    It's as simple as that.
    The table in your post above is not the table you are querying.
    It could be as simple as the executing code looking at the wrong database.

    Try running that code with the 'dccyn' column excluded.

    In fact, can you show us the stack trace as well?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  7. #7
    Rasmeet is offline Member
    Join Date
    Apr 2012
    Posts
    6
    Rep Power
    0

    Default Re: java.sql.SQLException: Column 'dccyn' not found.

    Tolls,

    Thank you for the reply...

    But I am very much sure that the table I am querying on & the table structure I posted above are the same tables...
    Secondly I tried running the query excluding 'dccyn'... My query now doesnt contains 'dccyn'. But it still gives the same error...

    Is the problem related to the server? Because I always try on test server & then upload my changes to real...but this time I am facing this problem...
    Before writing this query the field 'dccyn' was used in other queries also, & it worked fine...
    I cant understand what is the exact problem????

  8. #8
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    12,089
    Rep Power
    20

    Default Re: java.sql.SQLException: Column 'dccyn' not found.

    Show us the stack trace.
    Because if you only removed the 'dccyn' from the query, you;re still trying to read it here:
    Java Code:
    entity.setDccYN(rs.getString("dccyn"));
    which will throw a very similar exception.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  9. #9
    Rasmeet is offline Member
    Join Date
    Apr 2012
    Posts
    6
    Rep Power
    0

    Default Re: java.sql.SQLException: Column 'dccyn' not found.

    I tried to change the code little bit, I wrote a new function getList(String[], String) with the same query... Now I get different error...
    Below is my whole code....

    JSP Page : Where I call my function getList(String[], String)


    <%@ page import="java.util.*" %>
    <jsp:useBean id="limitDB" scope="page" class="com.eximbay.keblimit.KEBLimitDBWrap" />
    <jsp:setProperty name="limitDB" property="*"/>
    <%
    String modType = request.getParameter("modType");
    String[] merchantNo = request.getParameterValues("chkBox");

    ArrayList<KEBLimitEntity> entityList = limitDB.getList(merchantNo,"mod");

    %>


    KEBLimitDBWrap.java file :


    public ArrayList getList(String[] merchantNo,String type) throws AppException{
    ArrayList<KEBLimitEntity> entityList = new ArrayList<KEBLimitEntity>();
    Connection con = null;
    PreparedStatement pstmt = null;
    ResultSet rs = null;
    StringBuffer sbQuery = new StringBuffer();

    try{
    con = getConnection();

    sbQuery = new StringBuffer();

    if(type.equals("mod"))
    {
    sbQuery.append(" select ");
    sbQuery.append(" merchantno, krname, enname, apprvcurrency, settledcurrency, remitcurrency, limitcurrency, limitamount, ksnettid, kicctid, smartrotid ");
    sbQuery.append(" from ");
    sbQuery.append(" EXIMGW.keb_merchant ");
    sbQuery.append("where pg='KP' ");
    if((merchantNo != null) && (merchantNo.length > 0)){
    sbQuery.append(" and ");
    sbQuery.append(" merchantno in ( ");
    for(int i=0; i<merchantNo.length; i++){
    if(i>0) sbQuery.append(",");
    sbQuery.append("'"+merchantNo[i]+"'");
    }
    sbQuery.append(") ");
    }
    sbQuery.append(" order by merchantno ");

    pstmt = con.prepareStatement(sbQuery.toString());
    rs = pstmt.executeQuery();

    while(rs.next()){
    KEBLimitEntity entity = new KEBLimitEntity();

    entity.setMerchantNo(rs.getString("merchantno"));
    entity.setKrName(rs.getString("krname"));
    entity.setEnName(rs.getString("enname"));
    entity.setApprvCurrency(rs.getString("apprvcurrenc y"));
    entity.setSettledCurrency(rs.getString("settledcur rency"));
    entity.setRemitCurrency(rs.getString("remitcurrenc y"));
    entity.setLimitCurrency(rs.getString("limitcurrenc y"));
    entity.setLimitAmount(rs.getDouble("limitamount")) ;
    entity.setKsnetTid(AppUtil.checkNull(rs.getString( "ksnettid")));
    entity.setKiccTid(AppUtil.checkNull(rs.getString(" kicctid")));
    entity.setSmartroTid(AppUtil.checkNull(rs.getStrin g("smartrotid")));

    entityList.add(entity);
    }
    rs.close();
    pstmt.close();
    }
    }catch(SQLException e){
    System.out.println("[KEBLimitDBWrap::getList]SQLException : " + e);
    if(con != null) closeConnection(con);
    throw new AppException("SY02", e.toString(), "[KEBLimitDBWrap::getList]", "Your request is denied. Please contact us!!");
    }catch(Exception e){
    System.out.println("[KEBLimitDBWrap::getList]Exception : " + e);
    throw new AppException("SY01", e.toString(), "[KEBLimitDBWrap::getList]", "Your request is denied. Please contact us!!");
    }finally{
    try{
    if(rs != null) rs.close();
    if(pstmt != null) pstmt.close();
    if(con != null) freeConnection(con);
    }catch(Exception ie){}
    }

    return entityList;

    }


    And here is the stacktrace :

    An error occurred at line: 13 in the jsp file: /admin/system/keb_Modify.jsp
    The method getList(String[]) in the type KEBLimitDBWrap is not applicable for the arguments (String[], String)
    10: String modType = request.getParameter("modType");
    11: String[] merchantNo = request.getParameterValues("chkBox");
    12:
    13: ArrayList<KEBLimitEntity> entityList = limitDB.getList(merchantNo,"mod");
    14:
    15:

    Stacktrace:
    at org.apache.jasper.compiler.DefaultErrorHandler.jav acError(DefaultErrorHandler.java:95)
    at org.apache.jasper.compiler.ErrorDispatcher.javacEr ror(ErrorDispatcher.java:330)
    at org.apache.jasper.compiler.JDTCompiler.generateCla ss(JDTCompiler.java:457)
    at org.apache.jasper.compiler.Compiler.compile(Compil er.java:374)
    at org.apache.jasper.compiler.Compiler.compile(Compil er.java:352)
    at org.apache.jasper.compiler.Compiler.compile(Compil er.java:339)
    at org.apache.jasper.JspCompilationContext.compile(Js pCompilationContext.java:594)
    at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:344)
    at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:391)
    at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:334)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:722)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:304)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.ApplicationDispatcher.inv oke(ApplicationDispatcher.java:684)
    at org.apache.catalina.core.ApplicationDispatcher.pro cessRequest(ApplicationDispatcher.java:471)
    at org.apache.catalina.core.ApplicationDispatcher.doF orward(ApplicationDispatcher.java:402)
    at org.apache.catalina.core.ApplicationDispatcher.for ward(ApplicationDispatcher.java:329)
    at com.eximbay.InvokerServlet.doPost(InvokerServlet.j ava:64)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:641)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:722)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:304)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:240)
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:164)
    at org.apache.catalina.authenticator.AuthenticatorBas e.invoke(AuthenticatorBase.java:462)
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:164)
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:100)
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:395)
    at org.apache.coyote.ajp.AjpProcessor.process(AjpProc essor.java:301)
    at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHan dler.process(AjpProtocol.java:183)
    at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHan dler.process(AjpProtocol.java:169)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProce ssor.run(JIoEndpoint.java:302)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
    org.apache.jasper.JasperException: Unable to compile class for JSP:

    An error occurred at line: 13 in the jsp file: /admin/system/keb_Modify.jsp
    The method getList(String[]) in the type KEBLimitDBWrap is not applicable for the arguments (String[], String)
    10: String modType = request.getParameter("modType");
    11: String[] merchantNo = request.getParameterValues("chkBox");
    12:
    13: ArrayList<KEBLimitEntity> entityList = limitDB.getList(merchantNo,"mod");
    14:
    15:



    Stacktrace:
    at org.apache.jasper.compiler.DefaultErrorHandler.jav acError(DefaultErrorHandler.java:95)
    at org.apache.jasper.compiler.ErrorDispatcher.javacEr ror(ErrorDispatcher.java:330)
    at org.apache.jasper.compiler.JDTCompiler.generateCla ss(JDTCompiler.java:457)
    at org.apache.jasper.compiler.Compiler.compile(Compil er.java:374)
    at org.apache.jasper.compiler.Compiler.compile(Compil er.java:352)
    at org.apache.jasper.compiler.Compiler.compile(Compil er.java:339)
    at org.apache.jasper.JspCompilationContext.compile(Js pCompilationContext.java:594)
    at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:344)
    at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:391)
    at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:334)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:722)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:304)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.ApplicationDispatcher.inv oke(ApplicationDispatcher.java:684)
    at org.apache.catalina.core.ApplicationDispatcher.pro cessRequest(ApplicationDispatcher.java:471)
    at org.apache.catalina.core.ApplicationDispatcher.doF orward(ApplicationDispatcher.java:402)
    at org.apache.catalina.core.ApplicationDispatcher.for ward(ApplicationDispatcher.java:329)
    at com.eximbay.InvokerServlet.doPost(InvokerServlet.j ava:64)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:641)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:722)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:304)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:240)
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:164)
    at org.apache.catalina.authenticator.AuthenticatorBas e.invoke(AuthenticatorBase.java:462)
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:164)
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:100)
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:395)
    at org.apache.coyote.ajp.AjpProcessor.process(AjpProc essor.java:301)
    at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHan dler.process(AjpProtocol.java:183)
    at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHan dler.process(AjpProtocol.java:169)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProce ssor.run(JIoEndpoint.java:302)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
    2012. 4. 18 오후 6:48:45 org.apache.catalina.core.ApplicationDispatcher invoke
    심각: Servlet.service() for servlet jsp threw exception
    org.apache.jasper.JasperException: Unable to compile class for JSP:
    Last edited by Rasmeet; 04-19-2012 at 02:11 AM.

  10. #10
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,407
    Rep Power
    20

    Default Re: java.sql.SQLException: Column 'dccyn' not found.

    Quote Originally Posted by Rasmeet View Post
    // unformatted code //
    In the first response in this thread, I gave you a link to the forum FAQ page about code tags, which you should really have had the initiative to find for yourself. After being given the link, what excuse do you have for not reading the page and/or not using the code tags when posting your code?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  11. #11
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    12,089
    Rep Power
    20

    Default Re: java.sql.SQLException: Column 'dccyn' not found.

    That error implies your deployment isn't working.
    For whatever reason (and only you can check this) you are not deploying the latest version of your classes on the server.
    Rasmeet likes this.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  12. #12
    Rasmeet is offline Member
    Join Date
    Apr 2012
    Posts
    6
    Rep Power
    0

    Default Re: java.sql.SQLException: Column 'dccyn' not found.

    My problem is now solved, I restarted tomcat service... & now it works perfectly fine...

    Thanks Tolls, for your kind replies & help.

Similar Threads

  1. Replies: 16
    Last Post: 04-02-2012, 10:52 AM
  2. Replies: 5
    Last Post: 03-13-2012, 01:51 PM
  3. java.sql.SQLException: Invalid column name
    By agangaia in forum JDBC
    Replies: 7
    Last Post: 04-14-2011, 01:06 PM
  4. Replies: 2
    Last Post: 01-07-2011, 11:50 AM
  5. Replies: 1
    Last Post: 04-05-2010, 01:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •