Accessing PostgresSQL or MySQL with Squeak

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

Accessing PostgresSQL or MySQL with Squeak

Sau Sheong
Hi,

I'm quite new in Smalltalk and Squeak (a few days only) though I've been
doing Java and Ruby for some time now. One of the things I wanted to do
is to try to access to a relational DB through Squeak, either
PostgresSQL or MySQL. I've tried the following:

1. Jim Maynard's Squeak-PosgresSQL client -- can't seem to connect
2. Yanni Chiu's PostgreSQL Client for Squeak -- downloaded it but not
sure how to use it
3. MySQL driver at http://squeak.reider.net/mysql/ -- throws an error
requesting me to change my MySQL client (I'm using MySQL Server 4.1 though)

Anyone from this list can help? I'm planning to write a comprehensive
tutorial on how to create a simple web application using Seaside and
Squeak, and if possible a relational database. I found that there is
really a lack of such a tutorial for someone who is not from a
Smalltalk/Squeak background and I would like to contribute such a
tutorial. However I'm stuck myself on the relational database part,
would appreciate help here. Thanks!

--
CHANG Sau Sheong


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Accessing PostgresSQL or MySQL with Squeak

Boris Popov, DeepCove Labs (SNN)
Re: [Seaside] Accessing PostgresSQL or MySQL with Squeak

While someone here is certain to have an answer for you, I imagine Squeak list may hold more answers from people who don't use seaside per se, see attached.

Regards,

-Boris


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

Squeak .vcf (226 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

AW: Accessing PostgresSQL or MySQL with Squeak

Tibbe David
In reply to this post by Sau Sheong
Hi,

We use Mysql-Driver from Josh Miller and it works quite fine.
You can load it via the Squeak Map Package Loader.
When using it with MySQL 5, you have to store the user's passwords with the OLD_PASSWORD()-function, everything else should work fine.

Regards,
  David

-----Ursprüngliche Nachricht-----
Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Chang Sau Sheong
Gesendet: Freitag, 10. November 2006 16:18
An: The Squeak Enterprise Aubergines Server - general discussion.
Betreff: [Seaside] Accessing PostgresSQL or MySQL with Squeak

Hi,

I'm quite new in Smalltalk and Squeak (a few days only) though I've been doing Java and Ruby for some time now. One of the things I wanted to do is to try to access to a relational DB through Squeak, either PostgresSQL or MySQL. I've tried the following:

1. Jim Maynard's Squeak-PosgresSQL client -- can't seem to connect 2. Yanni Chiu's PostgreSQL Client for Squeak -- downloaded it but not sure how to use it 3. MySQL driver at http://squeak.reider.net/mysql/ -- throws an error requesting me to change my MySQL client (I'm using MySQL Server 4.1 though)

Anyone from this list can help? I'm planning to write a comprehensive tutorial on how to create a simple web application using Seaside and Squeak, and if possible a relational database. I found that there is really a lack of such a tutorial for someone who is not from a Smalltalk/Squeak background and I would like to contribute such a tutorial. However I'm stuck myself on the relational database part, would appreciate help here. Thanks!

--
CHANG Sau Sheong


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Accessing PostgresSQL or MySQL with Squeak

Benoit St-Jean
In reply to this post by Sau Sheong

--- Chang Sau Sheong <[hidden email]> wrote:

> Hi,
>
> I'm quite new in Smalltalk and Squeak (a few days
> only) though I've been
> doing Java and Ruby for some time now. One of the
> things I wanted to do
> is to try to access to a relational DB through
> Squeak, either
> PostgresSQL or MySQL. I've tried the following:

Check this:

http://map.squeak.org/package/ba5582d8-4e50-417c-abd1-07dcd5c4d7b2

Last time I tried, it was working fine.

-----------------
Benoit St-Jean
Yahoo! Messenger: bstjean
Blog: lamneth.wordpress.com
A standpoint is an intellectual horizon of radius zero.
(Albert Einstein)
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Accessing PostgresSQL or MySQL with Squeak

