Dbunit

Hi,
I am looking for a tool that provides support for verifying whether two tables or databases schemas are same or not.
I want to input two sql script files:
1. one containing the create table for creating a table with name, id and email
2. other containing the create table for creating a table with name, id and an alter table statement for adding the email.
Now i have to test whether above two sql scripts will have the same impact on database.
This is just the simpler form of veru complex sql script file that i am working on.
Can DBunit do this and how.
Its very urgent. I will appreciate any help.
Thank
Eva

Duplicated thread at more clarification about previous problem

Similar Messages

  • Inserting issue while ruuning a DBUnit TestCase

    Hi all,
    Iam trying to run a sample program which inserts data in to two tables(master and Child ), while iam reading data from a flatxml file.
    Iam using MS SQLServer 2000 .
    The child table has a auto increment coloumn, now i need to explicitly override the column and add the data in to the column.when i try to run the testcase iam getting this exception.
    FaltXML File:
    <?xml version='1.0' encoding='UTF-8'?>
    <dataset>
    <ServiceRequest ID="2222226" Priority="1" Status="3" ReceiptMethod="2" RequestType="1" OperatingChannel="9" DeadlineDate="2001-03-10 00:00:00.0" IsEscalated="false" LastActionedBy="mapdev02" LastActionedDate="2005-02-28 00:00:00.0" CreationDate="2000-08-29 00:00:00.0" ClosedDate="2000-12-20 00:00:00.0" IsDuplicateCheckComplete="false"/>
    <Account ID="9999999" ServiceRequest="2222226" Number="12344565" ProductCode="SVC" SubProductCode="SHC" Status="PreApproval" ServicingBranchBSB="2001" ControllingPostID="A0010" ShortName="ANZ" OperatingChannel="2" LastChangeDate="2002-12-24 00:00:00.0"/>
    </dataset>
    Class File :
    package com.db.unitTest;
    import java.io.FileInputStream;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import org.dbunit.DatabaseTestCase;
    import org.dbunit.database.AbstractDatabaseConnection;
    import org.dbunit.database.DatabaseConfig;
    import org.dbunit.database.DatabaseConnection;
    import org.dbunit.database.IDatabaseConnection;
    import org.dbunit.dataset.IDataSet;
    import org.dbunit.dataset.xml.FlatXmlDataSet;
    import org.dbunit.ext.mssql.InsertIdentityOperation;
    import org.dbunit.ext.mssql.MsSqlConnection;
    import org.dbunit.operation.DatabaseOperation;
    import org.dbunit.operation.TransactionOperation;
    public class SampleTest extends DatabaseTestCase {
         private FlatXmlDataSet loadedDataSet;
         protected IDatabaseConnection getConnection() throws Exception {
              System.out.println("==============getConnection()");
              Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
    Connection connection = DriverManager
              .getConnection(
         "jdbc:sqlserver://161.11.4.1:49168;DatabaseName=MAPDM;SelectMethod=cursor","mapUser", "map");
              MsSqlConnection msConnection = new MsSqlConnection(connection);
         return msConnection;
         protected IDataSet getDataSet() throws Exception {
              System.out.println("==============getDataSet()");
    loadedDataSet = new FlatXmlDataSet(new FileInputStream(".\\data\\input.xml"));
         return loadedDataSet;
         protected DatabaseOperation getSetUpOperation() throws Exception {
              System.out.println("==============getSetUpOperation()");
              InsertIdentityOperation.INSERT.execute(getConnection(),getDataSet());     
              return null;
         protected DatabaseOperation getTearDownOperation() throws Exception {
              System.out.println("==============getTearDownOperation()");
              return DatabaseOperation.DELETE;
         public void testCheckDataLoaded() throws Exception {
              System.out.println("==============testCheckDataLoaded()");
    }Please help.
    Cheers
    Jeevan
    com.microsoft.sqlserver.jdbc.SQLServerException: sp_cursoropen/sp_cursorprepare: The statement parameter can only be a single select or a single stored procedure.
         at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
         at com.microsoft.sqlserver.jdbc.IOBuffer.processPackets(Unknown Source)
         at com.microsoft.sqlserver.jdbc.SQLServerStatement.sendExecute(Unknown Source)
         at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecute(Unknown Source)
         at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.execute(Unknown Source)
         at org.dbunit.database.statement.SimplePreparedStatement.addBatch(SimplePreparedStatement.java:67)
         at org.dbunit.database.statement.AutomaticPreparedBatchStatement.addBatch(AutomaticPreparedBatchStatement.java:57)
         at org.dbunit.operation.AbstractBatchOperation.execute(AbstractBatchOperation.java:187)
         at org.dbunit.ext.mssql.InsertIdentityOperation.execute(InsertIdentityOperation.java:162)
         at com.db.unitTest.SampleTest.getSetUpOperation(SampleTest.java:66)
         at org.dbunit.DatabaseTestCase.setUp(DatabaseTestCase.java:118)
         at junit.framework.TestCase.runBare(TestCase.java:125)
         at junit.framework.TestResult$1.protect(TestResult.java:106)
         at junit.framework.TestResult.runProtected(TestResult.java:124)
         at junit.framework.TestResult.run(TestResult.java:109)
         at junit.framework.TestCase.run(TestCase.java:118)
         at junit.framework.TestSuite.runTest(TestSuite.java:208)
         at junit.framework.TestSuite.run(TestSuite.java:203)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)

    Thanks Ranganath,
    Yes there is a problem in the PA30. employee is not enrolled in benefits so it is throughing me error.
    Thanks a lot
    Ravi

  • DBUnit problem

    I don't know if this is in the right forum (move it if not please).
    I'm writing a unit test with Junit and DBUnit.
    The error i've got is
    SQLException: No data is availablePieces of code:
    setUp method
              super.setUp();
              ds = new BasicDataSource();
              ((BasicDataSource) ds).setDriverClassName("org.hsqldb.jdbcDriver");
              ((BasicDataSource) ds).setUrl("jdbc:hsqldb:mem:baseball");
              ((BasicDataSource) ds).setUsername("sa");
              ((BasicDataSource) ds).setPassword("");
              conn = ds.getConnection();
              Statement stm = conn.createStatement();
              stm.execute(SQL_CREATE_TABLE);
              stm.close();
              ObjToTest obj = new ObjToTest();
              ObjToTest.setDataSource(ds);testCommit method
              public void testCommit(){
              try {
                   obj.commit(1L, 1L, null, "", "", true, null);
              } catch (Exception e) {
                   getLogger().debug("Exception caught", e);
                   fail("Exception caught");
              try {
                   conn = ds.getConnection();
              } catch (SQLException e1) {
                   getLogger().debug("SQLException caught", e1);
              Statement stm = null;
              ResultSet rs = null;
              int response = 0;
              try {
                   stm = conn.createStatement();
                   rs = stm.executeQuery(SQL_SELECT_VALUE);
                   response = rs.getInt(1);
              } catch (SQLException e) {
                   getLogger().debug("SQLException caught", e);
                   fail(e.toString());
              assertEquals(response, EXPECTED_RESPONSE);
         }Everything seems to work fine until this line:
    response = rs.getInt(1);Any ideas?
    Thanks.

    I finally solved it.
    I forgot to put
    rs.next()

  • JUnit/DBUnit rollback inserts/updates made by method being tested

    When performing JUnit/DBUnit testing, when you setup your data by inserting/updating rows during initialization, those insertions and updates would be rolledback automatically during the TearDown step of the Unit Test, right?
    My question is that if the inserts and updates are done on the method being tested what are the steps to rollback those inserts and updates?
    Can it be done implicitly by JUnit/DbUnit? or do we have to do it manually?
    We have an ADF Application Module method that is being J/DB-Unit tested and it calls a stored procedure that does a lot of things to many tables on the database. So it would be nice if the rollback was implicit.

    Anton,
    That would be nice, wouldn't it.
    Unfortunately, that's not the way it works. You have to rollback/undo your changes explicitly. As you asked on another thread, flashback would be a nice way of doing it. If you have a suite of tests that runs, you can flash back the entire database at the end to put the DB back into a known state.
    John

  • ADF 10.1.2 and DBUnit?

    Hi,
    Has anyone successfully used DBUnit to test his ADF BC components?
    I have tried this but run into some issues. The most important one is that DBunit needs a physical JDBC connection to load Excel sheets with data. I've subclassed the ApplicationModuleImpl class so there is a method that returns the current connection (I know, very dangerous but it may only be used by DBUnit). However, it seems that DBunit after loading the data is closing this connection so the ApplicationModuleImpl that is tested is raising an error about the closed connection. Does anyone have an idea how to use DBunit like this in combination with ADF?
    All hints and tips are welcome!

    Repost.
    Anyone?

  • JPA +DBUnit

    I am trying to get osme tests working with JPA
    Now the problem is that I need to get hte connection String stored n the persistence.xml so that I can pass this to dbunit ..I don't want to put in the jdbc String in DBUnit I want to read it from the persistence.xml
    How do I do that
    Thanks
    Subu

    Check out glassfish bug 675 and 932:
    https://glassfish.dev.java.net/issues/show_bug.cgi?id=675
    https://glassfish.dev.java.net/issues/show_bug.cgi?id=932
    Bug 675 would have caused the issue with using count(p) in the select, but has been fixed. Bug 932 should still give you problems when using count in the having clause.
    Best Regards,
    Chris

  • Dbunit doubt

    IDataSet fullDataSet = conn.createDataSet();
    FlatXmlDataSet.write(fullDataSet, new FileOutputStream("full.xml"));
    in the above code, i had a error "class not found" and "variable not found"

    IDataSet fullDataSet = conn.createDataSet();
    FlatXmlDataSet.write(fullDataSet, new
    FileOutputStream("full.xml"));
    in the above code, i had a error "class not found"
    and "variable not found"I am guessing that you did not import the IDataSet in your code. Beyond that, my magic crystal ball is foggy.

  • How to configure Spring Data JPA to handle sdo_geometry and Timestamp(0)?

    Hi all,
    I'm new to this community, not sure if I'm posting in the right place.
    I'm an Oracle old-hand, but new to Spring Data, having done a bit on postGIS, but now trying to apply it to Oracle.
    My problem:  I have a new maven project, with Entity and Repository classes, and a JUnit test program that uses DbUnit to preload test data.
    The current config uses a beans.xml file to set up:
      <bean id="entityManagerFactory"
        class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">...
        <property name="jpaProperties">....
      <bean id="vendorAdapter"
        class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
        <property name="databasePlatform" value="org.hibernate.dialect.Oracle10gDialect" />
        <property name="generateDdl" value="false" />
      </bean>
      <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
        destroy-method="close">
        <property name="driverClass" value="oracle.jdbc.OracleDriver" />
        <property name="jdbcUrl"
         value="jdbc:oracle:thin:@localhost:2632:BLADE" />...
    <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
      <property name="entityManagerFactory" ref="entityManagerFactory" />
    </bean>
    Test of repos.count() works ok.
    Test to call repos.findByName(String) fails, (stack below).
    Now, the current setup doesn't handle SDO_GEOMETRY, or TIMESTAMP(0), but will manage TIMESTAMP(6).
    The warnings below show that I'm  using "DefaultDataTypeFactory" and should probably be using OracleDataTypeFactory.
    I've also found the OracleDataSource class, and tried that, but still get the same data type issues.
    Ok, the big questions:
    1. Can anyone point me at an example to configure the dataSource, or vendorAdapter, to use the OracleDataTypeFactory, and retrieve these data types?
    2. What data type should I be using in Java for the geometry column?
    Thanks,
    Phil
    Test output warnings:
    16:24:05.846 [main] INFO  org.springframework.test.context.transaction.TransactionalTestExecutionListener - Began transaction (2) for test context [DefaultTestContext@990034 testClass = NotamRepositoryTest, testInstance = com.thalesgroup.uk.airscape.common.data.domain.dao.notam.NotamRepositoryTest@3ff1d6, testMethod = testNotamFetchByDatasetName@NotamRepositoryTest, testException = [null], mergedContextConfiguration = [MergedContextConfiguration@1346193 testClass = NotamRepositoryTest, locations = '{classpath:testBeans.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]]; transaction manager [org.springframework.orm.jpa.JpaTransactionManager@1f1fe9d]; rollback [true]
    16:24:08.674 [main] WARN  org.dbunit.dataset.AbstractTableMetaData - Potential problem found: The configured data type factory 'class org.dbunit.dataset.datatype.DefaultDataTypeFactory' might cause problems with the current database 'Oracle' (e.g. some datatypes may not be supported properly). In rare cases you might see this message because the list of supported database products is incomplete (list=[derby]). If so please request a java-class update via the forums.If you are using your own IDataTypeFactory extending DefaultDataTypeFactory, ensure that you override getValidDbProducts() to specify the supported database products.
    16:24:08.674 [main] WARN  org.dbunit.util.SQLHelper - DATA_SET.SEC_TAG_MODIFIED data type (1111, 'TIMESTAMP(0)') not recognized and will be ignored. See FAQ for more information.
    16:24:08.674 [main] WARN  org.dbunit.util.SQLHelper - DATA_SET.CREATED data type (1111, 'TIMESTAMP(0)') not recognized and will be ignored. See FAQ for more information.
    16:24:08.674 [main] WARN  org.dbunit.util.SQLHelper - DATA_SET.MODIFIED data type (1111, 'TIMESTAMP(0)') not recognized and will be ignored. See FAQ for more information.
    16:24:08.690 [main] WARN  org.dbunit.util.SQLHelper - DATA_SET.VALID_FROM data type (1111, 'TIMESTAMP(0)') not recognized and will be ignored. See FAQ for more information.
    16:24:08.690 [main] WARN  org.dbunit.util.SQLHelper - DATA_SET.VALID_TO data type (1111, 'TIMESTAMP(0)') not recognized and will be ignored. See FAQ for more information.
    16:24:08.690 [main] WARN  org.dbunit.dataset.AbstractTableMetaData - Potential problem found: The configured data type factory 'class org.dbunit.dataset.datatype.DefaultDataTypeFactory' might cause problems with the current database 'Oracle' (e.g. some datatypes may not be supported properly). In rare cases you might see this message because the list of supported database products is incomplete (list=[derby]). If so please request a java-class update via the forums.If you are using your own IDataTypeFactory extending DefaultDataTypeFactory, ensure that you override getValidDbProducts() to specify the supported database products.
    16:24:08.690 [main] WARN  org.dbunit.util.SQLHelper - NOTAM.Q_POINT data type (1111, 'SDO_GEOMETRY') not recognized and will be ignored. See FAQ for more information.
    16:24:08.690 [main] WARN  org.dbunit.util.SQLHelper - NOTAM.Q_RANGE_RING data type (1111, 'SDO_GEOMETRY') not recognized and will be ignored. See FAQ for more information.
    java.lang.UnsupportedOperationException
        at org.hibernate.spatial.GeometrySqlTypeDescriptor.getExtractor(GeometrySqlTypeDescriptor.java:57)
        at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:267)
        at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:263)
        at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:253)
        at org.hibernate.type.AbstractStandardBasicType.hydrate(AbstractStandardBasicType.java:338)
        at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2969)
        at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1695)
        at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1627)
        at org.hibernate.loader.Loader.getRow(Loader.java:1514)
        at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:725)
        at org.hibernate.loader.Loader.processResultSet(Loader.java:952)
        at org.hibernate.loader.Loader.doQuery(Loader.java:920)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:354)
        at org.hibernate.loader.Loader.doList(Loader.java:2553)
        at org.hibernate.loader.Loader.doList(Loader.java:2539)
        at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2369)
        at org.hibernate.loader.Loader.list(Loader.java:2364)
        at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:496)
        at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:387)
        at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:231)
        at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1264)
        at org.hibernate.internal.QueryImpl.list(QueryImpl.java:103)
        at org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:573)
        at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:449)
        at org.hibernate.jpa.criteria.compile.CriteriaQueryTypeQueryAdapter.getResultList(CriteriaQueryTypeQueryAdapter.java:67)
        at org.springframework.data.jpa.repository.query.JpaQueryExecution$CollectionExecution.doExecute(JpaQueryExecution.java:81)
        at org.springframework.data.jpa.repository.query.JpaQueryExecution.execute(JpaQueryExecution.java:59)
        at org.springframework.data.jpa.repository.query.AbstractJpaQuery.doExecute(AbstractJpaQuery.java:97)
        at org.springframework.data.jpa.repository.query.AbstractJpaQuery.execute(AbstractJpaQuery.java:88)
        at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:384)
        at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:344)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodIntercceptor.invoke(CrudMethodMetadataPostProcessor.java:111)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
        at com.sun.proxy.$Proxy67.findByDataSetNameAndDeletedIsNull(Unknown Source)
        at com.thalesgroup.uk.airscape.common.data.domain.dao.notam.NotamRepositoryTest.testNotamFetchByDatasetName(NotamRepositoryTest.java:103)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
        at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83)
        at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:233)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:87)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
        at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
        at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:176)
        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

    Hi
    You can use T-code NACE and then select your application based on your output type you can assign your  Print program and Form.
    Reward points, if it is helpful.
    Regards
    Raja.

  • UTF-8, Unicode, XML and windows problems

    Hi there,
    I'm developing an application which uses a lot of russian text.
    This russian text is stored in XML and can be sent to a server remotly
    I use the standard javax.xml libaries to parse the xml files and DBunits XMLWriter to write generate XML strings.
    The XML returned by the DBunit stuff is UTF-8, but its inside a UTF-16 string.
    So when I generate xml and print it out I get something that looks like the following:
    ��������� ������������ ���������?����Thats ok, beacause I can stick that streight into a file when writing files and it works.
    But the problem comes when sending the XML over the server.
    The sending implentation I use must be able to send java generated utf-16 and xml read utf-8.
    So I convert the XML from utf-8 to utf-16, using the following:
    byte[] stringBytesISO = isoString.getBytes("ISO-8859-1");
    utf8String = new String(stringBytesISO, "UTF-8");And that works perfectly on my linux system.
    However when I run it on windows, it only seems to convert some of the characters
    &#1055;&#1088;&#1080;&#1074;&#1099;&#1095;&#1085;&#1099;&#1084; &#65533;?&#1085;&#1086;&#1084; &#1079;&#1072;&#65533;?&#1085;&#1091;&#1090; &#1076;&#1086;&#1088;&#1086;&#1075;&#1080; &#1076;&#1086; &#1074;&#1077;&#65533;?&#1085;&#1099;,Does anyone know whats going wrong here?

    jammers1987 wrote:
    I use the standard javax.xml libaries to parse the xml files and DBunits XMLWriter to write generate XML strings.DbUnit is a testing tool; are you saying you're using it in a production system? Ideally, you should use the same library to write the XML as you do to read it, but you definitely shouldn't be using DbUnit in this context.
    The XML returned by the DBunit stuff is UTF-8, but its inside a UTF-16 string. That should never happen. XML is just text, and text can either be in the form of a Java string, or it can be stored externally using a text encoding like UTF-8. Never mind that Java strings use the UTF-16 encoding; you don't need to know or mention that. Encodings only come into play when you're communicating with something outside your program, like a file system or a database.
    When you generate the XML, you specify that the encoding is UTF-8. When you read the XML, you specify that the encoding is UTF-8. That's all.

  • Testing if two tables have the same structure

    Hi,
    I am looking for a tool that provides support for verifying whether two tables or databases schemas are same or not.
    I want to input two sql script files:
    1. one containing the create table for creating a table with name, id and email
    2. other containing the create table for creating a table with name, id and an alter table statement for adding the email.
    Now i have to test whether above two sql scripts will have the same impact on database.
    This is just the simpler form of veru complex sql script file that i am working on.
    Can DBunit do this and how.
    Its very urgent. I will appreciate any help.

    Repeated thread at: more clarification about previous problem

  • Creating sqlite database from code

    Hi,
    I am writing integration test with sqlite database.Before running a test,I want to create a database using a script ie .sql file.Is it possible to do so using Flex API for databases? If so,how?

    @kinganand - Currently I don't know of an equivalent to DbUnit for AIR, so you'd have to roll something of your own accord.  Maybe search Google Code or GitHub for projects that may have attempted to tackle this problem?
    -Brian

  • ADF Jdbc Connection from bc4j.xcfg

    How do you obtain a JdbcConnection from bc4j.xcfg file.
    I am creating a DBUnit which needs a JdbcConnection object to properly setup datasets?
    how about if I use this:
    ApplicationModule module = Configuration.createApplicationModule(); //the applicationModule was successfully created
    Connection conn = DriverManager.getConnection(Configuration.CONNECT_STRING,Configuration.USER_NAME, Configuration.PASS_WORD); Will this get the existing connection or create a new connection?

    I guess you get a new connection this way. If you have an ApplicationModule you can get the internal connection this way    public Connection getCurrentConnection(ApplicationModule aApp)
            Statement st = null;
            try
                // create Dummy Statement to get the connection
                st = aApp.getDBTransaction().createStatement(0);
                return st.getConnection();
            catch (SQLException s)
               // Log some message here and do something
            finally
                // close statement
                if (st != null)
                    try
                        st.close();
                    catch (SQLException s2)
        }Timo

  • Oracle Class Loading issue

    Hello All
    I am trying to implement Dbunit in my project. My project uses OAS 10.1.3 and JDK 1.5. I have my dbunit.jar, slf4j-api.jar and slf4j-simple.jar in my shared-library and I have imported them using the class loader while deploying my application. But still I am getting NoclassDefFoundError Missing Dependent class LoggerFactory NotFound.
    Please let me know what could be issue.
    Thanks
    Sri

    Hello All
    I am trying to implement Dbunit in my project. My project uses OAS 10.1.3 and JDK 1.5. I have my dbunit.jar, slf4j-api.jar and slf4j-simple.jar in my shared-library and I have imported them using the class loader while deploying my application. But still I am getting NoclassDefFoundError Missing Dependent class LoggerFactory NotFound.
    Please let me know what could be issue.
    Thanks
    Sri

  • C200 M2 LFF does not see disks in boot menu after ESXi installation

    So in front of me I have a brand new C200 M2 LFF with a single E5606 processor, 20 GB of RAM and an LSI Megaraid 9260-4i controller and 4 1-TB SAS disks. I've put the disks in a RAID 5 array I've created a 10 GB virtual disk and successfully installed ESXi on it twice, with a second virtual disk to be used as a datastore.
    However, I can't get the thing to boot. It's not even an option. The only storage option in the boot menu is the DVD drive. If I look at the mass stroage controller configuration, in fact, SATA ports 0 through 4 are "not installed" and port 5 has the DVD drive.
    I've tried fiddling with the BIOS settings without any luck.Currently the onboard controller is enabled and the SATA mode is set to enhanced (which seems to be the default and what is recommended with the Megaraid cards). This was a bundle (UCSC-DBUN-C200-102 per the packing slip, which seems to be a disti-only part number), so I didn't have to assemble anything and I would assume all the cables were connected in the factory. I've opened up the server, and as far as I can tell all the cables look connected.
    Any suggestions? Any help would be greatly appreciated. If I have to open a case with the TAC, that's fine, but considering that I can actually install the operating system it has to be something stupid I'm missing.

    Thanks. I had actually tried that with the boot mode set at UEFI and it didn't work, but I gave it another try set at legacy and it works fine.
    The documentation for this seems confusing to me, though. Isn't this RAID card considered a mezzanine card? The documentation here says to enable the onboard controller to get a mezzanine card to work:
    http://www.cisco.com/en/US/docs/unified_computing/ucs/c/hw/C200M1/install/RAID.html#wp1016766

  • Applib directory not in classpath

    I added my dbunit.jar and sl4j-api.jar, sl4j-simple.jar under my application applib directory. I get this following error:
    Missing class: oracle.jdbc.driver.OracleDriver
         Dependent class: org.dbunit.JdbcDatabaseTester
         Loader: global.libraries:1.0
         Code-Source: /C:/Oracle/product/10.1.3.1/OracleAS/j2ee/eTA/applib/dbunit-2.4.7.jar
         Configuration: &lt;code-source&gt; in /C:/Oracle/product/10.1.3.1/OracleAS/j2ee/eTA/config/server.xml
    This load was initiated at global.libraries:1.0 using the Class.forName() method.
    The missing class is available from the following locations:
         1. Code-Source: /C:/Oracle/product/10.1.3.1/OracleAS/jdbc/lib/ojdbc14dms.jar (from &lt;code-source&gt; (ignore manifest Class-Path) in META-INF/boot.xml in C:\Oracle\product\10.1.3.1\OracleAS\j2ee\home\oc4j.jar)
         This code-source is available in loader oracle.jdbc:10.1.0_2.
    Please let me know the reason for this issue.
    Thanks
    Sri

    Hi,
    after having deployed to Oracle ias9i 9.0.3 with JDeveloper 9.0.3 I'll receive this message when starting my application.
    But the bcfj.cfg is definitely in the classpath.
    Does anyone has a tip/hint for me to solve this problem?
    Many thanks,
    Stefan

