JavaRush /Java блог /Архив info.javarush /Знакомство с PostgreSQL PL/Java
FedoraLinux
21 уровень
Москва

Знакомство с PostgreSQL PL/Java

Статья из группы Архив info.javarush
Ебанарот, сложновата она все-таки слегка. Данная статья является переводом статьи "Introduction to PostgeSQL PL/Java". Современные базы данных поддерживают хранимые процедуры, написанные на различных языках. Я не знаю как это перевести. Modern databases allow stored procedures to be written in a variety of languages. One commonly implemented language is java.N.B., this article discusses the PostgreSQL-specific java implementation. The details will vary with other databases but the concepts will be the same. Установка PL/Java Установка PL/Java в Ubuntu проста. Я сначала создам новый шаблон, template_java, так что я пока могу создавать базы данных без расширения PL/Java. Installation of PL/Java on an Ubuntu system is straightforward. I will first create a new template, template_java, so I can still create databases without the pl/java extensions. В консоли от имени суперпользователя (root) введите следующее: # apt-get install postgresql-9.1 # apt-get install postgresql-9.1-pljava-gcj $ createdb template_java $ psql -d template_java -c 'update db_database set datistemplate='t' where datnam='template_java'' $ psql -d template_java -f /usr/share/postgresql-9.1-pljava/install.sql Ограничения Собранные пакеты для Ubuntu используют GCJ Java реализацию, а не стандартный OpenJDK или Sun JDK. GCJ компилирует исходные файлы Java в нативные объектные коды вместо того, чтобы компилироваться в байт-код. The prepackaged Ubuntu package uses the Gnu GCJ java implementation, not a standard OpenJDK or Sun implementation. GCJ compiles java source files to native object code instead of byte code. The most recent versions of PL/Java are “trusted” – they can be relied upon to stay within their sandbox. Among other things this means that you can’t access the filesystem on the server. If you must break the trust there is a second language, ‘javaU’, that can be used. Untrusted functions can only be created a the database superuser.
Комментарии
ЧТОБЫ ПОСМОТРЕТЬ ВСЕ КОММЕНТАРИИ ИЛИ ОСТАВИТЬ КОММЕНТАРИЙ,
ПЕРЕЙДИТЕ В ПОЛНУЮ ВЕРСИЮ