You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Roman Zamorski <ra...@tenbit.pl> on 2000/09/05 21:59:36 UTC

Re: Cocoon and Microsoft SQL Server7.0


> Roman,
>
> Please, post your tips :-)
>
> Per.
>

OK, but I don't know if it maches your problem. All the tricks are under
assumption of usage of jdbc:odbc with MSSQL v7. Server was set up on the w2k
machine, the client was win98. I've been developing some client-side
software in java and in one point of time the client [of my company]
demanded the whole thing to use MSSQL instead of mySQL I've been using... a
lot of problems has appeared at this stage. I remember the following
solutions:

1. Read data from the ResultSet in the order they are stored in the
database. [great isn't it?]

Imagine the situation:
- there is a table in db

create table aaa (
    id    int,
    name    varchar(22)
);

and the statement in java:

ResultSet rs = statement.executeQuery("select * from aaa");
if(rs.first()) {
    rs.getString("name");
    rs.getInt("id");
}

... and you have the magic error "Incorect descriptor's index" [translated
from polish]. whatever it means... I don't have to say it works perfectly
with mySQL even over the jdbc:odbc, do I? ;)


2. ResultSet.first() is ... "not implemented"

in the above example you cannot use "first" method. use "next" instead. easy
but annoying. what's the problem in implementing of the "first" method???


3. nested statements just don't work - the only thing I got was error "the
statement is busy with results from the other HSMT" [again translation; I
don't remember the HSMT part, but it was sth similiar].

rs1 = statement1.executeQuery("select id from aaa");
rs2 = statement2.executeQuery("select name from bbb where id_aaa=" +
rs1.getInt("id"));

I still can't make it working. the only solution for me was to store all the
results from the first query in the vector [or table, or whatever you like].


this are the mayor problems I've encountered during my work with MSSQL.
probably I made some mistakes as I do not know much about MSSQL, so if you
have some coments I encourage you to share them with me - I suppose this
list is not for mssql+java people ;). btw. sorry for trashing the list, but
you asked for it...

regards,
roman.




> > > Hello,
> > >
> > > I've been following the discussions on this list for quite a
> > while, but I
> > > haven't heard anyone using (or at least having problems with) Cocoon
> > > together with MSSQL.
> > > I've been using mySQL with no problems before, however recently I had
to
> > > switch to MS (it was not my decision, obviously) and I can't get my
> > queries
> > > executed (cocoon shows no error)  :(
> > >
> > > If anyone has a success story to share, please do.
> > > (what drivers do you use, any specific security settings for the
server,
> > > etc)
> > >
> >
> > I have some experience with java + MSSQL [I also was made to use that
> > thing], and I also know few simple tricks and workarounds to make it
work
> > via jdbc:odbc. what kind of problems do you have? maybe I can help you
[or
> > not]...
> >
> > roman
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> > For additional commands, e-mail: cocoon-users-help@xml.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>