Yanni Chiu
In reply to this post by Sau Sheong
Chang Sau Sheong wrote:
> 2. Yanni Chiu's PostgreSQL Client for Squeak -- downloaded it but not
> sure how to use it

See the class TestPGConnection. The test code there shows
example usage.

I'll update the SqueakMap description. I had not realized
that new users would have this problem of figuring out
where to look for examples.

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Accessing PostgresSQL or MySQL with Squeak

Benjamin Pollack
In reply to this post by Sau Sheong
On 11/10/06, Chang Sau Sheong <[hidden email]> wrote:

> Hi,
>
> I'm quite new in Smalltalk and Squeak (a few days only) though I've been
> doing Java and Ruby for some time now. One of the things I wanted to do
> is to try to access to a relational DB through Squeak, either
> PostgresSQL or MySQL. I've tried the following:
>
> 1. Jim Maynard's Squeak-PosgresSQL client -- can't seem to connect
> 2. Yanni Chiu's PostgreSQL Client for Squeak -- downloaded it but not
> sure how to use it

Both PostgreSQL drivers only do password (i.e., plain-text)
authentication, which is disabled by default in PostgreSQL for
security reasons. You will need to go edit your database's pg_hba.conf
and add a line that looks something like

host   all     127.0.0.1    255.255.255.255     password

and then set up users and passwords using the normal PostgreSQL tools.
For more information, please read
http://www.postgresql.org/docs/8.1/static/client-authentication.html .

--Benjamin
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: AW: Accessing PostgresSQL or MySQL with Squeak

Sau Sheong
In reply to this post by Tibbe David
Thks! That's precisely what I did and it works now.

BTW, are there any samples where I can look at? This is my main source
of information -- http://130.207.118.114/squeak/1972

Tibbe David wrote:

> Hi,
>
> We use Mysql-Driver from Josh Miller and it works quite fine.
> You can load it via the Squeak Map Package Loader.
> When using it with MySQL 5, you have to store the user's passwords with the OLD_PASSWORD()-function, everything else should work fine.
>
> Regards,
>   David
>
> -----Ursprüngliche Nachricht-----
> Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Chang Sau Sheong
> Gesendet: Freitag, 10. November 2006 16:18
> An: The Squeak Enterprise Aubergines Server - general discussion.
> Betreff: [Seaside] Accessing PostgresSQL or MySQL with Squeak
>
> Hi,
>
> I'm quite new in Smalltalk and Squeak (a few days only) though I've been doing Java and Ruby for some time now. One of the things I wanted to do is to try to access to a relational DB through Squeak, either PostgresSQL or MySQL. I've tried the following:
>
> 1. Jim Maynard's Squeak-PosgresSQL client -- can't seem to connect 2. Yanni Chiu's PostgreSQL Client for Squeak -- downloaded it but not sure how to use it 3. MySQL driver at http://squeak.reider.net/mysql/ -- throws an error requesting me to change my MySQL client (I'm using MySQL Server 4.1 though)
>
> Anyone from this list can help? I'm planning to write a comprehensive tutorial on how to create a simple web application using Seaside and Squeak, and if possible a relational database. I found that there is really a lack of such a tutorial for someone who is not from a Smalltalk/Squeak background and I would like to contribute such a tutorial. However I'm stuck myself on the relational database part, would appreciate help here. Thanks!
>
> --
> CHANG Sau Sheong
>
>
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>  


--
CHANG Sau Sheong

http://blog.saush.com - brain dump
http://jaccal.sourceforge.net - smart card toolkit
http://screensvr.rubyforge.org - Flickr screensaver
http://ced.dev.java.net - Chinese-English Dictionary
http://www.projectible.com - online project publishing

Fellow, Singapore Institute of Arbitrators

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Accessing PostgresSQL or MySQL with Squeak

Sau Sheong
In reply to this post by Benoit St-Jean
Thank you for your suggestion, this is something I had not thought of.

