midea2 发表于 2015-8-10 11:24:13

连接MYOB ODBC,在MyEclipse 下Commit成功,在Tomcat下单独运行,Commit显示Connection 已经关闭

  Tomcat log file
  
  stout_20090728.log:
  ========================
  commandINSERT INTOImport_Service_Sales(CoLastName,FirstName,AddressLine1,AddressLine2,AddressLine3,AddressLine4,InvoiceNumber,SaleDate,CustomersNumber,DeliverVia,DeliveryStatus,Description,AccountNumber,Amount,Job,Comment,Memo,SalespersonLastName,SalespersonFirstName,DeliveryDate,ReferralSource,TaxCode,NonTaxAmount,FreightTaxCode,FreightNonTaxAmount,FreightAmount,SaleStatus,CurrencyCode,ExchangeRate,PaymentIsDue,DiscountDays,BalanceDueDays,PercentDiscount,PercentMonthlyCharge,AmountPaid,PaymentMethod,PaymentNotes,NameOnCard,CardNumber,ExpiryDate,AuthorisationCode,DrawerChequeNumber,Category) VALUES ('Aadvark Advertising (H)',''      ,'Aadvark Advertising (H)',    '15B Golden Hill Mansion Wan Chai','Hong Kong','511458 020','00000023','2009-6-15','00000010','TNT','P','kenty test insert','11120','21.00','','Final Sale.','Sale; Aadvark Advertising (H)','Long, Alan','','2009-6-15','Advertisement','N-T','21.00','','','','Q','0','0','','','','','','21.00','','','','C050','','1','','')
java.sql.SQLException: General error
   at sun.jdbc.odbc.JdbcOdbc.throwGenericSQLException(JdbcOdbc.java:7086)
   at sun.jdbc.odbc.JdbcOdbc.SQLTransact(JdbcOdbc.java:5601)
   at sun.jdbc.odbc.JdbcOdbcConnection.commit(JdbcOdbcConnection.java:700)
   at myob.servlet.Test.process(Test.java:50)
   at myob.servlet.ServletBase.doPost(ServletBase.java:50)
   at myob.servlet.ServletBase.doGet(ServletBase.java:35)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
   at java.lang.Thread.run(Thread.java:619)
  
   stderr_20090728.log:
  ======================================
  Product Version: 5.60.0.3
OPENRDA_INI Configuration file:
Platform: IWINDOWS32
Build: Unicode

**********Contents of file:*********

oa_root=C:\MYOBODBC
SchemaPath=C:\MYOBODBC\schema
Config=C:\MYOBODBC\config\iwinnt
CacheOptions=PATH=C:\MYOBODBC\cache;INITIAL_SIZE=10;INCREMENT_SIZE=5;MAX_SIZE=250;DATABLOCK_SIZE=64
CacheMemSize=8192
JoinInQueryOrder=1
SchemaUpdateAllowed=1
SQLEngineVerboseMode=0x00
SQLEngineVerboseTraceFile=C:\MYOBODBC\bin\iwinnt\oasqlverbose.log
EncryptionPackage=0
FETCHBLOCK_SIZE=100
SessPollWaitTime=20
JOINBLOCK_SIZE=10

KeyFile=C:\MYOBODBC\config\iwinnt\oaclientkey.lic
TraceFile=
FETCHBLOCK_SIZE=100
PromptForUID=0

All=FATAL|SNO|ERRORS

MessagePrefix=
TraceFile=
TraceOptions=0
PromptForUID=0
********************************************************

**********Contents of file:*********

CONNECT_STRING=
TYPE=DB3
SCHEMA_PATH=.\test
REMARKS=Test DBase III IP source

CONNECT_STRING=memory
TYPE=MEM
SCHEMA_PATH=
REMARKS=Test Memory IP source

CONNECT_STRING=
TYPE=MYOB
SCHEMA_PATH=
REMARKS=
********************************************************

**********Contents of file:*********

