| Deutsch English Français Italiano |
|
<vmjk5b$2c8i2$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: =?UTF-8?Q?Arne_Vajh=C3=B8j?= <arne@vajhoej.dk> Newsgroups: comp.os.vms Subject: PJBS for Python Date: Sun, 19 Jan 2025 14:35:07 -0500 Organization: A noiseless patient Spider Lines: 80 Message-ID: <vmjk5b$2c8i2$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 19 Jan 2025 20:35:08 +0100 (CET) Injection-Info: dont-email.me; posting-host="0095b2781b90b916884592bbea783d60"; logging-data="2499138"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19BLfB4yMowyEC4w14yaQ2kYfbpYQcW6sE=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:doniybdPfMY2HJgannylVhq2glo= Content-Language: en-US Bytes: 3279 There is a PJBS open source project at: https://sourceforge.net/projects/pjbs/ which has been forked at: https://github.com/JCotton1123/php-jdbc-bridge It allows PHP applications to access a database using a JDBC driver. It works like: PHP app with PJBridge class-->proxy process with JDBC driver-->database PJBridge.php is very simple so it was easy to convert to Python: Python app with PJBridge class-->proxy process with JDBC driver-->database And I even created a DB API 2.0 layer on top of it to be more Pythonesque: Python app with PJBS and PJBridge classes-->proxy process with JDBC driver-->database And it seems to work reasonable well. There are a few things to be aware: * data are always returned as string so numeric data need to be manual converted. * no support for database transaction * I have not tested error handling or performance * very limited functional testing so lot of stuff may be missing (feel free to add it!) This tool is not particular interesting on common platforms like Linux and Windows as both PHP and Python has drivers for almost all databases available there. But it is a bit more interesting on VMS as a driver for VMS is not a top priority for most language projects and database vendors. But the database vendors usually provide a type 4 JDBC driver. A type 4 JDBC driver is a pure Java JDBC driver, which means that you can copy the jar file from Linux/Windows to VMS and it works. So with: portable PHP/Python API-->portable Java proxy-->portable type 4 JDBC driver it all works even if the language project and the database vendor has not even heard about VMS! And this is not just theory. I have tested with: - MySQL - PostgreSQL - Oracle DB - thin - IBM DB2 - MS SQLServer - SQLite (*) - Derby - H2 - HSQLDB And previously I have tested PJBS with: - Rdb - native (*) - Rdb - thin - Mimer *) Type 2 not type 4 so VMS version required! I would group them in: * PHP/Python drivers available (or will be available) on VMS: MySQL, PostgreSQL, SQLite * not interesting for PHP/Python developers (they will prefer SQLIte): Derby, H2, HSQLDB * potential relevance of PJBS: Oracle DB, IBM DB2, MS SQLServer If anyone want to play with it then it is available at: https://www.vajhoej.dk/arne/vmsstuff/pjbs/ Arne