james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vincenzo Gianferrari Pini <vincenzo.gianferrarip...@praxis.it>
Subject Re: bayesiananalysis and sql
Date Fri, 07 Jul 2006 12:49:00 GMT
I think that the "for bit" attribute is for bit strings, not character 
strings.

But perhaps VARCHAR in Derby is by default already case sensitive
(see 
http://forum.java.sun.com/thread.jspa?threadID=746275&messageID=4271448).

Try defining "token" as a simple varchar, then feed some ham/spam and 
see in the database table if the tokens were stored preserving the case.

Vincenzo

Norman Maurer wrote:

>Hi,
>
>should it not be:
>
>token varchar (128) for bit data NOT NULL default '',
>
>like descripted in 
>http://db.apache.org/derby/docs/dev/ref/ref-single.html
>
>
>
>VARCHAR FOR BIT DATA
>The VARCHAR FOR BIT DATA type allows you to store binary strings less
>than or equal to a specified length. It is useful for unstructured data
>where character strings are not appropriate (e.g., images). 
>Syntax
>{ VARCHAR | CHAR VARYING | CHARACTER VARYING } (length) FOR BIT DATA  
>length is an unsigned integer literal designating the length in bytes. 
>Unlike the case for the CHAR FOR BIT DATA type, there is no default
>length for a VARCHAR FOR BIT DATA type. The maximum size of the length
>value is 32,672 bytes.
>JDBC metadata type (java.sql.Types)
>VARBINARY
>VARCHAR FOR BIT DATA stores variable-length byte strings. Unlike CHAR
>FOR BIT DATA values, VARCHAR FOR BIT DATA values are not padded out to
>the target length.
>An operation on a VARCHAR FOR BIT DATA and a CHAR FOR BIT DATA value
>(e.g., a concatenation) yields a VARCHAR FOR BIT DATA value.
>The type of a byte literal is always a VARCHAR FOR BIT DATA, not a CHAR
>FOR BIT DATA.
>
>
>
>unfortaly it not work :-(
>
>javax.mail.MessagingException: Exception initializing queries;
>  nested exception is:
>        SQL Exception: Syntax error: Encountered "(" at line 4, column
>29.
>        at
>org.apache.james.transport.mailets.BayesianAnalysisFeeder.initDb(Baye
>sianAnalysisFeeder.java:210)
>        at
>org.apache.james.transport.mailets.BayesianAnalysisFeeder.init(Bayesi
>anAnalysisFeeder.java:185)
>
>bye
>Norman
>
>
>Am Freitag, den 07.07.2006, 09:48 +0200 schrieb Vincenzo Gianferrari
>Pini:
>  
>
>>The reason is that I tried it only with those DBMSs. My understanding 
>>was that sqlRessources.xml is to be upgraded only when testing is done 
>>on a new DBMS, as you are now doing for derby.
>>
>>I've added entries for all DBMSs for WhiteList stuff only because they 
>>were very trivial.
>>
>>Instead, beware that the "token" field in both the bayesiananalysis_ham 
>>and the bayesiananalysis_spam tables*must allow for both uppercase and 
>>lowercase chars* ("binary" attribute in mysql and "COLLATE 
>>Latin1_General_CS_AS" in mssql), so each DBMS has to be correctly 
>>handled probably differently.
>>
>>Vincenzo
>>
>>Norman Maurer wrote:
>>
>>    
>>
>>>Hi guys,
>>>
>>>is there an reason why in sqlRessources.xml is only support for mysql
>>>and mssql for bayesiananalysis ?
>>>I just notice it when i try to test it with derby.
>>>
>>>bye
>>>Norman
>>>
>>> 
>>>
>>>      
>>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
>>For additional commands, e-mail: server-dev-help@james.apache.org
>>
>>!EXCUBATOR:1,44ae11ed48536533925450!
>>    
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message