Jdbc error in jspdynpage

hi
all,
i am trying connect sql server in my jspdynpage application
i got error like this
Portal Runtime Error
An exception occurred while processing a request for :
iView : jdbc.jdbcjspdyn
Component Name : jdbc.jdbcjspdyn
The exception was logged. Inform your system administrator..
Exception id: 12:13_15/05/07_0001_11442750
See the details for the exception ID in the log file
here i past my code
package com.sap;
     import java.sql.Connection;
     import java.sql.*;
     import com.sapportals.htmlb.page.*;
     import com.sapportals.portal.htmlb.page.*;
     import javax.servlet.*;
     import javax.servlet.http.HttpServletRequest;
     import com.sapportals.portal.prt.component.IPortalComponentRequest;
     public class jdbcjspdyn extends PageProcessorComponent {
          public DynPage getPage() {
               return new jdbcjspdynDynPage();
          public static class jdbcjspdynDynPage extends JSPDynPage {
               public void doInitialization() throws PageException {
                    IPortalComponentRequest request1 =
                         (IPortalComponentRequest) this.getRequest();
                    HttpServletRequest req = (HttpServletRequest) this.getRequest();
                    try {
                         Class.forName(
                              "com.sap.portals.jdbc.sqlserver.SQLServerDriver");
                         String url =
                              "jdbc:sap:sqlserver://10.2.2.74;DatabaseName=TRAINING";
                         Connection con = null;
                         con =
                              DriverManager.getConnection(
                                   url,
                                   "SPADURI",
                                   "netweaver");
                         Statement st = con.createStatement();
                         String sql =
                              "SELECT * FROM registration where fname='Pankaj'";
                         ResultSet rs = st.executeQuery(sql);
                         while (rs.next()) {
                              jdbcbean j = new jdbcbean();
                              j.setFname(rs.getString(1));
                              req.setAttribute("jdbcbean", j);
                    } catch (Exception e) {
                         System.out.println("Error" + e);
                    } finally {
               public void doProcessAfterInput() throws PageException {
               public void doProcessBeforeOutput() throws PageException {
                    this.setJspName("jdbcjsp.jsp");
my bean
package com.sap;
import java.sql.ResultSet;
import java.util.*;
import java.io.Serializable;
import com.sapportals.htmlb.table.DefaultTableViewModel;
//import com.sapportals.htmlb.table.TableView;
import com.sapportals.htmlb.table.TableViewModel;
public class jdbcbean implements Serializable
{     private String fname = "";
     private String lname = "";
     private String phoneNumber = "";
     private String message = "";
     public String getFname() {
          return fname;
     public String getLname() {
          return lname;
     public String getPhone() {
          return phoneNumber;
     public void setFname(String string) {
          fname = string;
     public void setLname(String string) {
          lname = string;
     public void setPhone(String string) {
          phoneNumber = string;
my jsp
  <%@ taglib uri= "tagLib" prefix="hbj" %>
<%@ page import="java.text.SimpleDateFormat" %>
<jsp:useBean id="jdbcbean" scope="session" class= "com.sap.jdbcbean" />
<hbj:content id="myContext" >
     <hbj:page>
          <hbj:form id="employeeInfoForm" >
          <%jdbcbean=(com.sap.jdbcbean)request.getAttribute("jdbcbean");%>
          <%jdbcbean.getLname();%>
          <%jdbcbean.getFname();%>
          <%jdbcbean.getPhone();%>
          </hbj:form>
     </hbj:page>
</hbj:content>

hi
lakshmikanth
i created jdbc system -
>
in that i specify the system alias  -
>\
through the system alias  connecting the database
here i past my code   see it
public class CJdbcDAO extends CDAO {
     private IConnection conn = null;
     public static String JDBC_SERVICE_ALIAS = "TJDBC";
     public CJdbcDAO(IPortalComponentRequest request) throws Exception {
          super(JDBC_SERVICE_ALIAS, request);
          storeConnection();
     public IConnection getConnection() throws Exception {
          if (conn == null) {
               storeConnection();
          return conn;
     public void releaseConnection() {
          if (conn != null) {
               try {
                    conn.close();
               } catch (ResourceException e) {
                    e.printStackTrace();
     private void storeConnection() throws Exception {
          try {
               IConnectorGatewayService service =
                    (IConnectorGatewayService) PortalRuntime
                         .getRuntimeResources()
                         .getService(
                         IConnectorService.KEY);
               if (service == null) {
                    throw new ConnectorException("Service not available in PortalRuntime");
               ConnectionProperties props =
                    new ConnectionProperties(
                         request.getLocale(),
                         request.getUser());
               conn = service.getConnection(serviceAlias, props);
          } catch (Exception e) {
               throw new Exception(e);

Similar Messages

  • ERROR reports.reportdefinition : com.crystaldecisions.reports.queryengine.driverImpl.m: JDBC Error: [Microsoft][ODBC Driver Manager] Invalid string or buffer length

    I have developed Java web application which uses Crystal Report 2013 , java 1.6 , Windows 32 bit System, All the reports are loading fine in the Following environment
    Development Environment
    Windows7 Professional Service pack 1 -32 bit
    Java - 1.6
    Internet Explorer 11
    Oracle Client 10g 32 bit ODBC driver
    Testing Environment
    Windows Server 2008 R2 Enterprise - 64 bit
    java 1.6
    Internet Explorer 9
    Oracle Client 11g 62 bit ODBC driver
    While loading reports in the 64 bit server the error occurs
    ERROR reports.reportdefinition :  com.crystaldecisions.reports.queryengine.driverImpl.m: JDBC Error: [Microsoft][ODBC Driver Manager] Invalid string or buffer length
    ERROR dataengine.datasource : Failed to read next recurring database record: database row set error.
    com.crystaldecisions.reports.reportdefinition.datainterface.j: JDBC Error: [Microsoft][ODBC Driver Manager] Invalid string or buffer length
        at com.crystaldecisions.reports.reportdefinition.datainterface.q.a(Unknown Source)
        at com.crystaldecisions.reports.dataengine.n.m(Unknown Source)
        at com.crystaldecisions.reports.dataengine.n.l(Unknown Source)
        at com.crystaldecisions.reports.dataengine.n.bn(Unknown Source)
        at com.crystaldecisions.reports.dataengine.n.bp(Unknown Source)
        at com.crystaldecisions.reports.dataengine.n.else(Unknown Source)
        at com.crystaldecisions.reports.dataengine.s.a(Unknown Source)
        at com.crystaldecisions.reports.dataengine.bk.a(Unknown Source)
        at com.crystaldecisions.reports.dataengine.bk.ab(Unknown Source)
        at com.crystaldecisions.reports.dataengine.bk.<init>(Unknown Source)
        at com.crystaldecisions.reports.dataengine.bk.if(Unknown Source)
        at com.crystaldecisions.reports.dataengine.bk.a(Unknown Source)
        at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.a(Unknown Source)
        at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.a(Unknown Source)
        at com.crystaldecisions.reports.formatter.formatter.objectformatter.be.a(Unknown Source)
        at com.crystaldecisions.reports.formatter.formatter.objectformatter.be.h(Unknown Source)
        at com.crystaldecisions.reports.formatter.formatter.objectformatter.i.h(Unknown Source)
        at com.crystaldecisions.reports.formatter.formatter.objectformatter.be.for(Unknown Source)
        at com.crystaldecisions.reports.formatter.formatter.objectformatter.bt.a(Unknown Source)
        at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.a(Unknown Source)
        at com.crystaldecisions.reports.formatter.formatter.objectformatter.bv.a(Unknown Source)
        at com.crystaldecisions.reports.formatter.formatter.objectformatter.bf.a(Unknown Source)
        at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.for(Unknown Source)
        at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.for(Unknown Source)
        at com.crystaldecisions.reports.formatter.formatter.objectformatter.b3.for(Unknown Source)
        at com.crystaldecisions.reports.formatter.formatter.objectformatter.bt.a(Unknown Source)
        at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.a(Unknown Source)
        at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.a(Unknown Source)
        at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.a(Unknown Source)
        at com.crystaldecisions.reports.formatter.formatter.objectformatter.ca.a(Unknown Source)
        at com.crystaldecisions.reports.formatter.formatter.objectformatter.a9.a(Unknown Source)
        at com.crystaldecisions.reports.formatter.formatter.e.m.a(Unknown Source)
        at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.for(Unknown Source)
        at com.crystaldecisions.reports.formatter.formatter.objectformatter.cd.for(Unknown Source)
        at com.crystaldecisions.reports.formatter.formatter.objectformatter.b3.for(Unknown Source)
        at com.crystaldecisions.reports.formatter.formatter.e.m.for(Unknown Source)
        at com.crystaldecisions.reports.formatter.formatter.objectformatter.bt.a(Unknown Source)
        at com.crystaldecisions.reports.formatter.formatter.e.p.l(Unknown Source)
        at com.crystaldecisions.reports.formatter.formatter.e.p.void(Unknown Source)
        at com.crystaldecisions.reports.formatter.formatter.e.p.l(Unknown Source)
        at com.crystaldecisions.reports.formatter.formatter.e.p.aE(Unknown Source)
        at com.crystaldecisions.reports.formatter.a.c.a(Unknown Source)
        at com.crystaldecisions.reports.formatter.a.c.if(Unknown Source)
        at com.crystaldecisions.reports.formatter.a.c.a(Unknown Source)
        at com.businessobjects.reports.sdk.b.b.int(Unknown Source)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
        at com.crystaldecisions.proxy.remoteagent.x.a(Unknown Source)
        at com.crystaldecisions.proxy.remoteagent.q.a(Unknown Source)
        at com.crystaldecisions.sdk.occa.report.application.dd.a(Unknown Source)
        at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
        at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
        at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
        at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
        at com.crystaldecisions.reports.sdk.PrintOutputController.export(Unknown Source)
        at com.erm.controller.ALMReportsController.queryDll(ALMReportsController.java:1681)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:471)
        at org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:408)
        at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
        at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936)
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:838)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.erm.authentication.HttpSecurityFilter.doFilter(HttpSecurityFilter.java:658)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        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:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Unknown Source)
    Caused by: com.crystaldecisions.reports.queryengine.driverImpl.m: JDBC Error: [Microsoft][ODBC Driver Manager] Invalid string or buffer length
        at com.crystaldecisions.reports.queryengine.driverImpl.o.if(Unknown Source)
        at com.crystaldecisions.reports.queryengine.ap.if(Unknown Source)
        at com.crystaldecisions.reports.queryengine.l.bN(Unknown Source)
        at com.crystaldecisions.reports.queryengine.ap.eg(Unknown Source)
        at com.crystaldecisions.reports.queryengine.ap.e(Unknown Source)
        at com.crystaldecisions.reports.queryengine.b2.f(Unknown Source)
        at com.crystaldecisions.reports.queryengine.b2.dy(Unknown Source)
        ... 89 more
    Caused by: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid string or buffer length
        at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
        at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
        at sun.jdbc.odbc.JdbcOdbc.SQLGetDataString(Unknown Source)
        at sun.jdbc.odbc.JdbcOdbcResultSet.getDataString(Unknown Source)
        at sun.jdbc.odbc.JdbcOdbcResultSet.getBigDecimal(Unknown Source)

    A few things to note:
    1) Crystal Report 2013 doe snot install any SDK. Thus the assumption is that you are using CR from teh following link:
    SAP BusinessObjects - SAP Crystal Reports, Version For Eclipse Download
    2) Since you are using a 64 bit connection (Oracle Client 11g 62 bit ODBC driver) you will have to make sure you are using 64 bit JVM. Otherwise, follow Dell's advice and use a 32 bit ODBC datasource.
    3) On one test you are using Oracle Client 10g 32 bit ODBC driver and the other you are using Oracle Client 11g 64 bit ODBC driver. You might want to see if you can run your app using Client 11g 32 bit ODBC driver.
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada

  • Sender JDBC Error

    Hi,
    i am using XI7.0, Sender JDBC error is below;
    when i test to connect to Oracle DB in using JAVA Code with ojdbc14.jar which was deployed into XI J2EE, i have no problem with insert update delete in using same code which was used in JDBC adapter in Configuration Time.
    but JDBC Adapter on XI(JDBC2JDBC) is not running as well.
    please look at the following and please guide.
    JDBC Driver : oracle.jdbc.driver.OracleDriver
    connection : jdbc:oracle:thin:@60.7.111.211:1577:AACC
    S_SSS_MMM_JDBC_MDMALL001CU Sender Adapter v1402 for Party '', Service 'SSS_BS01_TESTBS01_D':
    Configured at 12:29:23 2006-07-10
    Last message processing started 12:29:55 2006-07-10
    Error: Sending message '4299fec0-0fb4-11db-c508-000d604dde82' - failed with unexpected exception - proceed anyway: java.lang.ClassCastException: $Proxy222
    last retry interval started 12:29:55 2006-07-10
    length 10,000 secs
    does anyone know how to fix it?
    thanks
    venjamin

    Hi Venjamin,
    Just try the follwing,
    1. The Select Query in your Sender JDBC adapter. Try executing the same query on your DB client and check if it works fine and the data returned by it is of valid format?
    2. Is any of the datatype being returned a CLOB or BLOB?
    Regards,
    Bhavesh

  • Intermittent JDBC error in Enhanced Receiver Determination

    Hi,
    I have an interface that use Enhanced Receiver Determination in PI 7.1 EHP1.
    The database is DB2 on i5/os 6.1
    Sometimes message ends in error :Error when determining the receiver: Problem while determining receivers using interface mapping: Runtime exception occurred during application mapping com/sap/xi/tf/_HI01_to_ReceiverDetermination_;
    But the same message with same values is successfull earlier.
    This is not a design problem; the interface is working well 95% of the time.
    I found some JDBC error in NWA java logs:
    Error in sax handler parsing request: Error when executing statement for table/stored proc. 'table' (structure 'statement'): java.sql.SQLException: [SQL0104] Token "BUSINESS_SYSTEM" was not valid. Valid tokens: FOR SKIP WITH FETCH ORDER UNION EXCEPT OPTIMIZE.
    Error when calling an adapter by using the communication channel CC_RECEIVER_JDBC_PIDB2 (Party: *, Service: INTEGRATION_SERVER_PX1, Object ID: cb7ea38fb2ac3a06b12d79f5ade2bcf7) XI AF API call failed. Module exception: (No information available). Cause Exception: 'Error processing request in sax parser: Error when executing statement for table/stored proc. 'table' (structure 'statement'): java.sql.SQLException: [SQL0104] Token "BUSINESS_SYSTEM" was not valid. Valid tokens: FOR SKIP WITH FETCH ORDER UNION EXCEPT OPTIMIZE.'.
    Thrown:
    com.sap.aii.af.service.api.AFException: XI AF API call failed. Module exception: (No information available). Cause Exception: 'Error processing request in sax parser: Error when executing statement for table/stored proc. 'table' (structure 'statement'): java.sql.SQLException: [SQL0104] Token "BUSINESS_SYSTEM" was not valid. Valid tokens: FOR SKIP WITH FETCH ORDER UNION EXCEPT OPTIMIZE.'.
    at com.sap.aii.af.service.api.AdapterAccess.sendMsg(AdapterAccess.java:214)
    at com.sap.aii.af.service.api.AdapterAccess.execute(AdapterAccess.java:283)
    at com.sap.aii.ibrun.server.lookup.AdapterProxyLocal.execute(AdapterProxyLocal.java:119)
    at com.sap.aii.ibrun.server.lookup.SystemAccessorInternal.execute(SystemAccessorInternal.java:76)
    at com.sap.aii.mapping.lookup.DataBaseAccessor.execute(DataBaseAccessor.java:74)
    at com.sap.aii.mappingtool.flib7.SelectSingle.selectSingle(SelectSingle.java:54)
    at sun.reflect.GeneratedMethodAccessor607.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:592)
    Any idea? Can high volume cause the JDBC Receiver to fail?
    Martin

    hi,
    you r trying to impliment Lookup for the file adapter which is not synch in nature and hance u r not getting the responce back.
    please find the link which deals with how to impliment lookup for file adapter.
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/file%252blookup%252bin%252budf.
    now once u get rhe runtime receiver u can perform enhanced receiver determination (write a simple UDF)
    regards,
    navneet.

  • SQL Server 2000 Driver for JDBC - Error establishing sockets

    Hi there
    I am using Microsoft SQL Server 2000 Driver for JDBC to connect to SQL Sever 2000. It is just a test application to see if it would connect to the datacase successfully. But I got the following errors. I already set up the classpath and installed all SQL Server 2000 Driver for JDBC sp 3. Dont know why it still failed...can anyone help me out of this? Thanks.
    When i am using simple JDBC-ODBC bridge Driver it's working fine.
    For this Server Pack3 , i have checked every thing like--
    TCP / IP Poart is Enable.
    I am working in client machine, my MSSQLServer 2000 Placed in server Machine.
    when i am giving Telnet ServerIP 1433 it's giving following response.
    connecting to ServerIP ....... could not open connection to the host , on port 1433:connection Failed
    My Sample Code is :--
    String user="sa";
    String password="imcindia";
    Connection con1 = null;
    CallableStatement cstmt = null;
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
    con1=DriverManager.getConnection("jdbc:microsoft:sqlserver://ServerName:1433;DatabaseName=dmo1o2d",user,password);
    Statement st=con1.createStatement();
    st.execute("use dm0102d");
    st.execute("setuser 'dm01012'");
    cstmt = con1.prepareCall("{?=Call dms_ex_create_folder('ABC','18753','NB21','u')}");
    cstmt.execute();
    Here are Error Code :
    java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
         at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
         at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
         at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
         at com.microsoft.jdbc.sqlserver.tds.TDSConnection.<init>(Unknown Source)
         at com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown Source)
         at com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown Source)
         at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source)
         at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
         at java.sql.DriverManager.getConnection(Unknown Source)
    java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Connection refused: connect
         at java.sql.DriverManager.getConnection(Unknown Source)
         at TestConnection1.main(TestConnection1.java:24)
    one can help me to over come this problm,
    Thanks in advance.
    venkat

    hey i also have this problem i have been looking for solution for this problem for along time i tried every possible solution i tried every service pack for the SQL but it didn't connect to the port!!!
    it's a network problem ur java code is correct dont worry about it.
    finally i had to install MySQL and it's work fine now but if u insist on usning SQL u have to use the JDBC-ODBC Bridge it will work by :
    first add data source database , follow these steps
    1- go to Administrative tools
    2-Data Sources(ODBC)
    3-System DNS tab and add then choose SQL SERVER the last option then finish
    4-write the name; Note: this name is the one that u will write in ur URL for example if u write Hello the URL will be "jdbc:odbc:Hello"
    5- choose the server, its recommended to write "." or (local)
    6-change the database to its an important step to choose the database that u want to use, choose northwind if u want to use it
    finish
    second
    adding this code:
    import java.sql.*;
    class JdbcTest1 { 
    public static void main (String[] args) { 
    try { 
    // Step 1: Load the JDBC driver.
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    // Step 2: Establish the connection to the database.
    String url = "jdbc:odbc:Hello";
    Connection conn = DriverManager.getConnection(url,"user1","password");
    } catch (Exception e) { 
    System.err.println("Got an exception! ");
    System.err.println(e.getMessage());
    it will work without any problems

  • JDBC error in PreparedStatement using TimesTen 6.0.3

    TimesTen supports this kind of sql statement
    select rows 3 to 5 * from products
    (it returns 2 rows started from row #3)
    I want to implement this in java thru JDBC
    PreparedStatement pstmt = con.prepareStatement(select rows ? to ? * from products);
    pstmt.setInt(1,3);
    pstmt.setInt(2,2);
    However, I got a JDBC error in the PreparedStatement line
    java.sql.SQLException: [TimesTen][TimesTen 6.0.3 ODBC Driver][TimesTen]TT1001: Syntax error in SQL statement before or at: "?", character position: 13 -- file "ptSqlY.y", lineno 1955, procedure "sbPtParseSql()"
    Anyone encounter this kind of error before? How to solve it?
    Thanks!
    Wellwin
    P.S. I am running this in Linux platform with JDBC driver come with TimesTen for java 1.4

    Hi Wellwin,
    Using SELECT ROWS m to n, you cannot parameterise m or n in order to provide them at execution time. They have to be explicitly stated as literals in the statement…
    If you need to use this with several different values for ‘m’ and ‘n’, there are a couple of options:
    1) Prepare (and subsequently execute) a different prepared statement for each combination of ‘m’ and ‘n’ that you need. This may be fine if there are only a small number of combinations but not a good choice if there are many combinations.
    2) Just use a regular SELECT (without the ROWS m TO n clause) and ‘skip’ the rows in the application code.
    Simon

  • IDOC to JDBC :Error using JDBC

    Hi Frnds,
    My scenario is Idoc to JDBC scenario, I am getting the follwoing error while trying to process an idoc. Please help me in hadling this error.
    Error Message:
    JDBC message processing failed; reason Error when attempting to get processing resources: com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: DriverManagerException: Cannot establish connection to URL 'jdbc:microsoft:sqlserver://180.1.32.194:1433;DatabaseName=CZZ03;': SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
    Regards,
    Shiv

    Hello Shiva,
    Are you installed  JDBC Drivers?
    Go through this links,
    /people/varadharajan.krishnasamy/blog/2007/02/27/configuring-jdbc-connector-service-to-perform-database-lookups
    http://searchsap.techtarget.com/tip/0,289483,sid21_gci1246926,00.html
    To install JDBC driver follow the how to guide.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi-how-to-guides/how%20to%20install%20and%20configure%20external%20drivers%20for%20jdbc%20and%20jms%20adapters.pdf
    Configuration of JDBC Adapter for SQL Server
    JDBC Driver = com.microsoft.jdbc.sqlserver.SQLServerDriver
    Connection = jdbc:microsoft:sqlserver://hostname:<port>;DatabaseName=<DBName>
    UserID and Password.
    If the connection is not working find the correct port number.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40b92770-db81-2a10-8e91-f747188d8033
    JDBC- X I -  R/3 Scenario
    /people/bhavesh.kantilal/blog/2006/07/03/jdbc-receiver-adapter--synchronous-select-150-step-by-step
    /people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30
    Please check the driver path as mentioned below.
    JDBC Driver : sun.jdbc.odbc.JdbcOdbcDriver
    Connection:jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=//location of DB table.mdb;
    No JDBC driver required.
    Receiver JDBC scenario MS access - /people/sameer.shadab/blog/2005/10/24/connecting-to-ms-access-using-receiver-jdbc-adapter-without-dsn
    follow this thread
    Re: Problem when connecting to MS Access through JDBC Adapter.
    SAP Note 850116 has details
    Thanks,
    Satya Kumar
    Reward if it is usefulll

  • NEED HELP: JDBC ERROR

    I get this error when I try to connect my applet through JDBC:
    Error null: Unexpected Packet. Type = 0
    I have punch a hole on my firewall to allow my jdbc thin to hit
    directly to oracle database.
    If you have an answer for my problem, please email me at
    [email protected]
    Thanks a bunch,
    -ed-
    null

    Hi ,
    Use following String
    http://<Hostname>:<PortNo>/ftpjdbc
    This can be used to check whether FTP and JDBC Drivers are properly deployed and connection can be done or not.
    Select JDBC . Then   :
    Driver Class (fully qualified)  : com.microsoft.sqlserver.jdbc.SQLServerDriver
    JDBC URL : jdbc:sqlserver://255.255.255.255:8888;databasename=Dummy
    USERNAME : DUMMY
    PASSWORD : DUMMY
    and enter valid values and then press connect
    Then In response you will see connection will be established and then closed , any else response means there is some problem...
    Regards
    Prabhat Sharma.

  • JDBC error

    I have been getting this error in my Jdeveloper App.
    ORA-01000 : maximum open cursors exceeded.
    We have open cursors set at 220. I am using straight JDBC thin
    to call the database (8.1.5) and have been closing ResultSets
    the best I can. It happens after I use the app for a little bit.
    Any suggestions on what is causing this.
    PS
    This is a test database and I am the only one on it.
    Thanks
    Greg
    null

    Greg (guest) wrote:
    : I have been getting this error in my Jdeveloper App.
    : ORA-01000 : maximum open cursors exceeded.
    : We have open cursors set at 220. I am using straight JDBC thin
    : to call the database (8.1.5) and have been closing ResultSets
    : the best I can. It happens after I use the app for a little
    bit.
    : Any suggestions on what is causing this.
    : PS
    : This is a test database and I am the only one on it.
    : Thanks
    : Greg
    Greg - make sure that your statement object is being closed too.
    I had a similar occurance that was pretty frustrating. Then I
    realize the my statement object was being reused, and this
    wasn't good. I forced the object to close after each db action,
    and upon reuse all was fine.
    Good luck -
    RP
    null

  • JDBC Error in allocating a connection

    Hi,
    I am trying to use an outbound jdbc eway to do a select, but the connection is not being established
    Here is the log error,
    java.sql.SQLException: Error in allocating a connection. Cause: com.microsoft.sqlserver.jdbc.SQLServerDriver
    And here are the config settings from the log
    setPortNumber = [1433]
    setUser = [sa]
    setServerName = [localhost]
    setPassword = [xxxxx]
    setDriverProperties = [setURL#jdbc:sqlserver://localhost:1433;databaseName=eamh;]
    setDatabaseName = [eamh]
    setClassName = [com.microsoft.sqlserver.jdbc.SQLServerDriver]
    Any idea what is wrong?
    Rupert

    The driver classname is not correct. You need to use com.SeeBeyond.sqlserver.jdbc.sqlserver.SQLServerDataSource.
    Let me know if this works.
    Cheers,
    Mac.

  • JDev 10.1.3 OC4J JDBC Error

    I'm having a problem running an application in JDev10.1.3 when mapping an oracle object to a java object.
    The error occuring is "java.lang.ClassCastException: oracle_oc4j_sql_proxy_SQLBCELProxy_tuinsurance_lib_ejb_PolicyRate__BCELProxy"
    This error only happens when i'm using Datasources retrieved through JNDI. If i use oracle.jdbc.DriverManager to instantiate a sql connection i have NO problem.
    Only when i look up a datasource do i have this problem with mapping oracle objects to java objects. Note this has worked in earlier version of JDeveloper (9.0.5.2) with JDBC 2.0.
    Does this have to do with Drivers or javax.sql.Datasource class in JDK1.4 ???
    Has anyone had this problem ? Any JDBC or JDev experts who can help me out on this one ?
    Thanks in advance
    Gurinder

    Here is a boat-load of system info for the error message posted by Eric Everman:
    java.class.version     48.0
    java.endorsed.dirs     C:\j2sdk1.4.2_06\jre\lib\endorsed
    java.ext.dirs     C:\j2sdk1.4.2_06\jre\lib\ext
    java.home     C:\j2sdk1.4.2_06\jre
    java.io.tmpdir     C:\DOCUME~1\eeverman\LOCALS~1\Temp\
    java.library.path     
    * C:\j2sdk1.4.2_06\bin
    * C:\WINDOWS\System32
    * C:\WINDOWS
    * C:\j2sdk1.4.2_06\bin
    * d:\oracle\oraids2\bin
    * d:\oracle\oraids2\jlib
    * d:\oracle\ora92\bin
    * C:\WINDOWS\system32
    * C:\WINDOWS
    * C:\WINDOWS\System32\Wbem
    * C:\Program Files\Common Files\Adaptec Shared\System
    * C:\Program Files\Reflection\
    * C:\Program Files\Executive Software\Diskeeper\
    java.naming.factory.initial     com.evermind.server.ApplicationInitialContextFactory
    java.naming.factory.url.pkgs     oracle.oc4j.naming.url
    java.net.preferIPv4Stack     true
    java.protocol.handler.pkgs     com.evermind.protocol
    java.runtime.name     Java(TM) 2 Runtime Environment, Standard Edition
    java.runtime.version     1.4.2_06-b03
    java.specification.name     Java Platform API Specification
    java.specification.vendor     Sun Microsystems Inc.
    java.specification.version     1.4
    java.util.prefs.PreferencesFactory     java.util.prefs.WindowsPreferencesFactory
    java.vendor     Sun Microsystems Inc.
    java.vendor.url     http://java.sun.com/
    java.vendor.url.bug     http://java.sun.com/cgi-bin/bugreport.cgi
    java.version     1.4.2_06
    java.vm.info     mixed mode
    java.vm.name     Java HotSpot(TM) Client VM
    java.vm.specification.name     Java Virtual Machine Specification
    java.vm.specification.vendor     Sun Microsystems Inc.
    java.vm.specification.version     1.0
    java.vm.vendor     Sun Microsystems Inc.
    java.vm.version     1.4.2_06-b03
    javax.management.builder.initial     oracle.oc4j.admin.jmx.server.Oc4jMBeanServerBuilder
    javax.rmi.CORBA.PortableRemoteObjectClass     com.sun.corba.ee.impl.javax.rmi.PortableRemoteObject
    javax.rmi.CORBA.StubClass     com.sun.corba.ee.impl.javax.rmi.CORBA.StubDelegateImpl
    javax.rmi.CORBA.UtilClass     com.sun.corba.ee.impl.javax.rmi.CORBA.Util
    line.separator     
    oc4j.jms.usePersistenceLockFiles     false
    oracle.dms.sensors     NONE
    oracle.home     D:\Program Files\jdev10.1.3
    oracle.j2ee.container.name     Oracle Containers for J2EE 10g (10.1.3.0.0) - Developer Preview 3
    oracle.j2ee.container.version     10.1.3.0.0
    oracle.j2ee.dont.use.memory.archive     true
    oracle.j2ee.home     D:\Program Files\jdev10.1.3\jdev\system\oracle.j2ee.10.1.3.3.51
    oracle.j2ee.http.socket.timeout     500
    oracle.security.jazn.config     D:\Program Files\jdev10.1.3\jdev\system\oracle.j2ee.10.1.3.3.51\oc4j-config\jazn.xml
    org.apache.commons.logging.Log     org.apache.commons.logging.impl.SimpleLog
    org.apache.commons.logging.simplelog.defaultlog     info
    org.apache.tapestry.disable-caching     true
    org.omg.CORBA.ORBClass     com.sun.corba.ee.impl.orb.ORBImpl
    org.omg.PortableInterceptor.ORBInitializerClass.oracle.oc4j.corba.iiop.server.IIOPInitializer     NO_VALUE
    os.arch     x86
    os.name     Windows XP
    os.version     5.1
    path.separator     ;
    sun.arch.data.model     32
    sun.boot.class.path     
    * C:\j2sdk1.4.2_06\jre\lib\endorsed\bsf.jar
    * C:\j2sdk1.4.2_06\jre\lib\endorsed\xalan.jar
    * C:\j2sdk1.4.2_06\jre\lib\endorsed\xercesImpl.jar
    * C:\j2sdk1.4.2_06\jre\lib\endorsed\xml-apis.jar
    * C:\j2sdk1.4.2_06\jre\lib\rt.jar
    * ....[clipped]
    sun.boot.library.path     C:\j2sdk1.4.2_06\jre\bin
    sun.cpu.endian     little
    sun.cpu.isalist     pentium i486 i386
    sun.io.unicode.encoding     UnicodeLittle
    sun.os.patch.level     Service Pack 1
    user.country     US
    user.dir     D:\Program Files\jdev10.1.3\jdev\system\oracle.j2ee.10.1.3.3.51\oc4j-config

  • BI Publisher and TomCat JDBC error

    Hey Folks,
    I have BI Pulbisher up and running in a cluster mode on a Solaris box with a shared folder such as (/u01/app/BI_Publisher/xmlp) as the file path in WEB-INF\xmlp-server-congfig.xml. All my reports and XMLP configuration folders are stored in that directory (ie. Admin, DemoFiles, Reports, Tools etc..). BI Publisher is up and running under the tomcat user id.
    My OBIEE directory is contained in /opt/oracle/app/OracleBI....
    Now when I deployed the xmlpserver.war file and configure my connections, everything was working properly.
    Now I see the following exception being thrown in the tomcat logs. This error msgs are inserted to the logs every second and it will fill up the log file in a matter of hours which makes the BI Publisher go down.
    I have to erase the logs and re-cycle the tomcat server and everything is fine again, but these msgs keep filling up the logs.
    How can i solve this issue of "Cannot load JDBC driver class 'oracle.jdbc.OracleDriver'"?
    Cannot load JDBC driver class 'oracle.jdbc.OracleDriver'
    java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1352)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:164)
         at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:730)
         at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:518)
         at org.quartz.utils.PoolingConnectionProvider.getConnection(PoolingConnectionProvider.java:172)
         at org.quartz.utils.DBConnectionManager.getConnection(DBConnectionManager.java:111)
         at org.quartz.impl.jdbcjobstore.JobStoreSupport.getConnection(JobStoreSupport.java:553)
         at org.quartz.impl.jdbcjobstore.JobStoreTX.doCheckin(JobStoreTX.java:1321)
         at org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager.manage(JobStoreSupport.java:2338)
         at org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager.run(JobStoreSupport.java:2369)
    Cannot load JDBC driver class 'oracle.jdbc.OracleDriver'
    java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1352)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:164)
         at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:730)
         at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:518)
         at org.quartz.utils.PoolingConnectionProvider.getConnection(PoolingConnectionProvider.java:172)
         at org.quartz.utils.DBConnectionManager.getConnection(DBConnectionManager.java:111)
         at org.quartz.impl.jdbcjobstore.JobStoreSupport.getConnection(JobStoreSupport.java:553)
         at org.quartz.impl.jdbcjobstore.JobStoreTX.doCheckin(JobStoreTX.java:1321)
         at org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager.manage(JobStoreSupport.java:2338)
         at org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager.run(JobStoreSupport.java:2369)
    Cannot load JDBC driver class 'oracle.jdbc.OracleDriver'
    java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1352)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:164)
         at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:730)
         at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:518)
         at org.quartz.utils.PoolingConnectionProvider.getConnection(PoolingConnectionProvider.java:172)
         at org.quartz.utils.DBConnectionManager.getConnection(DBConnectionManager.java:111)
         at org.quartz.impl.jdbcjobstore.JobStoreSupport.getConnection(JobStoreSupport.java:553)
         at org.quartz.impl.jdbcjobstore.JobStoreTX.doCheckin(JobStoreTX.java:1321)
         at org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager.manage(JobStoreSupport.java:2338)
         at org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager.run(JobStoreSupport.java:2369)
    Cannot load JDBC driver class 'oracle.jdbc.OracleDriver'
    java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1352)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:164)
         at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:730)
         at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:518)
         at org.quartz.utils.PoolingConnectionProvider.getConnection(PoolingConnectionProvider.java:172)
         at org.quartz.utils.DBConnectionManager.getConnection(DBConnectionManager.java:111)
         at org.quartz.impl.jdbcjobstore.JobStoreSupport.getConnection(JobStoreSupport.java:553)
         at org.quartz.impl.jdbcjobstore.JobStoreTX.doCheckin- ClusterManager: Error managing cluster: Failed to obtain DB connection from data source 'myDS': org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'oracle.jdbc.OracleDriver', cause: oracle.jdbc.OracleDriver
    org.quartz.JobPersistenceException: Failed to obtain DB connection from data source 'myDS': org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'oracle.jdbc.OracleDriver', cause: oracle.jdbc.OracleDriver [See nested exception: org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'oracle.jdbc.OracleDriver', cause: oracle.jdbc.OracleDriver]
         at org.quartz.impl.jdbcjobstore.JobStoreSupport.getConnection(JobStoreSupport.java:570)
         at org.quartz.impl.jdbcjobstore.JobStoreTX.doCheckin(JobStoreTX.java:1321)
         at org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager.manage(JobStoreSupport.java:2338)
         at org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager.run(JobStoreSupport.java:2369)

    setpath for the bijdbc.jarfor OBIEE and ojdbc.jar for Oracle DB file .
    that should resolve this library not found error.

  • Regarding JDBC Error

    Hi Friends,
                   I got the error while doing jdbc scenario using java mapping.i got the following error "Error while parsing or executing XML-SQL document: ERROR occured parsing request:com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XML Declaration not allowed here.(:main:, row:1, col:65)(:main:, row=1, col=65) -> com.sap.engine.lib.xml.parser.ParserException: XML Declaration not allowed here.(:main:, row:1, col:65)".
    please help me on this error.

    sender is file and receiver is jdbc.
    my input file looks like:
    <?xml version="1.0" encoding="UTF-8"?><ns0:SENDER_MSG_TYPE xmlns:ns0="http://FILE2JDBC_US">   <ORGANISATION>MICROSOFT</ORGANISATION>   <FIRSTNAME>KUMAR</FIRSTNAME>   <LASTNAME>RAJESH</LASTNAME>   <STREET>DALAL</STREET>   <CITY>MUMBAI</CITY>   <STATE>MAHARASTHRA</STATE>   <ZIP>430002</ZIP>   <PHONE>3187321</PHONE>   <FAX>145965</FAX>   <ORDERNUMBER>4569</ORDERNUMBER>   <POTYPE>OPEN</POTYPE>   <ORDERDELIVERYDATE>14041970</ORDERDELIVERYDATE>   <ORDERSTATUS>DELIVERED</ORDERSTATUS>   <BANKNAME>SBI</BANKNAME>   <ACCOUNTNUMBER>123659874</ACCOUNTNUMBER>   <BRANCHCODE>345</BRANCHCODE>   <PAYMENTTYPE>CASH</PAYMENTTYPE>   <CURRENCY>INR</CURRENCY>   <PARTNERNAME>IBM</PARTNERNAME>   <QUANTITY>TONNE</QUANTITY></ns0:SENDER_MSG_TYPE>
    i need the output to be inserted in to asingle field in the database as a string/blob/clob.
    and my output looks like.
    <?xml version="1.0" encoding="UTF-8"?><ns0: RECEIVER_MSG_TYPE xmlns:ns0="http://FILE2JDBC_US"><STATEMENT><DATABASETABLE ACTION='insert'><TABLE>DATABASETABLE</TABLE><ACCESS><DETAILS><?xml version="1.0" encoding="UTF-8"?><ns0:SENDER_MSG_TYPE xmlns:ns0="http://FILE2JDBC_US">   <ORGANISATION>MICROSOFT</ORGANISATION>   <FIRSTNAME>KUMAR</FIRSTNAME>   <LASTNAME>RAJESH</LASTNAME>   <STREET>DALAL</STREET>   <CITY>MUMBAI</CITY>   <STATE>MAHARASTHRA</STATE>   <ZIP>430002</ZIP>   <PHONE>3187321</PHONE>   <FAX>145965</FAX>   <ORDERNUMBER>4569</ORDERNUMBER>   <POTYPE>OPEN</POTYPE>   <ORDERDELIVERYDATE>14041970</ORDERDELIVERYDATE>   <ORDERSTATUS>DELIVERED</ORDERSTATUS>   <BANKNAME>SBI</BANKNAME>   <ACCOUNTNUMBER>123659874</ACCOUNTNUMBER>   <BRANCHCODE>345</BRANCHCODE>   <PAYMENTTYPE>CASH</PAYMENTTYPE>   <CURRENCY>INR</CURRENCY>   <PARTNERNAME>IBM</PARTNERNAME>   <QUANTITY>TONNE</QUANTITY></ns0:SENDER_MSG_TYPE></DETAILS></ACCESS></DATABASETABLE></STATEMENT></ns0:RECEIVER_MSG_TYPE>
    PLEASE HELP ME ON THIS ISSUE .

  • Connection mysql jdbc error ?

    I have program java likes this :
    import java.sql.*;
    public class LoadDriver {
        // Define the JDBC Driver and the database connection URL
        public static final String DRIVER = "com.mysql.jdbc.Driver";
        public static final String URL = "jdbc:mysql://localhost/java?user=test&password=test";
        public static void main(String args[]) {
            Connection conn = null;
    Statement select = null;
    ResultSet result = null;
            try {
                // load the driver dynamically
                Class.forName(DRIVER);
                // connect to the database
                conn = DriverManager.getConnection(URL);
                // perform a query. first create a Statement object from the connection
                select = conn.createStatement();
    // next execute a query (SQL string) and return the results in a ResultSet object
                result = select.executeQuery("select fname, lname from names order by lname, fname");
                // print out the results
                while(result.next()) {
                    String fname = result.getString("fname"); // note these match the columns in the
                    String lname = result.getString("lname"); // SELECT statement (fname, lname)
                    System.out.println(fname+" "+lname);
    // check if there was a problem executing the SQL statement
            catch (SQLException e) {
                System.err.println("SQL Exception: "+e.getMessage());
                System.exit(1);
    // if the JDBC driver is not in the CLASSPATH
            catch (ClassNotFoundException e) {
                System.err.println("Class not found:  "+e.getMessage());
                System.exit(1);
    // catch any other exceptions
            catch (Exception e) {
                System.err.println("Other Exception: ");
                System.err.println(e.getMessage());
                System.exit(1);
    // You want to close the connections no matter what happens!
    finally {
    try {
    // close the result, query, and database connection
    if (result != null) result.close();
                 if (select != null) select.close();
                if (conn != null) conn.close();
    catch (SQLException e) {
    // one of the new cases where it's OK to just eat exceptions or at the most log them
    System.err.println("Error closing connection: "+e.getMessage());
      but i get errror likes this :
    D:\Program Files\Java\jdk1.5.0_03\bin>javac LoadDriver.java
    D:\Program Files\Java\jdk1.5.0_03\bin>java LoadDriver
    Exception in thread "main" java.lang.NoClassDefFoundError: org/aspectj/lang/Sign
    ature
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:164)
    at LoadDriver.main(LoadDriver.java:20)
    D:\Program Files\Java\jdk1.5.0_03\bin>
    I place mysql.jar in
    - D:\Program Files\Java\jdk1.5.0_03\jre\lib\ext
    - D:\Program Files\Java\jdk1.5.0_03\lib
    - D:\Program Files\Java\jdk1.5.0_03\jre\lib
    and i make classpath to D:\Program Files\Java\jdk1.5.0_03\bin;D:\Program Files\Java\jdk1.5.0_03\jre\lib\ext\
    but it still doesn't work
    What must I do ?
    Thx 4 your reply

    Hello!
    I'm getting this same error message and i followed the code example as close as i could:
    Thanks for any help on this!
    bk
    set oldpath=%PATH%
    set JAVA_HOME=C:\jdk1.5.0_02
    set ANT_HOME=C:\ANT\apache-ant-1.6.5
    set PATH=C:\jdk1.5.0_02\bin;%ANT_HOME%\bin
    set CLASSPATH=.;C:\jdk1.5.0_02\lib;C:\MYSQL\mysql-connector-java-3.1.10\src\com\;C:\MYSQL\mysql-connector-java-3.1.10\src\org\;C:\MYSQL\mysql-connector-java-3.1.10\mysql-connector-java-3.1.10-bin-g.jar;
    http://www.developer.com/java/data/article.php/3417381#Critical_steps_in_using_JDBC
    import java.sql.*;
    public class Jdbc11 {
      public static void main(String args[]){
        System.out.println(
                      "Copyright 2004, R.G.Baldwin");
        try {
          Statement stmt;
          //Register the JDBC driver for MySQL.
          Class.forName("com.mysql.jdbc.Driver");
          //Define URL of database server for
          // database named mysql on the localhost
          // with the default port number 3306.
          String url =
                "jdbc:mysql://localhost:3306/mysql";
          //Get a connection to the database for a
          // user named root with a blank password.
          // This user is the default administrator
          // having full privileges to do anything.
          Connection con =
                         DriverManager.getConnection(
                                     url,"root", "");
          //Display URL and connection information
          System.out.println("URL: " + url);
          System.out.println("Connection: " + con);
          //Get a Statement object
          stmt = con.createStatement();
          //Create the new database
          stmt.executeUpdate(
                           "CREATE DATABASE JunkDB");
          //Register a new user named auser on the
          // database named JunkDB with a password
          // drowssap enabling several different
          // privileges.
          stmt.executeUpdate(
              "GRANT SELECT,INSERT,UPDATE,DELETE," +
              "CREATE,DROP " +
              "ON JunkDB.* TO 'auser'@'localhost' " +
              "IDENTIFIED BY 'drowssap';");
          con.close();
        }catch( Exception e ) {
          e.printStackTrace();
        }//end catch
      }//end main
    }//end class Jdbc11
    Exception in thread "main" java.lang.NoClassDefFoundError: org/aspectj/lang/Signature

  • Receiver JDBC: Error while doing the Deleting and Inserting new records

    Hi All,
              I am doing Idoc to JDBC scenario. In this I am collecting & bundling different type of Idocs and then sending to the JDBC receiver. My requirement is to delete the existing records in the database and insert the new records. I have configures as mentioned in the link
    Re: Combining DELETE and INSERT statements in JDBC receiver
    In the above link its shows for single mapping. In my scenario I am using multi mapping for collecting idocs in BPM. If I configured for normal mapping then it is working fine(Deleting existing records and Inserting new record). Whenever I am using multi mapping then I am getting following error in the receiver JDBC communication channel u201CError while parsing or executing XML-SQL document: Error processing request in sax parser: No 'action' attribute found in XML document (attribute "action" missing or wrong XML structure)u201D . Can you please tell me what might be the problem.
    Thanks & Regards,
    T.Purushotham

    Hi !
    check this out:
    JDBC - No 'action' attribute found in XML document - error
    JDBC receiver adapter: No 'action' attribute found in XML document
    It appears that the inbound payload (the one that is going from XI to the JDBC adapter) does not have the requiered tag to specify which SQL action to execute in the receiver system. Maybe the multimapping is not creating the desired output message format.
    Regards,
    Matias.

Maybe you are looking for

  • Where did my pro go?

    I ordered and paid for QT Pro a little over a year ago. Since, I have used it to edit several videos w/o a problem. BUT recently when I load QT, I can not access the PRO settings. I try to re-register but do not know where to find the reg. key. It is

  • My books in iBooks app on my ipad3 are very slow

    I am having a problem with books loading and pages turning very slowly within the iBooks app on my iPad3? Any suggestions?  Thanks.

  • Low speed when I edit a step when I insert a step, whose edit substep has been specified by a LabVIEW vi.

      I created a step type in Teststand and specfied its "edit" substep with a Labview vi. In labVIEW, I can open that vi very quicky, however, every time when I click "Specify Module..."in that step type's property dialog through Type Pallette windows,

  • IMG - translate sometimes not possible?

    Hello, Sometimes, the translation option isn't enabled for certain tables. For example, educational certificates and education establishment types. These tables do have a language field, but it seems like it's not possible to translate entries. How c

  • Dynamic Radio button

    I tried to created radio button dynamically through loop. But for the values and labels- i am not able to assign values dynamically. Is there any other way by which i can dynamically create radio buttons inside a loop and assign them values & labels?