Maybe you are looking for

  • Impdp work with system but doesn't work with another user

    Hi, We have troubles with import of transportable tablespace, when i try to import it with system the import is done currectly, when i try to use another user we receive this message : impdp bmcese/***** directory=TTS_DIR dumpfile=RMCCO_RMC_ANA_STS_A

  • Query View in Replacement Path variable

    When selecting the query for a replacement path variable there is an option 'Use View for Query Start'. Does anyone know what this is (supposed) to do? Whatever setting I use during testing, the result is always the same. Thanks, József.

  • Photoshop CC wont crashes after loading screen

    Hello, I have been a Photoshop user for a long time. I have wiped my computer and re-installed the trial under a new email I use. After the program loads, after about 5 seconds it stops working. I have a toshiba qosmio 64 bit windows 8

  • Any fix for X-FI screech of death? *sound clip included for downlo

    http://members.cox.net/arfett/lamexfi.wav You can listen to it for yourself. Happens in certain games like conflict global storm if you turn the music all the way down. That clip happens to be from FEAR Extraction Point in which it happens throughout

  • Xerox Phaser 3200MFP

    I have a Xerox Phaser 3200MFP attached to a Windows XP Machine. It is shared as a network printer, and my Windows PCs can print to it without any issues. However, my iMac continues to have issues. I have one of the following issues, depending on whic