精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2007-05-26
熟悉Flex 的开发者都知道,在Flex中不能直接访问数据库,而是采用HTTPService/WebService/RemoteObject等方式实现。asSQL的出现多少让大家感到意外(抛开这两种方式的优劣不提),也可见它的威力。 xml 代码
将操作结果保存到lastResult中,因此它可作为数据源(data provider)供其它组件(如DataGrid)使用,如下所示:<o:p></o:p> xml 代码
在一个按钮click事件中,调用myService.send('SELECT userid,email,firstname FROM account;')即可触发上述DataGrid加载数据。 MysqlService支持3个事件,分别是results、response和errors,供调用者定制操作结果。 <o:p></o:p> ActionScript 代码
3. 示例 asSQL目前仅支持mySQL,它以UI组件的形式供用户调用,并以数据源的形式把数据和UI组件绑定。 开发环境:Flex Builder 2,以及MySql 5,还有Spring <st1:chsdate month="12" islunardate="False" day="30" year="1899" w:st="on" isrocdate="False">1.2.8</st1:chsdate>中实例JPetStore的Schema。 步骤1:MySQL中建立一个叫做JPetStore的Database。并把JPetStore的Schema导入其中。 步骤2:从http://maclema.com/assql/downloads/asSQL-0.1alpha.swc下载asSQL SWC 步骤3:新建Flex Project项目,然后选中项目根目录,右键Properties->Flex Build Path->Library Path;点击右侧按钮Add SWC,在浏览窗口找到刚下载的SWC文件。 步骤4:编辑Flex的界面元素,增加1个ComboBox和1个DataGrid,以及2个按钮。然后编辑MXML文件。 附件是运行界面和源代码。 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |
发表时间:2007-05-27
客户端直接链接数据库,安全如何保证?
|
|
返回顶楼 | |
发表时间:2007-05-27
顶顶jindw.
如此原则性的问题,冒昧地说句,不能乱来! |
|
返回顶楼 | |
发表时间:2007-05-27
Name: Matt MacLean
Hometown: Calgary, AB, Canada Birthday: June 11, 1986 Employer: Essentialtalk Languages: AS3, Java, Javascript, C# and whatever else I need to learn. 作者信息。 牛,86年人,看示例的提示筐是简体中文,和大中华有何渊源,呵呵? |
|
返回顶楼 | |
发表时间:2007-05-27
玩Flash的很多的都是平面 、code 双轨能力很强的人
如果作者属于这种人,那真是牛。 |
|
返回顶楼 | |
发表时间:2007-05-27
呵呵,仔细看了一下,安全性还是有考虑的。
原文: Scrambling operations The client first calculates hash1 = SHA1(password), then hash2 = SHA1(hash1). The server already knows this, as that is what is held in its password table (preceded with a *). It then appends hash2 to the salt sent by the server and hashes that, and finally exclusive ors the result with hash1. So it sends to the server SHA1(password) XOR SHA1(salt.SHA1(SHA1(password)). The server does effectively the same calculation and checks the result (though for some reason it prefers to undo the Exclusive-OR and compare with hash1). |
|
返回顶楼 | |
发表时间:2007-05-27
安全问题的确不能忽视。
MySQL Client/Server通讯协议大体流程(仅介绍客户认证过程): 1.客户与Server连接建立,服务器向客户端发生握手包( Handshake Initialization Packet)也叫做问候包,其中还包含了Server信息如版本号、线程号,此外还有服务器的capabilities以及最重要的scramble_buff字段包含用于实现客户认证的crypt_seed。 2.客户认证包仍然包含scramble_buff字段,存放SHA1加密后的数据。 The server sends a random string to the client, in scramble_buff. The client encrypts the scramble_buff value using the password that the user enters. This happens in sql/password.c:scramble() function. The client sends the encrypted scramble_buff value to the server. The server encrypts the original random string using a value in the mysql database, mysql.user.Password. The server compares its encrypted random string to what the client sent in scramble_buff. If they are the same, the password is okay. 由于和AJAX关系不大,此处简单的描述一下,更多信息请参考http://forge.mysql.com/wiki/MySQL_Internals_ClientServer_Protocol。 此外,服务器端有一道防止外部非法链接访问的安全屏障:security sandbox。可设置授权访问域。 |
|
返回顶楼 | |
发表时间:2007-05-31
数据访问写在客户界面层了?
|
|
返回顶楼 | |
发表时间:2007-06-12
你的例子程序不能运行!连接不上数据库呀!
|
|
返回顶楼 | |
浏览 9249 次