Re: Bug in JDBC SQL extensions parser of the Beta SQLServer driver



I agree that the the parser should not be sensitive to white space. I have
entered a bug to track this issue, thank you!


--
Angel Saenz-Badillos [MS] DataWorks
This posting is provided "AS IS", with no warranties, and confers no
rights.Please do not send email directly to this alias.
This alias is for newsgroup purposes only.
I am now blogging: http://weblogs.asp.net/angelsb/




"Joe Weinstein" <joeNOSPAM@xxxxxxx> wrote in message
news:%23xndgbZqFHA.2604@xxxxxxxxxxxxxxxxxxxxxxx
> Hi all.
>
> I just tried this code with the new beta driver and it fails
> at the execute() call!
>
> c = d.connect("jdbc:sqlserver://joe:1433", props );
>
> DatabaseMetaData dd = c.getMetaData();
> System.out.println("Driver version is " +
> dd.getDriverVersion() );
> System.out.println("Database Major version is " +
> dd.getDatabaseMajorVersion() );
> System.out.println("Database Minor version is " +
> dd.getDatabaseMinorVersion() );
>
> Statement s = c.createStatement();
> try { s.executeUpdate("drop procedure joeproc"); } catch
> (Exception ignore){}
> try { s.executeUpdate("drop table joetable"); } catch (Exception
> ignore){}
>
> s.executeUpdate("create table joetable (bar varchar(30) not
> null)");
> s.executeUpdate("create procedure joeproc as "
> + " begin "
> + " insert into joetable values('1') "
> + " insert into joetable values(NULL) "
> + " insert into joetable values('2') "
> + " end ");
>
> PreparedStatement ps = c.prepareStatement("{ call joeproc() }");
> boolean getResultSet = ps.execute();
>
> I get:
>
> Driver version is 1.0.107.104
> Database Major version is 8
> Database Minor version is 0
> com.microsoft.sqlserver.jdbc.SQLServerException: Line 1: Incorrect syntax
> near '{'.
> at
> com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown
> Source)
> at com.microsoft.sqlserver.jdbc.IOBuffer.processPackets(Unknown
> Source)
> at
> com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown
> Source)
> at
> com.microsoft.sqlserver.jdbc.SQLServerStatement.sendExecute(Unknown
> Source)
> at
> com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecute(Unknown Source)
> at
> com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.execute(Unknown
> Source)
>
> The problem is in the driver's JDBC SQL extension parser. If I remove the
> whitespace
> in the SQL to be c.prepareStatement("{call joeproc()}"), it works. This
> parser should
> not be sensitive to white space...
>
> Joe Weinstein at BEA Systems
>


.



Relevant Pages

  • Re: White space, new lines in tags
    ... and being collapsed to a single space by parser (unless in ... White space between attributes is not preserved in the DOM. ... Mozilla Web Author FAQ: http://mozilla.org/docs/web-developer/faq.html ...
    (comp.infosystems.www.authoring.html)
  • Re: Spaces in element?
    ... The element is non empty, so doesn't match the schema as specified, you would have to define the type to allow text content, restricted with a pattern to white space if you want to allow white space text. ... A validating XML processor MUST also inform the application which of these characters constitute white space appearing in element content. ... so your parser can not just silently drop indentation space, and so the document doesn't validate. ...
    (comp.text.xml)
  • RE: Byte[] to string - Kinda...
    ... The original data is just ASCII text ... The parser that I am using automatically trims ... > white space from the node content. ... > so I am using the parser object's getBinaryContent() method to return ...
    (microsoft.public.dotnet.general)

Loading