1=0
8=1
11=N
14=\
16=OpenRDA
17=OpenRDA
18=5.50.20.0
19=Y
20=Y
21=Y
22=0
23=2
24=2
25=N
26=1
27=Y
28=4
29="
30=128
31=128
32=128
33=128
34=128
35=128
36=Y
37=Y
38=Y
39=owner
40=procedure
41=.
42=NULL
43=9
44=1
45=table
46=2
47=OAUSER
48=0
49=16777215
50=16547839
51=3
52=630783
53=0
54=0
55=0
56=0
57=0
58=0
59=0
60=0
61=0
62=0
63=0
64=0
65=0
66=0
67=0
68=0
69=0
70=0
71=0
72=7
73=N
74=2
75=1
78=0
79=0
80=0
81=3
82=0
83=0
84=0
85=1
86=37867
87=Y
88=2
89=HINT,IDENTIFIED
90=N
91=15
92=7
93=4
94=*(){}|:;
95=31
96=3
97=0
98=0
99=0
100=0
101=0
102=0
103=N
104=0
105=32768
106=0
107=32
108=8192
109=0
110=0
111=N
112=8192
113=Y
114=1
115=73
116=0
117=0
118=1
119=0
120=0
121=0
122=0
123=0
124=0
125=0
126=0
127=0
128=0
129=0
130=0
131=0
132=1
133=0
134=1
136=0
137=0
138=0
139=0
140=0
141=1
142=0
143=1
144=0
145=0
146=1
147=0
148=3
149=0
150=0
151=0
152=1
153=2
154=2
155=7
156=2
157=2
158=3184
159=63
160=16135
161=592
162=3184
163=11
164=238
165=0
166=1
167=1
168=0
8194=.
8195=1
8196=15
8197=1
10000=1995
10001=2
10002=Y
10003=Y
10004=ISO=8859-1
10005=128
10022=0
********************************************************

**********Environment Variables*********
OPENRDA_INI =
PATH =
LD_LIBRARY_PATH =
SHLIB_PATH =
CLASSPATH =
ODBCINI =
********************************************************
CLI :: rdacstmt.c:99: *** rda_cliAllocStmt: connection is not opened
SQLD:: damdrv.c:881: sqldrv_commit(): IP endTransaction() returned error.
SQLS:: sqlserv.c:501: *** sqls_commit: Unable to commit transaction.
CLI :: rdacevnt.c:1256: *** procComitCnf: SQL_COMMIT caused a rollback. Error = 20016
CLI :: rdacutl.c:831: *** RDA_cliCommit: can't execute R-Commit

  
   MYOBODBCError.txt
  ==========================================
  Statement Error: 20016 Unable to determine if import has finished
  
  
  java连接方式:
  
   Connection con=null;
          Statement St=null;
          Driver driver=null;
          System.out.println("kenty test");
          try
             {
               driver = DriverManager.getDriver("jdbchttp://community.myob.com/i/smilies/16x16_smiley-surprised.gifdbc:CTSL");
               con = DriverManager.getConnection("jdbchttp://community.myob.com/i/smilies/16x16_smiley-surprised.gifdbc:CTSL");   
               con.setAutoCommit(false);   
               St= con.createStatement();
                 String command="INSERT INTO Import_Service_Sales(CoLastName,FirstName,AddressLine1,AddressLine2,AddressLine3,AddressLine4,InvoiceNumber,SaleDate,CustomersNumber,DeliverVia,DeliveryStatus,Description,AccountNumber,Amount,Job,Comment,Memo,SalespersonLastName,SalespersonFirstName,DeliveryDate,ReferralSource,TaxCode," +               "NonTaxAmount,FreightTaxCode,FreightNonTaxAmount,FreightAmount,SaleStatus,CurrencyCode,ExchangeRate," +
               "PaymentIsDue,DiscountDays,BalanceDueDays,PercentDiscount,PercentMonthlyCharge,AmountPaid," +
               "PaymentMethod,PaymentNotes,NameOnCard,CardNumber,ExpiryDate,AuthorisationCode," +
               "DrawerChequeNumber,Category) " +
               "VALUES ('Aadvark Advertising (H)',''      ,'Aadvark Advertising (H)',    '15B Golden Hill Mansion Wan Chai','Hong Kong','511458 020'," +
               "'00000023','2009-6-15','00000010','TNT','P','kenty test insert','11120','21.00','','Final Sale.','Sale; Aadvark Advertising (H)','Long, Alan','','2009-6-15','Advertisement','N-T'," +
               "'21.00','','','','Q','0','0'," +
               "'','','','','','21.00'," +
               "'','','','C050','','1'," +
               "'','')";
               System.out.println(command);
               int i=St.executeUpdate(command);
               System.out.println("Inserted =1111 ");
               con.commit();   

  }         

  

  最终发现原因,是在创建ODBC的时候,在File Access哪里需要选择Single user Access!
页: [1]
查看完整版本: 连接MYOB ODBC,在MyEclipse 下Commit成功,在Tomcat下单独运行,Commit显示Connection 已经关闭