При дословном выполнении кода из ссылки Amazon функция драйвера не найдена.Я установил и загрузил пакет RJDBC, однако, функция JDBC не может быть найдена.Пожалуйста, прости вывод ниже.Я включил его, чтобы показать, что дословный код из ссылки возвращает мне ошибку.
платформа x86_64-apple-darwin15.6.0
arch x86_64
os darwin15.6.0
system x86_64,darwin15.6.0
status
major 3
minor 5.1
version.string R версия 3.5.1 (2018-07-02) псевдоним Feather Spray
> library(RJDBC)
Loading required package: rJava
Unable to find any JVMs matching version "(null)".
No Java runtime present, try --request to install.
Error: package or namespace load failed for ‘rJava’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so, 6): Library not loaded: /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/lib/server/libjvm.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so
Reason: image not found
Error: package ‘rJava’ could not be loaded
In addition: Warning message:
In system("/usr/libexec/java_home", intern = TRUE) :
running command '/usr/libexec/java_home' had status 1
>
> # download Amazon Redshift JDBC driver
> download.file('http://s3.amazonaws.com/redshift-downloads/drivers/RedshiftJDBC41-1.1.9.1009.jar','RedshiftJDBC41-1.1.9.1009.jar')
trying URL 'http://s3.amazonaws.com/redshift-downloads/drivers/RedshiftJDBC41-1.1.9.1009.jar'
Content type 'application/x-java-archive' length 2055261 bytes (2.0 MB)
==================================================
downloaded 2.0 MB
>
> # connect to Amazon Redshift
> driver <- JDBC("com.amazon.redshift.jdbc41.Driver", "RedshiftJDBC41-1.1.9.1009.jar", identifier.quote="`")
Error in JDBC("com.amazon.redshift.jdbc41.Driver", "RedshiftJDBC41-1.1.9.1009.jar", :
could not find function "JDBC"