Benoit St-Jean wrote:
--- Chang Sau Sheong [hidden email] wrote:

  
Hi,

I'm quite new in Smalltalk and Squeak (a few days
only) though I've been
doing Java and Ruby for some time now. One of the
things I wanted to do
is to try to access to a relational DB through
Squeak, either
PostgresSQL or MySQL. I've tried the following:
    

Check this:

http://map.squeak.org/package/ba5582d8-4e50-417c-abd1-07dcd5c4d7b2

Last time I tried, it was working fine.

-----------------
Benoit St-Jean
Yahoo! Messenger: bstjean
Blog: lamneth.wordpress.com
A standpoint is an intellectual horizon of radius zero.
(Albert Einstein)

  


-- 
CHANG Sau Sheong

http://blog.saush.com - brain dump
http://jaccal.sourceforge.net - smart card toolkit
http://screensvr.rubyforge.org - Flickr screensaver
http://ced.dev.java.net - Chinese-English Dictionary
http://www.projectible.com - online project publishing

Fellow, Singapore Institute of Arbitrators

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Re: Accessing PostgresSQL or MySQL with Squeak

Sau Sheong
In reply to this post by Yanni Chiu
Thks! I guess my main problem is that I am really very new to Squeak and
Smalltalk, and even accessing basic functions took me some time. I'm
still paddling very hard!

Yanni Chiu wrote:

> Chang Sau Sheong wrote:
>> 2. Yanni Chiu's PostgreSQL Client for Squeak -- downloaded it but not
>> sure how to use it
>
> See the class TestPGConnection. The test code there shows
> example usage.
>
> I'll update the SqueakMap description. I had not realized
> that new users would have this problem of figuring out
> where to look for examples.
>
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>


--
CHANG Sau Sheong

http://blog.saush.com - brain dump
http://jaccal.sourceforge.net - smart card toolkit
http://screensvr.rubyforge.org - Flickr screensaver
http://ced.dev.java.net - Chinese-English Dictionary
http://www.projectible.com - online project publishing

Fellow, Singapore Institute of Arbitrators

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Accessing PostgresSQL or MySQL with Squeak

Yanni Chiu
In reply to this post by Benjamin Pollack
Benjamin Pollack wrote:
>> 2. Yanni Chiu's PostgreSQL Client for Squeak -- downloaded it but not
>> sure how to use it
>
>
> Both PostgreSQL drivers only do password (i.e., plain-text)
> authentication...

Actually, thanks to a user contribution, it does MD5 too.
You have to load the Cryptography package first, before
loading the postgres driver.

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Accessing PostgresSQL or MySQL with Squeak

Yanni Chiu
In reply to this post by Sau Sheong
Chang Sau Sheong wrote:
> Thks! I guess my main problem is that I am really very new to Squeak and
> Smalltalk, and even accessing basic functions took me some time. I'm
> still paddling very hard!

I've added a package called SimpleSeasidePostgresExample,
to the postgres repository on squeaksource.com.

Try this link:

    http://www.squeaksource.com/PostgresV2.html

and click on the "Wiki" link. I've written a quick start
guide to getting a postgres backed Seaside app. If you're
new to Squeak/Seaside, you'll have to find other resources
to get you up to speed on those.

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Re: Accessing PostgresSQL or MySQL with Squeak

Benoit St-Jean
Your link doesn't work Yanni.

--- Yanni Chiu <[hidden email]> wrote:
> I've added a package called
> SimpleSeasidePostgresExample,
> to the postgres repository on squeaksource.com.
>
> Try this link:
>
>     http://www.squeaksource.com/PostgresV2.html


-----------------
Benoit St-Jean
Yahoo! Messenger: bstjean
Blog: lamneth.wordpress.com
A standpoint is an intellectual horizon of radius zero.
(Albert Einstein)
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Accessing PostgresSQL or MySQL with Squeak

Yanni Chiu
Benoit St-Jean wrote:

