db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Drolshammer <erik.drolsham...@gmail.com>
Subject Re: read data from database
Date Thu, 25 Sep 2008 05:54:44 GMT
Thomas Dudziak wrote:
> On Wed, Sep 24, 2008 at 1:00 AM, Erik Drolshammer
> <erik.drolshammer@gmail.com> wrote:
> 
>> I have successfully  made a dump from an existing database with
>> readModelFromDatabase. (So my setup seems to work.)
>>
>> How can I do the same for the data?
> 
> For API samples, see http://db.apache.org/ddlutils/api-usage.html, and
> also the javadoc for the DatabaseDataIO class
> (http://db.apache.org/ddlutils/api/org/apache/ddlutils/io/DatabaseDataIO.html).

1. The following gives no errors, but no data is written to data.xml.

DatabaseDataIO databaseDataIO = new DatabaseDataIO();
String xmlEncoding = "UTF-8";
databaseDataIO.writeDataToXML(oracle10Platform, oracleDatabase, 
"data.xml", xmlEncoding);


2.
DatabaseDataIO databaseDataIO = new DatabaseDataIO();
String xmlEncoding = "UTF-8";
databaseDataIO.writeDataToXML(oracle10Platform, "data.xml", xmlEncoding);

gives the following error:


org.apache.ddlutils.DatabaseOperationException: Error while performing a 
query
	at 
org.apache.ddlutils.platform.PlatformImplBase.query(PlatformImplBase.java:899)
	at 
org.apache.ddlutils.io.DatabaseDataIO.writeDataForTableToXML(DatabaseDataIO.java:538)
	at 
org.apache.ddlutils.io.DatabaseDataIO.writeDataToXML(DatabaseDataIO.java:381)
	at 
org.apache.ddlutils.io.DatabaseDataIO.writeDataToXML(DatabaseDataIO.java:359)
	at 
org.apache.ddlutils.io.DatabaseDataIO.writeDataToXML(DatabaseDataIO.java:279)

Caused by: java.sql.SQLException: ORA-00942: table or view does not 
exist  at 
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
	at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
	at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:207)
	at 
oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:801)
	at 
oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1039)
	at 
oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.java:841)
	at 
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1134)
	at 
oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1274)
	at 
org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
	at 
org.apache.ddlutils.platform.PlatformImplBase.query(PlatformImplBase.java:893)
	... 34 more


I have checked with an external tool (SqlDeveloper) that some of the 
tables contain data. In tips?


-- 
Best regards
Erik Drolshammer


Mime
View raw message