digitalmars.D - Database of practicality will be an important factor for development
- FrankLike (19/19) Feb 01 2017 A good language, powerful performance is on the one hand, but,
- aberba (18/37) Feb 02 2017 I use mysql with for vibe.d project and either mysql-lited or
- FrankLike (2/8) Feb 06 2017 I love D,thank for your answer.
- Adam D. Ruppe (4/7) Feb 02 2017 db.query("CALL my_procedure(args...)");
- Shachar Shemesh (8/13) Feb 02 2017 Generally speaking, you really don't want to do that. Ever. This code is...
- Adam D. Ruppe (14/19) Feb 02 2017 I know. That's exactly what my library does, and I assume all the
- Jack Applegame (3/20) Feb 06 2017 Do you really think that Adam does not know what is SQL-injection?
- FrankLike (8/15) Feb 06 2017 The first,thank your arsd,it's good for mssql.
- Adam D. Ruppe (2/3) Feb 06 2017 idk, I have never used that one.
- FrankLike (16/17) Feb 06 2017 Please help me,thank you.
- Adam D. Ruppe (7/12) Feb 06 2017 Process one result before trying to do another query. If you need
- FrankLike (4/17) Feb 06 2017 Thank you. Yes,I do it now,but I find the mysql-Native can do
A good language, powerful performance is on the one hand, but, first of all is practical. No language does not involve the database, because the database practical? Because the basic work is good and practical! There was a language is born for the database, it's called PowerBuilder, because it did not keep up with the development of the Internet era (B / S architecture), and their own development is not good, and later replaced by Java. But now, D even C / S architecture is not doing a good job. Java can do, but D can not do! For example, I want to do the execution of stored procedure for MSSql、MySQL database. I found in Mysql-d, Mysql-Native, arsd, DDBC, etc. there is no result. Therefore, the project had to give the practicality of database in D , is the basis for the development of D, will determine the future of D! Frank
Feb 01 2017
On Thursday, 2 February 2017 at 05:33:57 UTC, FrankLike wrote:A good language, powerful performance is on the one hand, but, first of all is practical. No language does not involve the database, because the database practical? Because the basic work is good and practical! There was a language is born for the database, it's called PowerBuilder, because it did not keep up with the development of the Internet era (B / S architecture), and their own development is not good, and later replaced by Java. But now, D even C / S architecture is not doing a good job. When I'm ready to use D, but found the poor practicality! C For example, I want to do the execution of stored procedure for MSSql、MySQL database. I found in Mysql-d, Mysql-Native, arsd, DDBC, etc. there is no result. Therefore, the project had the practicality of database in D , is the basis for the development of D, will determine the future of D! FrankI use mysql with for vibe.d project and either mysql-lited or mysql-native works well for me. There seem to be no mssql package though (because few people will pay to use unless it fetch them enough money for what it is worth). I agree there are still more packages needed but they increase week by week as I've been observing. I personally REALLY need an Amazon S3 api but vibe-s3 maintainer hasn't gotten enough time to work on it and there almost no contributions (even for S3 which is popular/the defacto in the cloud storage world). I know it sucks when you can't do it for yourself. But we can only hope more people get motivated to contribute packages to dub. I'm quite impressed by the few companies in Github contributing/submitting their production packages to dub registry. It is only getting better day in day out. I don't know if there is anything the D Foundation can and will do about that :)
Feb 02 2017
On Thursday, 2 February 2017 at 12:41:06 UTC, aberba wrote:On Thursday, 2 February 2017 at 05:33:57 UTC, FrankLike wrote:I use mysql with for vibe.d project and either mysql-lited or mysql-native works well for me. There seem to be no mssql package though (because few people will pay to use unless it fetch them enough money for what it is worth). [...]I love D,thank for your answer.
Feb 06 2017
On Thursday, 2 February 2017 at 05:33:57 UTC, FrankLike wrote:For example, I want to do the execution of stored procedure for MSSql、MySQL database. I found in Mysql-d, Mysql-Native, arsd, DDBC, etc. there is no result.db.query("CALL my_procedure(args...)"); Should work with any libraries. Stored procedure calls are just another sql string.
Feb 02 2017
On 02/02/17 14:50, Adam D. Ruppe wrote:On Thursday, 2 February 2017 at 05:33:57 UTC, FrankLike wrote:Generally speaking, you really don't want to do that. Ever. This code is how SQL injection vulnerabilities are born. Arguments should ALWAYS be passed out of line of the actual call command, so that the server has no chance of confusing arguments and commands. Sadly, that typically requires a DB library specific to the DB in use. ShacharFor example, I want to do the execution of stored procedure for MSSql、MySQL database. I found in Mysql-d, Mysql-Native, arsd, DDBC, etc. there is no result.db.query("CALL my_procedure(args...)");
Feb 02 2017
On Thursday, 2 February 2017 at 13:28:48 UTC, Shachar Shemesh wrote:Arguments should ALWAYS be passed out of line of the actual call command, so that the server has no chance of confusing arguments and commands.I know. That's exactly what my library does, and I assume all the others listed; `args...` there is a placeholder for binded arguments (the actual call might look something like `db.query("CALL proc(?, ?)", arg, arg2);` or similar). But CALL works the same way as UPDATE, SELECT, INSERT, etc., you can do it in sql without needing a special api function to use it.Sadly, that typically requires a DB library specific to the DB in use.Every generic DB library I have ever seen abstracts placeholder arguments and most do prepared statements, which also abstract such things gnerically. I didn't mention it in my example because EVERYONE (except like universally recognized garbage like php4 lol, but I'll even exclude it because its api isn't generic) does it and I assumed that'd be common knowledge.
Feb 02 2017
On Thursday, 2 February 2017 at 13:28:48 UTC, Shachar Shemesh wrote:On 02/02/17 14:50, Adam D. Ruppe wrote:Do you really think that Adam does not know what is SQL-injection?On Thursday, 2 February 2017 at 05:33:57 UTC, FrankLike wrote:Generally speaking, you really don't want to do that. Ever. This code is how SQL injection vulnerabilities are born. Arguments should ALWAYS be passed out of line of the actual call command, so that the server has no chance of confusing arguments and commands. Sadly, that typically requires a DB library specific to the DB in use. ShacharFor example, I want to do the execution of stored procedure for MSSql、MySQL database. I found in Mysql-d, Mysql-Native, arsd, DDBC, etc. there is no result.db.query("CALL my_procedure(args...)");
Feb 06 2017
On Thursday, 2 February 2017 at 12:50:02 UTC, Adam D. Ruppe wrote:On Thursday, 2 February 2017 at 05:33:57 UTC, FrankLike wrote:The first,thank your arsd,it's good for mssql. But mysqlnative.d is not good. Please look at this: Failed: mysql.protocol.packets.MySQLReceivedException mysql\protocol\commands.d(721): MySQL error: PROCEDURE mydb.myProcedure can't return a result set in the given context Thanks. FrankFor example, I want to do the execution of stored procedure for MSSql、MySQL database. I found in Mysql-d, Mysql-Native, arsd, DDBC, etc. there is no result.db.query("CALL my_procedure(args...)"); Should work with any libraries. Stored procedure calls are just another sql string.
Feb 06 2017
On Monday, 6 February 2017 at 12:30:11 UTC, FrankLike wrote:But mysqlnative.d is not good.idk, I have never used that one.
Feb 06 2017
On Monday, 6 February 2017 at 14:04:37 UTC, Adam D. Ruppe wrote:On Monday, 6 February 2017 at 12:30:11 UTC, FrankLike wrote:Please help me,thank you. 1. arsd.database.ResultSet MSa = MSSqlCon.query(someCmd1); arsd.database.ResultSet MSb = MSSqlCon.query(someCmd2); int icolNumA = MSa.fieldNames.length; int icolNumB = MSb.fieldNames.length; arsd.database.DatabaseException ..\arsd\mssql.d(63): [Microsoft][ODBC SQL Server Driver]The connection is busy resulting in another hstmt 2.When I run the exe file on another computer(run "ping" is ok),get the err: std.socket.SocketOSException std\socket.d(2755): Unable to connect socket: Can not connect because the target computer actively refused. Thank you. Frank
Feb 06 2017
On Monday, 6 February 2017 at 14:17:39 UTC, FrankLike wrote:[Microsoft][ODBC SQL Server Driver]The connection is busy resulting in another hstmtProcess one result before trying to do another query. If you need the data stored, you can do foreach and save the parts you want to an array (it returns strings for all data types so you can append it to a string[])std.socket.SocketOSException std\socket.d(2755): Unable to connect socket: Can not connect because the target computer actively refused.Check the firewall or connection accept settings on the computer running the database server, it is probably blocking you.
Feb 06 2017
On Monday, 6 February 2017 at 14:27:24 UTC, Adam D. Ruppe wrote:On Monday, 6 February 2017 at 14:17:39 UTC, FrankLike wrote:Thank you. Yes,I do it now,but I find the mysql-Native can do like this.[Microsoft][ODBC SQL Server Driver]The connection is busy resulting in another hstmtProcess one result before trying to do another query. If you need the data stored, you can do foreach and save the parts you want to an array (it returns strings for all data types so you can append it to a string[])Thank you.I test it tomorrow.std.socket.SocketOSException std\socket.d(2755): Unable to connect socket: Can not connect because the target computer actively refused.Check the firewall or connection accept settings on the computer running the database server, it is probably blocking you.
Feb 06 2017