I am using a Oracle 9.2.0.5 database and have to access the database with plain JDBC.In my vision I want to use Spring Data JDBC Extensions with Querydsl for SQL.But even the first steps aren't working, the code generation. When I use the MetaDataExporter to export the schema following the blog entry http://blog.mysema.com/2011/01/querying-in-sql-with-querydsl.html the exporter is logging the following lines:[2012-12-10 13:50:35,872] INFO main - com.mysema.query.sql.codegen.MetaDataExporter.handleTable(302) - Exported /1005bd30_LnkdConstant successfully[2012-12-10 13:50:35,947] INFO main - com.mysema.query.sql.codegen.MetaDataExporter.handleTable(302) - Exported /10076b23_OraCustomDatumClosur successfully[2012-12-10 13:50:36,020] INFO main - com.mysema.query.sql.codegen.MetaDataExporter.handleTable(302) - Exported /1025308f_SunTileScheduler successfully[2012-12-10 13:50:36,091] INFO main - com.mysema.query.sql.codegen.MetaDataExporter.handleTable(302) - Exported /10297c91_SAXAttrList successfully[2012-12-10 13:50:36,160] INFO main - com.mysema.query.sql.codegen.MetaDataExporter.handleTable(302) - Exported /103a2e73_DefaultEditorKitEndP successfully[2012-12-10 13:50:36,231] INFO main - com.mysema.query.sql.codegen.MetaDataExporter.handleTable(302) - Exported /1048734f_DefaultFolder successfully...This never stops, it generates source code for all my Java classes in Memory. My code is as simple as:package my.package;import java.io.File;import java.sql.Connection;import java.sql.DriverManager;import java.sql.SQLException;import com.mysema.query.sql.codegen.MetaDataExporter;public class QueryDslExporter{public static void main(String[] args) throws SQLException{DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());String url = "jdbc:oracle:thin:@10.1.1.173:1521:xxx";Connection conn = DriverManager.getConnection(url, "xxx", "xxx");MetaDataExporter exporter = new MetaDataExporter();exporter.setPackageName("my.package.domain");exporter.setTargetFolder(new File("src/main/java"));exporter.export(conn.getMetaData());}}Dependencies are:<properties><querydsl.version>2.9.0</querydsl.version></properties><dependencies><dependency>
<groupId>com.mysema.querydsl</groupId><artifactId>querydsl-sql</artifactId><version>${querydsl.version}</version></dependency><dependency><groupId>com.mysema.querydsl</groupId><artifactId>querydsl-sql-codegen</artifactId><version>${querydsl.version}</version></dependency>Did anyone know what is going on?Kind regards, Christian
Hi.
Did you verify that the Java class names are also returned if you use DatabaseMetaData directly?
metadata = conn.getMetadata();
results = metadata.getTables(...)
I haven't experienced this behaviour before.
Br,
Timo
Hi,
when I used the following codeDriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());String url = "jdbc:oracle:thin:@10.1.1.173:1521:XXX";connection = DriverManager.getConnection(url, "XXX", "XXX");DatabaseMetaData metadata = connection.getMetaData();resultSet = metadata.getTables(null, null, null, null);I got a non empty resultSet containing the (correct) system tables.
Since this is not what I wanted, I provided explicitely my schema:resultSet = metadata.getTables(null, "SCHEMA", null, null);This also worked.Then I tried to set the schema for the MetaDataExporter and than it worked even with QueryDSL!exporter.setSchemaPattern("SCHEMA");So this tells me that QueryDSL has problems to generate the schema for Oracle 9i system tables.Thanks for your help,Christian
Hi.
On Mon, Dec 10, 2012 at 2:56 PM, Christian Lipp via Querydsl <querydsl+noreply-APn2wQe_8HM4021XVxNw0zKjLB4ba45fOaeEJJSD5GqP...@googlegroups.com> wrote:
I am using a Oracle 9.2.0.5 database and have to access the database with plain JDBC.In my vision I want to use Spring Data JDBC Extensions with Querydsl for SQL.But even the first steps aren't working, the code generation. When I use the MetaDataExporter to export the schema following the blog entry http://blog.mysema.com/2011/01/querying-in-sql-with-querydsl.html the exporter is logging the following lines:[2012-12-10 13:50:35,872] INFO main - com.mysema.query.sql.codegen.MetaDataExporter.handleTable(302) - Exported /1005bd30_LnkdConstant successfully[2012-12-10 13:50:35,947] INFO main - com.mysema.query.sql.codegen.MetaDataExporter.handleTable(302) - Exported /10076b23_OraCustomDatumClosur successfully[2012-12-10 13:50:36,020] INFO main - com.mysema.query.sql.codegen.MetaDataExporter.handleTable(302) - Exported /1025308f_SunTileScheduler successfully[2012-12-10 13:50:36,091] INFO main - com.mysema.query.sql.codegen.MetaDataExporter.handleTable(302) - Exported /10297c91_SAXAttrList successfully[2012-12-10 13:50:36,160] INFO main - com.mysema.query.sql.codegen.MetaDataExporter.handleTable(302) - Exported /103a2e73_DefaultEditorKitEndP successfully[2012-12-10 13:50:36,231] INFO main - com.mysema.query.sql.codegen.MetaDataExporter.handleTable(302) - Exported /1048734f_DefaultFolder successfully...This never stops, it generates source code for all my Java classes in Memory. My code is as simple as:package my.package;
import java.io.File;import java.sql.Connection;import java.sql.DriverManager;import java.sql.SQLException;import com.mysema.query.sql.codegen.MetaDataExporter;public class QueryDslExporter{public static void main(String[] args) throws SQLException{DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
String url = "jdbc:ora...@10.1.1.173:1521:xxx";
The result forresultSet = metadata.getTables(null, null, null, null);is not different compared to QueryDSL. The strange objects I was mentioning are visible under Oracle - public synonymsSo it is my fault and everything is working. Sorry!