Subject | Re: very stupid error wtih firebird jdbc driver |
---|---|
Author | fred.vlietstra |
Post date | 2009-02-17T14:40:07Z |
--- In Firebird-Java@yahoogroups.com, Roman Rokytskyy <roman@...> wrote:
You must provide the field with trailing spaces.
example I will get the "lidnr" 100 the field must have trailing spaces.
" 100".
So I must add the follwing shit to my class :
int len = lidNr.length();
String id = null;
switch (len)
{
case 1: id = " " + lidNr;
break;
case 2: id = " " + lidNr;
break;
case 3: id = " " + lidNr;
break;
case 4: id = " " + lidNr;
break;
case 5: id = " " + lidNr;
break;
case 6: id = " " + lidNr;
break;
case 7: id = " " + lidNr;
break;
case 8: id = " " + lidNr;
break;
case 9: id = " " + lidNr;
break;
case 10: id = lidNr;
break;
}
stmt.setString(++x, id);
But it works.
regards
>trick.
> >> Do you know a trick to get the contains of the SQL statement after
> >> filling the statement.
> >
> > I don't think that is possible, but maybe someone else knows a
>I have solved the problem.
> It is not directly supported by JDBC driver, but try JdbMonitor:
>
> http://www.jdbmonitor.com/
>
> Roman
>
You must provide the field with trailing spaces.
example I will get the "lidnr" 100 the field must have trailing spaces.
" 100".
So I must add the follwing shit to my class :
int len = lidNr.length();
String id = null;
switch (len)
{
case 1: id = " " + lidNr;
break;
case 2: id = " " + lidNr;
break;
case 3: id = " " + lidNr;
break;
case 4: id = " " + lidNr;
break;
case 5: id = " " + lidNr;
break;
case 6: id = " " + lidNr;
break;
case 7: id = " " + lidNr;
break;
case 8: id = " " + lidNr;
break;
case 9: id = " " + lidNr;
break;
case 10: id = lidNr;
break;
}
stmt.setString(++x, id);
But it works.
regards