I did some testing on SQL Server 2005 express (nice that they let you
have it for free).

You do need to use the catalog (which maps to a database), rather than
the schema in SQL Server (the schema is usually "dbo").

Alternatively, you could leave the catalog off and just specify the
tableName - because you are already specifying the database name on
the connection URL.  This is probably a more common usage scenario for
SQL Server.

Jeff Butler


On 12/12/05, Jeff Butler <[EMAIL PROTECTED]> wrote:
>
> Hmmm...I think SQL Server uses catalogs more than schemas.  So the 
> configuration should look like this:
>
> <table catalog="testdb" tableName="COMPANY">
>
> But it occurs to me that I didn't take that possibility into account in some 
> other areas of Abator.  So the generated code might not be exactly right.  
> I'll take a look at that too.
>
> Jeff Butler
>
>
> On 12/12/05, Jeff Butler <[EMAIL PROTECTED]> wrote:
> >
> > Hi Kevin,
> >
> > Sorry about this bug.  My intent is to show a warning message, rather than 
> > ending so ungracefully.  I'll try to get a fix released soon.
> >
> > The underlying problem is the same - Abator cannot see the table 
> > testdb.COMPANY.  The JDBC code in your case is like this:
> >
> >     DatabaseMetaData dbmd = connection.getMetaData();
> >     ResultSet rs = dbmd.getColumns(null, 'testdb', 'COMPANY', null);
> >
> > That query must be returning an empty result set.  I'm not sure what SQL 
> > Server is expecting, but obviously we've not hit on the proper combination 
> > yet.  I'll do a little research to see what I can find out.
> >
> > Jeff Butler
> >
> >
> >
> >
> > On 12/12/05, Broderick, Kevin <[EMAIL PROTECTED] > wrote:
> > >
> > >
> > >
> > > Hi,
> > >
> > > I'm using SQL Server and I'm seeing the "/ by zero" error aswell.
> > >
> > > Is there anything I can do in my config file below to work around the 
> > > error?
> > >
> > > I've tried matching capitalization as suggested for Oracle earlier. Ever 
> > > the optimist J
> > >
> > > Great tool, looking forward to using it in a project as soon as I get 
> > > over this bump J.
> > >
> > > Cheers,
> > >
> > > Kev
> > >
> > >
> > >
> > > <?xml version="1.0" encoding="UTF-8"?>
> > >
> > > <!DOCTYPE abatorConfiguration PUBLIC "-//Apache Software Foundation//DTD 
> > > Abator for iBATIS Configuration 1.0//EN"
> > >
> > >   "http://ibatis.apache.org/dtd/abator-config_1_0.dtd ">
> > >
> > >
> > >
> > > <abatorConfiguration>
> > >
> > >   <abatorContext>
> > >
> > >     <!-- TODO: Add Database Connection Information -->
> > >
> > >     <jdbcConnection 
> > > driverClass="com.microsoft.sqlserver.jdbc.SQLServerDriver"
> > >
> > >         
> > > connectionURL="jdbc:sqlserver://myserver.test.com:1433;DatabaseName=testdb"
> > >
> > >         userId="TESTDB"
> > >
> > >         password="TESTDB">
> > >
> > >       <classPathEntry 
> > > location="C:/development/eclipse/workspace/AbatorTest/WebRoot/WEB-INF/lib/sqljdbc.jar"
> > >  />
> > >
> > >     </jdbcConnection>
> > >
> > >
> > >
> > >     <javaModelGenerator targetPackage="com.test.database.ibatis.abator" 
> > > targetProject="AbatorTest" />
> > >
> > >     <sqlMapGenerator targetPackage="com.test.database.ibatis.sqlmap" 
> > > targetProject="AbatorTest" />
> > >
> > >     <daoGenerator type="IBATIS" 
> > > targetPackage="com.test.database.ibatis.dao" targetProject="AbatorTest" />
> > >
> > >
> > >
> > >     <table schema="testdb" tableName="COMPANY">
> > >
> > >        <property name="trimStrings" value="true" />
> > >
> > >     </table>
> > >
> > >
> > >
> > >   </abatorContext>
> > >
> > > </abatorConfiguration>
> >
> >
>
>

Reply via email to