You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Chris Chew <ed...@yahoo.com> on 2002/04/26 20:50:16 UTC

Trailing Spaces in SQL Server Fields

Hello.

I am new to turbine and working on my first app.  I am
using sql server 2000 (unfortunately), and the sun
jdbc-odbc bridge driver.

Whenever a new record is saved (INSERT or UPDATE),
trailing spaces get added to the field value to fill
up the maximum allowed.  For example, everytime a user
logs in, their username gets extended to the username
+ (32 - str.length(username)) spaces.  That is, the
user:

'turbine' becomes 
'turbine                         '

And they can't log in again until I change it in the
database.

Can anyone offer any ideas of where and why this might
be happening?  Is likely it the driver, the peer
service or the database?

Thanks for the help,

Chris

__________________________________________________
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Intake + Jetspeed

Posted by David Sean Taylor <da...@bluesunrise.com>.
Im trying to setup Intake with Jetspeed. 
Jetspeed currently has 2 jars:

turbine-2.2-b2-dev.jar
fulcrum-3.0-b1.jar

(1) Following the online instructions, I add 2 lines to Jetspeed's
TurbineResources.properties, 

services.IntakeService.classname=org.apache.turbine.services.intake.Turb
ineIntakeService
services.IntakeService.xml.path=WEB-INF/conf/intake.xml

It causes this error:

Turbine - A Servlet Framework for building Secure Dynamic Websites.
------------------------------------------------------------------------
--------

There has been an error! Please review the exception below for more
information.
Get/Post Data:
template = ShowError 

The exception is:
org.apache.turbine.util.security.UnknownEntityException: Failed to
create a Class object for User implementation
	at
org.apache.turbine.services.security.BaseSecurityService.getUserClass(Ba
seSecurityService.java:235)
	at
org.apache.turbine.services.security.BaseSecurityService.getUserInstance
(BaseSecurityService.java:256)
...


(2) Then tried Fulcrum.
Removed the 2 lines above from TR.p, to Fulcrum.properties added:

services.IntakeService.classname=org.apache.fulcrum.intake.TurbineIntake
Service
services.IntakeService.xml.path=WEB-INF/conf/intake.xml

Try to instantiate a new Intake object:

Intake intake = new Intake()

org.apache.fulcrum.InstantiationException: ServiceBroker: Unknown
Service 'IntakeService' requested
	at
org.apache.fulcrum.BaseServiceBroker.getServiceInstance(Unknown Source)
	at org.apache.fulcrum.BaseServiceBroker.getService(Unknown
Source)
	at org.apache.fulcrum.intake.TurbineIntake.getService(Unknown
Source)
	at org.apache.fulcrum.intake.TurbineIntake.getGroupNames(Unknown
Source)
	at org.apache.fulcrum.intake.Intake.<init>(Unknown Source)

Seems like the fulcrum service is now going back to Turbine to create
the service.
But if I add the Intake service as a Turbine service, I get the errors
described above.
Really confused. Is it possible to use Intake and Turbine-2 (and
Fulcrum) or is it just broken or under development right now?

Thanks,

David



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Trailing Spaces in SQL Server Fields

Posted by Chris Chew <ed...@yahoo.com>.
I was kind of forced to use the bridge because I can't
find the MS driver.

I have spent way too much time searching the MS site
for their driver.  The download page would come up
with little content and a file size of 0 KB.  I ended
up sending them a message Friday saying that there was
a problem.  Now all references to the driver download
page are gone.  Hopefully they get it straightened out
soon.

Unfortunately, one of the project requirements is to
make use of an existing SQL server.  Otherwise I would
be using mysql.

Again, thanks to both Eric's for the help!

Chris


