gtk2 :: ex :: ½º·¹µå :: dbi.PERL ITHREADS¸¦ »ç¿ëÇÏ¿© GTK2-Perl ÀÀ¿ë ÇÁ·Î±×·¥ÀÇ ±â´É°ú °°Àº ºñµ¿±â DBI ´Þ¼º | |
Áö±Ý ´Ù¿î·Îµå |
gtk2 :: ex :: ½º·¹µå :: dbi. ¼øÀ§ ¹× ¿ä¾à
±¤°í
- ƯÇã:
- Perl Artistic License
- °¡°Ý:
- FREE
- °Ô½ÃÀÚ À̸§:
- Ofey Aikon
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- http://search.cpan.org/~ofeyaikon/
gtk2 :: ex :: ½º·¹µå :: dbi. ű×
gtk2 :: ex :: ½º·¹µå :: dbi. ¼³¸í
Perl ITHreads¸¦ »ç¿ëÇÏ¿© GTK2-Perl ÀÀ¿ë ÇÁ·Î±×·¥À»À§ÇÑ ºñµ¿±â DBI¿Í °°Àº ºñµ¿±â DBI¸¦ ´Þ¼ºÇϱâ gtk2 :: ex :: threads :: dbi´Â perl iithreadsÀÇ »ç¿ëÀ» ÅëÇØÀÌ ±â´ÉÀ» ´Þ¼ºÇÏ´Â µ¥ µµ¿òÀ̵Ǵ perl ¸ðµâÀÔ´Ï´Ù. º°µµÀÇ thread.synopsis¿¡¼ ÄݹéÀ» »ç¿ëÇÏ¿© ºñµ¿±â½Ä DBI¿Í °°Àº ±â´ÉÀÌ ´Þ¼ºµË´Ï´Ù. glib qw (true false)¸¦ »ç¿ëÇϽʽÿÀ GTK2 QW / -INIT -Threads-init /; gtk2 :: ex :: threads :: dbi; ÀúÀå °¡´ÉÇÑ QW (µ¿°á ÇØÁ¦)¸¦ »ç¿ëÇϽʽÿÀ. MY $ mythread = gtk2 :: ex :: threads :: dbi-> new ({dsn => dbi : mysql : test : localhost ', user => root', passwd => 'test', attr => @ RasterError => 1, autocommit => 0}}); $ Query = $ mythread-> register_query (Undef, \ call_sql, \ call_back); $ mythread-> start (); ³» $ ¹öÆ° = GTK2 :: Button-> New ( 'ÆÐÅÏ »ç¿ë Å×ÀÌºí¿¡¼ µ¥ÀÌÅÍ °¡Á® ¿À±â'); $ ¹öÆ° -> signal_connect (clicked => sub {my $ pattern = $ entry-> get_text (); # pattern $ query-> ½ÇÇà ();}); #ÀÌ ÇÔ¼ö´Â ½º·¹µå ÇÏÀ§ È£Ãâ ³»ºÎ¿¡¼ È£ÃâµË´Ï´Ù. {MY ($ dbh, $ sqlarams) = @_; MY $ PARAMS = THAW $ SQLARAMS; My $ sth = $ dbh-> Áغñ (QQ {# xxx¿¡¼ ¼±Åà *¸¦ ¿Ï·áÇÏ´Â µ¥ ¿À·£ ½Ã°£ÀÌ °É¸®´Â ½Ã°£ÀÌ ¿À·¡ °É¸®Áö ¾Ê´Â QQ {# Limit 1000}); $ sth-> ½ÇÇà ( '%'. $ params -> . '%'); ³» @result_array; while (my @ary = $ sth-> fetchrow_array ()) {Ǫ½Ã @Result_Array, \ @ary; } return \ @result_array; } #ÀÌ ÇÔ¼ö´Â SQL ½ÇÇà ÇÏÀ§ Call_back ÀÌÈÄ ½º·¹µå ³»ºÎ¿¡¼ È£ÃâµË´Ï´Ù {My ($ self, $ result_array) = @_; @ {$ ½½¸®ÇÁ -> {data}} = (); # ¿ì¸®´Â µ¥ÀÌÅ͸¦ À§Á¶ÇÏ¿© ´Ü¼ø¸®½ºÆ®¸¦ ä ¿ó´Ï´Ù (THAW $ RETERN_ARRAY) {Ǫ½Ã @ {$ slist -> {data}}, @ $ x; }} ¿ä±¸ »çÇ× : ¡¤ Perl.
gtk2 :: ex :: ½º·¹µå :: dbi. °ü·Ã ¼ÒÇÁÆ®¿þ¾î