zhangjingl02 / activejdbc

Automatically exported from code.google.com/p/activejdbc
0 stars 0 forks source link

Schema not handled correctly (DBException occure) #180

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. On SQL Server create a table like the following:
* CREATE SCHEMA ABC AUTHORIZATION dbo;
* create table ABC.Mytable {...}
* Configure Schema via property as described in wiki space.
* Execute a simply query like ABC.findAll().dump()
* I get a DBException error

What is the expected output? What do you see instead?
2012-11-07 21:54:42,536 INFO Registry - Fetched metadata for table: Mytable 
Exception in thread "main" org.javalite.activejdbc.DBException: 
com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 
'Mytable'., Query: SELECT  * FROM Mytable 
    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216)
    at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515)

What version of the product are you using? On what operating system?
activejdbc 1.4.5

Please provide any additional information below.
I have already checked the code and i have seen that the schema system property 
only effect the metadata lookup, but not the queries. Instead of "SELECT  * 
FROM Mytable", activejdbc should execute "SELECT  * FROM ABC.Mytable"

Original issue reported on code.google.com by w...@thopap.de on 7 Nov 2012 at 9:22

GoogleCodeExporter commented 9 years ago
would this be automatically handled by the database if you provide a name of 
the schema at connection time? this issue has not come up before. 

Original comment by i...@polevoy.org on 9 Nov 2012 at 4:10