--- Eric Dobbs <er...@dobbse.net> wrote:
> 
> On Sunday, April 28, 2002, at 08:33  PM, Chris K.
> Chew wrote:
> 
> > Ah, I looked into the odbc configuration and found
> "Use ANSI nulls, 
> > paddings
> > and warnings" checked.  I unchecked it, logged in,
> and sure enough...the
> > trailing spaces weren't there.  Thanks for the
> tip.
> 
> glad it helped.
> 
> > What do you use instead of ODBC?
> 
> JDBC of course.  8^)
> 
> Sun's JDBC-ODBC bridge is documented as being
> unsuitable for production deployment (last I
> looked, anyway).
> 
> We used SQL Server very briefly when marketing
> asked if we could support it.  At that time
> JDBC drivers for SQL Server were scarce or
> prohibitively expensive for our application.
> We experimented with the JDBC-ODBC bridge (which
> is when we ran into the padding problem).
> 
> Anyway, we switched to using (and bundling) SapDB.
> (http://sapdb.org)  It includes a JDBC driver.
> Haven't touched ODBC since.
> 
> -Eric
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Trailing Spaces in SQL Server Fields

Posted by Eric Pugh <ep...@upstate.com>.
I am using MSSqlServer 2000, and i find that it makes a great database.  Now
that MS has finally released their own driver (you have to dig a little on
their site) you can just use that.  Take a look at the torque documentation
on how to set it up.

Eric

-----Original Message-----
From: Eric Dobbs [mailto:eric@dobbse.net]
Sent: Sunday, April 28, 2002 11:26 PM
To: Turbine Users List
Subject: Re: Trailing Spaces in SQL Server Fields



On Sunday, April 28, 2002, at 08:33  PM, Chris K. Chew wrote:

> Ah, I looked into the odbc configuration and found "Use ANSI nulls,
> paddings
> and warnings" checked.  I unchecked it, logged in, and sure enough...the
> trailing spaces weren't there.  Thanks for the tip.

glad it helped.

> What do you use instead of ODBC?

JDBC of course.  8^)

Sun's JDBC-ODBC bridge is documented as being
unsuitable for production deployment (last I
looked, anyway).

We used SQL Server very briefly when marketing
asked if we could support it.  At that time
JDBC drivers for SQL Server were scarce or
prohibitively expensive for our application.
We experimented with the JDBC-ODBC bridge (which
is when we ran into the padding problem).

Anyway, we switched to using (and bundling) SapDB.
(http://sapdb.org)  It includes a JDBC driver.
Haven't touched ODBC since.

-Eric


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Trailing Spaces in SQL Server Fields

Posted by Eric Dobbs <er...@dobbse.net>.
On Sunday, April 28, 2002, at 08:33  PM, Chris K. Chew wrote:

> Ah, I looked into the odbc configuration and found "Use ANSI nulls, 
> paddings
> and warnings" checked.  I unchecked it, logged in, and sure enough...the
> trailing spaces weren't there.  Thanks for the tip.

glad it helped.

> What do you use instead of ODBC?

JDBC of course.  8^)

Sun's JDBC-ODBC bridge is documented as being
unsuitable for production deployment (last I
looked, anyway).

We used SQL Server very briefly when marketing
asked if we could support it.  At that time
JDBC drivers for SQL Server were scarce or
prohibitively expensive for our application.
We experimented with the JDBC-ODBC bridge (which
is when we ran into the padding problem).

Anyway, we switched to using (and bundling) SapDB.
(http://sapdb.org)  It includes a JDBC driver.
Haven't touched ODBC since.

-Eric


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Trailing Spaces in SQL Server Fields

Posted by "Chris K. Chew" <ch...@fenetics.com>.
Ah, I looked into the odbc configuration and found "Use ANSI nulls, paddings
and warnings" checked.  I unchecked it, logged in, and sure enough...the
trailing spaces weren't there.  Thanks for the tip.

What do you use instead of ODBC?

Chris


-----Original Message-----
From: Eric Dobbs [mailto:eric@dobbse.net]
Sent: Sunday, April 28, 2002 9:49 AM
To: Turbine Users List
Subject: Re: Trailing Spaces in SQL Server Fields



On Friday, April 26, 2002, at 03:21  PM, Chris Chew wrote:

> The schema is already set as VARCHAR(32).  I modified
> the mysql schema that comes with the tdk to work with
> MSSQL, which basically meant changing TIMESTAMP's to
> DATETIMES and using a more complex "IF EXISTS"
> statement.
>
> Any other ideas?

We saw something like this with ODBC settings, but I
can't remember exactly what they were (we quit using
ODBC a long time ago).  But I seem to remember a
configuration in the ODBC control panel that padded
entries with white space.