> Your link doesn't work Yanni.
>
> --- Yanni Chiu <[hidden email]> wrote:
>
>>I've added a package called
>>SimpleSeasidePostgresExample,
>>to the postgres repository on squeaksource.com.
>>
>>Try this link:
>>
>>    http://www.squeaksource.com/PostgresV2.html

I just tried it, and it works here. This is a standard
feature of SqueakSource - you should be able to use
www.squeaksource.com/<project-id>, for any project.

Well, if the the doesn't work for you then you'll
have to use the project search feature on SqueakSource.

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Re: Accessing PostgresSQL or MySQL with Squeak

Sau Sheong
Thks! This is very helpful!

Yanni Chiu wrote:

> Benoit St-Jean wrote:
>> Your link doesn't work Yanni.
>>
>> --- Yanni Chiu <[hidden email]> wrote:
>>
>>> I've added a package called
>>> SimpleSeasidePostgresExample,
>>> to the postgres repository on squeaksource.com.
>>>
>>> Try this link:
>>>
>>>    http://www.squeaksource.com/PostgresV2.html
>
> I just tried it, and it works here. This is a standard
> feature of SqueakSource - you should be able to use
> www.squeaksource.com/<project-id>, for any project.
>
> Well, if the the doesn't work for you then you'll
> have to use the project search feature on SqueakSource.
>
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>


--
CHANG Sau Sheong

http://blog.saush.com - brain dump
http://jaccal.sourceforge.net - smart card toolkit
http://screensvr.rubyforge.org - Flickr screensaver
http://ced.dev.java.net - Chinese-English Dictionary
http://www.projectible.com - online project publishing

Fellow, Singapore Institute of Arbitrators

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Accessing PostgresSQL or MySQL with Squeak

Ron Teitelbaum
In reply to this post by Sau Sheong
Hi Sau Sheong,

I am using the postgresV2 client.  I had to make one change to get it to
work.

On the method

PGConnection > execute: sqlString

Add the following line at the top.

sqlString ifEmpty: [^nil].

You can find the client on squeakMap, and I believe on www.squeakSource.com

I'm using Glorp as the mapping software between smalltalk and the database.
Glorp was written by the same guys that did TopLink, and it's really good,
although there are a few gotchas.  (But there are still some gotchas in
PostGreSQL :)

If you need some help getting it working let me know, it works great with
seaside.

I just added a zipcode lookup that is really cool, and it only took a few
minutes to get it working!  I'm still amazed at how nicely seaside, the
async stuff, glorp and postgres all work together, it is too cool!

Ron Teitelbaum
President / Principal Software Engineer
US Medical Record Specialists
[hidden email]



> -----Original Message-----
> From: [hidden email] [mailto:seaside-
> [hidden email]] On Behalf Of Chang Sau Sheong
> Sent: Friday, November 10, 2006 10:18 AM
> To: The Squeak Enterprise Aubergines Server - general discussion.
> Subject: [Seaside] Accessing PostgresSQL or MySQL with Squeak
>
> Hi,
>
> I'm quite new in Smalltalk and Squeak (a few days only) though I've been
> doing Java and Ruby for some time now. One of the things I wanted to do
> is to try to access to a relational DB through Squeak, either
> PostgresSQL or MySQL. I've tried the following:
>
> 1. Jim Maynard's Squeak-PosgresSQL client -- can't seem to connect
> 2. Yanni Chiu's PostgreSQL Client for Squeak -- downloaded it but not
> sure how to use it
> 3. MySQL driver at http://squeak.reider.net/mysql/ -- throws an error
> requesting me to change my MySQL client (I'm using MySQL Server 4.1
> though)
>
> Anyone from this list can help? I'm planning to write a comprehensive
> tutorial on how to create a simple web application using Seaside and
> Squeak, and if possible a relational database. I found that there is
> really a lack of such a tutorial for someone who is not from a
> Smalltalk/Squeak background and I would like to contribute such a
> tutorial. However I'm stuck myself on the relational database part,
> would appreciate help here. Thanks!
>
> --
> CHANG Sau Sheong
>
>
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside