Java project, notes for migrating data from Oracle to dream Database

Source: Internet
Author: User
DM database is a chinese database and is said to be compatible with Oracle. I personally migrated my data from Oracle11g to the database of dream 6.0. I encountered some problems.

DM database is a chinese database and is said to be compatible with Oracle. I personally migrated my data from Oracle11g to the database of dream 6.0. I encountered some problems.

DM database is a chinese database and is said to be compatible with Oracle. I personally migrated my data from Oracle11g to the database of dream 6.0 and encountered some problems:

1. Incorrect field name
Although dm SQL is compatible with the Case sensitivity of fields, JDVC actually differs from Oracle in execution,

Dm SQL can be executed, but the column name of the returned field is still returned in the case of SQL, and Oracle will return all in the upper case,

Select typeid, typename from T_PUB_PRODUCT_TYPE

The returned column name is TYPEID and TYPENAME.

If the dream return value is typeid, typename

It is better to force all statements to be capitalized before the database executes the statement:

Rs = stmt.exe cuteQuery (strSql. toUpperCase (); // DM database is case sensitive to column names, and Oracle will automatically convert all to uppercase

========================================================== ======
The cuont (*) data type is incorrect.
Statement:
Select count (*) counts from t_cus_product left join t_pub_product_type on p_type = typeid where p_createrid = 200

Oracle's count (*) can be compatible with BigDecimal, and DM's count (*) is of the Long type.
// Count = (BigDecimal) mapCount. get ("counts"). intValue (); // Orcale is BigDecimal
Count = (Long) mapCount. get ("counts"). intValue (); // DM database is Long


========================================================== ==================
2. DM database syntax keyword Error

The following statement can be executed in oracle, but DM reports an error.
Select c. contractid, CONTRACTNO, c. contractname, c. type, sum, begin, end
State, userid, serviceid, P_NAME
From t_contract c
Left join T_CUS_PRODUCT
On c. PRODUCTID = P_ID
Where userid = 200 order by contractid

Cause: begin, end is the reserved keyword of DM, and the statement is changed to double quotation marks. You can use:
Select c. contractid, CONTRACTNO, c. contractname, c. type, sum, "begin", "end"
State, userid, serviceid, P_NAME
From t_contract c
Left join T_CUS_PRODUCT
On c. PRODUCTID = P_ID
Where userid = 200 order by contractid
========================================================== =====
3. An error occurred while querying the dual table,
Statement: select seq_c006_message_content.nextval from dual

Java error:
Java. SQL. SQLException: Invalid table or view name 'dual'
At dm. jdbc. dbaccess. DBError. throwSQLException (Unknown Source)
At dm. jdbc. driver. DmdbCSI. prepareSQL (Unknown Source)
At dm. jdbc. driver. DmdbStatement. directExec (Unknown Source)
At dm.jdbc.driver.DmdbStatement.exe cuteQuery (Unknown Source)
At cn.org. hz. common. dao. DBAccess. queryOneRow (dbaccesskey. java: 110)
At cn.org. hz. blh. i007.I007Blh. I007MessageAdd (I007Blh. java: 136)
At cn.org. hz. blh. i007.I007Blh $ FastClassByCGLIB $ f90d5dcf. invoke ( )
At net. sf. cglib. proxy. MethodProxy. invoke (MethodProxy. java: 149)
At org. springframework. aop. framework. Cglib2AopProxy $ CglibMethodInvocation. invokeJoinpoint (Cglib2AopProxy. java: 700)
At org. springframework. aop. framework. ReflectiveMethodInvocation. proceed (ReflectiveMethodInvocation. java: 149)
At cn.org. hz. common. aop. AroundInterceptor. invoke (AroundInterceptor. java: 13)
At org. springframework. aop. framework. ReflectiveMethodInvocation. proceed (ReflectiveMethodInvocation. java: 171)
At org. springframework. aop. framework. Cglib2AopProxy $ DynamicAdvisedInterceptor. intercept (Cglib2AopProxy. java: 635)
At cn.org. hz. blh. i007.I007Blh $ EnhancerByCGLIB $67fbf5f5. I007MessageAdd ( )
At cn.org. hz. ctrl. i007.I007Ctrl. I007MessageAdd (I007Ctrl. java: 113)
At sun. reflect. NativeMethodAccessorImpl. invoke0 (Native Method)
At sun. reflect. NativeMethodAccessorImpl. invoke (NativeMethodAccessorImpl. java: 39)
At sun. reflect. DelegatingMethodAccessorImpl. invoke (DelegatingMethodAccessorImpl. java: 25)
At java. lang. reflect. Method. invoke (Method. java: 597)
At org. springframework. web. servlet. mvc. multiaction. MultiActionController. invokeNamedMethod (MultiActionController. java: 473)
At org. springframework. web. servlet. mvc. multiaction. MultiActionController. handleRequestInternal (MultiActionController. java: 410)
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: 875)
At org. springframework. web. servlet. DispatcherServlet. doService (DispatcherServlet. java: 809)
At org. springframework. web. servlet. FrameworkServlet. processRequest (FrameworkServlet. java: 571)
At org. springframework. web. servlet. FrameworkServlet. doPost (FrameworkServlet. java: 511)
At javax. servlet. http. HttpServlet. service (HttpServlet. java: 710)
At javax. servlet. http. HttpServlet. service (HttpServlet. java: 803)
At org. apache. catalina. core. ApplicationFilterChain. internalDoFilter (ApplicationFilterChain. java: 269)
At org. apache. catalina. core. ApplicationFilterChain. doFilter (ApplicationFilterChain. java: 188)
At cn.org. hz. filter. CharacterEncodingFilter. doFilter (CharacterEncodingFilter. java: 23)
At org. apache. catalina. core. ApplicationFilterChain. internalDoFilter (ApplicationFilterChain. java: 215)
At org. apache. catalina. core. ApplicationFilterChain. doFilter (ApplicationFilterChain. java: 188)
At org. apache. catalina. core. StandardWrapperValve. invoke (StandardWrapperValve. java: 213)
At org. apache. catalina. core. StandardContextValve. invoke (StandardContextValve. java: 174)
At org. apache. catalina. core. StandardHostValve. invoke (StandardHostValve. java: 127)
At org. apache. catalina. valves. ErrorReportValve. invoke (ErrorReportValve. java: 117)
At org. apache. catalina. core. StandardEngineValve. invoke (StandardEngineValve. java: 108)
At org. apache. catalina. connector. CoyoteAdapter. service (CoyoteAdapter. java: 151)
At org. apache. coyote. http11.Http11Processor. process (Http11Processor. java: 874)
At org. apache. coyote. http11.Http11BaseProtocol $ Http11ConnectionHandler. processConnection (Http11BaseProtocol. java: 665)
At org.apache.tomcat.util.net. PoolTcpEndpoint. processSocket (PoolTcpEndpoint. java: 528)
At org.apache.tomcat.util.net. LeaderFollowerWorkerThread. runIt (LeaderFollowerWorkerThread. java: 81)
At org. apache. tomcat. util. threads. ThreadPool $ ControlRunnable. run (ThreadPool. java: 689)
At java. lang. Thread. run (Thread. java: 619)

Create a dual synonym for this user
If you need direct access, you can use SYSDBA to create a PUBLIC synonym:
Create public synonym dual for SYSTEM. SYSDBA. SYSDUAL;

Although DM creates a dual table under sysdba to be compatible with oracle, it does not create synonyms for each new user. In general, all queries to the dual table will report an error.

========================================================== ==========

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.