Sorry I can't be more specific.
-Eric


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Trailing Spaces in SQL Server Fields

Posted by Eric Dobbs <er...@dobbse.net>.
On Friday, April 26, 2002, at 03:21  PM, Chris Chew wrote:

> The schema is already set as VARCHAR(32).  I modified
> the mysql schema that comes with the tdk to work with
> MSSQL, which basically meant changing TIMESTAMP's to
> DATETIMES and using a more complex "IF EXISTS"
> statement.
>
> Any other ideas?

We saw something like this with ODBC settings, but I
can't remember exactly what they were (we quit using
ODBC a long time ago).  But I seem to remember a
configuration in the ODBC control panel that padded
entries with white space.

Sorry I can't be more specific.
-Eric


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Trailing Spaces in SQL Server Fields

Posted by Chris Chew <ed...@yahoo.com>.
Thanks for your reply, Eric.

The schema is already set as VARCHAR(32).  I modified
the mysql schema that comes with the tdk to work with
MSSQL, which basically meant changing TIMESTAMP's to
DATETIMES and using a more complex "IF EXISTS"
statement.

Any other ideas?

Thanks,

Chris



--- Eric Pugh <ep...@upstate.com> wrote:
> Change your database schema (assuming you can) to
> use varchar..  With SQl
> Server 2k, there are very few reasons to use char
> versus varchar..  Save's
> space too!
> 
> Eric
> 
> -----Original Message-----
> From: Chris Chew [mailto:edfairfaxvere@yahoo.com]
> Sent: Friday, April 26, 2002 2:50 PM
> To: turbine-user@jakarta.apache.org
> Subject: Trailing Spaces in SQL Server Fields
> 
> 
> Hello.
> 
> I am new to turbine and working on my first app.  I
> am
> using sql server 2000 (unfortunately), and the sun
> jdbc-odbc bridge driver.
> 
> Whenever a new record is saved (INSERT or UPDATE),
> trailing spaces get added to the field value to fill
> up the maximum allowed.  For example, everytime a
> user
> logs in, their username gets extended to the
> username
> + (32 - str.length(username)) spaces.  That is, the
> user:
> 
> 'turbine' becomes
> 'turbine                         '
> 
> And they can't log in again until I change it in the
> database.
> 
> Can anyone offer any ideas of where and why this
> might
> be happening?  Is likely it the driver, the peer
> service or the database?
> 
> Thanks for the help,
> 
> Chris
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Games - play chess, backgammon, pool and more
> http://games.yahoo.com/
> 
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Trailing Spaces in SQL Server Fields

Posted by Eric Pugh <ep...@upstate.com>.
Change your database schema (assuming you can) to use varchar..  With SQl
Server 2k, there are very few reasons to use char versus varchar..  Save's
space too!

Eric

-----Original Message-----
From: Chris Chew [mailto:edfairfaxvere@yahoo.com]
Sent: Friday, April 26, 2002 2:50 PM
To: turbine-user@jakarta.apache.org
Subject: Trailing Spaces in SQL Server Fields


Hello.

I am new to turbine and working on my first app.  I am
using sql server 2000 (unfortunately), and the sun
jdbc-odbc bridge driver.

Whenever a new record is saved (INSERT or UPDATE),
trailing spaces get added to the field value to fill
up the maximum allowed.  For example, everytime a user
logs in, their username gets extended to the username
+ (32 - str.length(username)) spaces.  That is, the
user:

'turbine' becomes
'turbine                         '

And they can't log in again until I change it in the
database.

Can anyone offer any ideas of where and why this might
be happening?  Is likely it the driver, the peer
service or the database?

Thanks for the help,

Chris

__________________________________________________
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>