{"id":25806023,"url":"https://github.com/alipsa/r2jdbc","last_synced_at":"2026-05-15T19:32:13.560Z","repository":{"id":43835801,"uuid":"180757494","full_name":"Alipsa/r2jdbc","owner":"Alipsa","description":"Renjin database connecttivity","archived":false,"fork":false,"pushed_at":"2025-11-04T14:08:47.000Z","size":86,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-11T19:38:59.719Z","etag":null,"topics":["r-package","renjin"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Alipsa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["Alipsa"]}},"created_at":"2019-04-11T09:19:24.000Z","updated_at":"2025-11-04T14:08:44.000Z","dependencies_parsed_at":"2025-02-27T20:16:01.847Z","dependency_job_id":"5a1ae92c-7431-4493-b26b-014f6dda85b4","html_url":"https://github.com/Alipsa/r2jdbc","commit_stats":null,"previous_names":["pernyfelt/r2jdbc"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/Alipsa/r2jdbc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alipsa%2Fr2jdbc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alipsa%2Fr2jdbc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alipsa%2Fr2jdbc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alipsa%2Fr2jdbc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Alipsa","download_url":"https://codeload.github.com/Alipsa/r2jdbc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alipsa%2Fr2jdbc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33076168,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["r-package","renjin"],"created_at":"2025-02-27T19:52:42.502Z","updated_at":"2026-05-15T19:32:13.542Z","avatar_url":"https://github.com/Alipsa.png","language":"R","funding_links":["https://github.com/sponsors/Alipsa"],"categories":[],"sub_categories":[],"readme":"# r2jdbc\nRenjin database connectivity.\n\nBased on [renjin-dbi](https://github.com/bedatadriven/renjin-dbi).\n\nReleases are now available on maven central. \n\nNote that you need to add the driver jar to the classpath in addition to R2JDBC e.g:\n\n```xml\n    \u003cdependencies\u003e\n        \u003cdependency\u003e\n          \u003cgroupId\u003eorg.renjin.cran\u003c/groupId\u003e\n          \u003cartifactId\u003eDBI\u003c/artifactId\u003e\n          \u003cversion\u003e1.0.0-b9\u003c/version\u003e\n        \u003c/dependency\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003ese.alipsa\u003c/groupId\u003e\n            \u003cartifactId\u003eR2JDBC\u003c/artifactId\u003e\n            \u003cversion\u003e10.0.25\u003c/version\u003e\n        \u003c/dependency\u003e\n        \u003c!-- the driver, depends on what db you want to use ;) --\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003ecom.h2database\u003c/groupId\u003e\n            \u003cartifactId\u003eh2\u003c/artifactId\u003e\n            \u003cversion\u003e2.1.212\u003c/version\u003e\n        \u003c/dependency\u003e\n    \u003c/dependencies\u003e\n```\n\n## Example\n```R\nlibrary(\"org.renjin.cran:DBI\")\nlibrary(\"se.alipsa:R2JDBC\")\ndrv \u003c- JDBC(\"org.h2.Driver\") \ncon \u003c- dbConnect(drv, url=\"jdbc:h2:mem:test\") \ndf  \u003c- dbGetQuery(con, \"SELECT * from sometable\")\ndbDisconnect(con)\n```\n\nAll the api functions uses a connection to perform tasks. \nIn order to create a connection to the database you need to load the driver first, e.g:\n```R\ncon \u003c- dbConnect(JDBC(\"org.h2.Driver\"), url=\"jdbc:h2:mem:test\")\n```\n\n# Functions provided\n\n## Create\n\n```R\ndbSendUpdate(con, paste('CREATE TABLE MyTable (\n  \"id\" INT NOT NULL,\n  \"title\" VARCHAR(50) NOT NULL,\n  \"author\" VARCHAR(20) NOT NULL,\n  \"submission_date\" DATE,\n  \"insert_date\" TIMESTAMP,\n  \"price\" NUMERIC(20, 2)\n)'))\n```\n## Drop\n#### Dropping a table\nThere are two ways to drop a table:\n```R\n# 1. using dbRemoveTable:\ndbRemoveTable(con, \"MyTable\")\n\n# 2. using dbSendUpdate\ndbSendUpdate(con, \"drop table MyTable\")\n```\n#### Dropping a column\n```R\ndbSendUpdate(con, \"ALTER TABLE MyTable DROP COLUMN author\") \n```\n\n## Insert\n```R\ndbSendUpdate(con, paste(\"\n  insert into MyTable values\n    (1, 'Answer to Job', 'C.G. Jung', CURRENT_DATE, CURRENT_TIMESTAMP, 22),\n    (2, 'Lord of the Rings', 'J.R.R. Tolkien', '2019-01-20', CURRENT_TIMESTAMP, 14.11),\n    (3, 'Siddharta', 'Herman Hesse', '2019-01-23', CURRENT_TIMESTAMP, 9.90)\n\"))\n```\n\n## Select\nThe dbGetQuery returns a data.frame:\n\n```R\ndf \u003c- dbGetQuery(con, \"SELECT * from MyTable\")\n```\n\n## Update\n```R\ndbSendUpdate(con, \"update MyTable set price = 25 where id = 1\")\n```\n\n## Delete\n```R\ndbSendUpdate(con, \"delete from MyTable where id = 1\")\n```\n\n## Other functions\n\n### dbListTables(conn)\nReturns a character vector of all the table names for the connection.\n\n### dbExistsTable(conn, name)\nreturns a logical (boolean) if the specified table exists\n\n### dbRemoveTable(conn, name)\nDrops the table specified\n\n### dbGetFields(conn, name, pattern)\nReturn a list of columns names for the table name specified\n\n### dbDataType(conn, obj)\nReturns the appropriate database type for the R object specified.\nNote: this method is not very refined and should be used a hint rather than \nas a recommendation.\n\n### dbBatchInsert(conn, name, df, overwrite=TRUE, append=FALSE)\nUsed to insert a dataframe\n  - Example\n  ```R\n    con \u003c- dbConnect(drv, url=\"jdbc:derby:derbyDB;create=true\")\n    dbBatchInsert(con, name=name, df=mtcars, overwrite=TRUE)\n  ```\n### dbWriteTable(conn, name, value, overwrite=TRUE, append=FALSE, csvdump=FALSE, transaction=TRUE)\nWrites the value (a vector, list of data.frame) to a database table.\nThis is functionally equivalent to dbBatchInsert but implemented differently.\n\nNote that the csvdump argument is ignored.\n\n## Handling transactions\n### dbBegin(conn)\nBegins a transaction, sets autocommit to false\n### dbCommit(conn) \nCommit the transaction\n### dbRollback(conn)\nRollback the transaction\n\n# Special cases\nThe microsoft SQL Server driver (and maybe others) gets confused when user and password is specified in the url only. \nIn most other JDBC drivers, supplying and empty string for user and password works where the username/password in the url\nwill then take precedence, but not so for the SQL server driver. Hence, you need to set user and password to NA to get it to work.\nE.g. this pattern (which works for postgres, derby, h2 etc) will not work:\n```R\ncon \u003c- dbConnect(\n  JDBC(\"com.microsoft.sqlserver.jdbc.SQLServerDriver\"), \n  url=\"jdbc:sqlserver://localhost:1433;databaseName=tempdb;user=test;password=unS3cur3P@55\"\n)\n```\n\nbut this will work fine:\n\n```R\ncon \u003c- dbConnect(\n  JDBC(\"com.microsoft.sqlserver.jdbc.SQLServerDriver\"),\n  url=\"jdbc:sqlserver://localhost:1433;databaseName=tempdb;user=test;password=unS3cur3P@55\",\n  user=NA,\n  password=NA\n)\n```\n\nand of course so will this:\n\n```R\ncon \u003c- dbConnect(\n  JDBC(\"com.microsoft.sqlserver.jdbc.SQLServerDriver\"),\n  url=\"jdbc:sqlserver://localhost:1433;databaseName=tempdb\",\n  user=\"test\",\n  password=\"unS3cur3P@55\"\n)\n```\n\n# Building \nR2JDBC is built using maven and Java 8. To create and install a local package\nsimply run `mvn install`\n\nNote:\nThis does not build properly on Windows for some reason (classes are does not end correctly with RData,\nthis is probably a bug in the renjin-maven-plugin or the gcc bridge). Until this is resolved you need to build in Linux\n(though it probably works on other Unix like distributions as well)\n\n# Version history\n\n## Ver 10.1.0\n- Upgrade to Java 11\n\n## Ver 10.0.25, Feb 04, 2022\n- Removed dependency on Joda Time\n- Make dateTime retrieval more robust\n- Upgrade jdbc drivers used in test\n\n## Ver 10.0.24, Jan 29, 2022\n- Upgrade h2 dependency \n- Workaround for RowNamesVector changes in renjin master compared to 0.9.2716 (now works in all versions)\n- upgrade slf4j version \n- upgrade testcontainers versions\n\n## Ver 10.0.23, Jan 7, 2022\n- upgrade dependencies (h2, maven site plugin)\n- improve bigint support for postgresql (when detected as int8), add support for bigserial\n\n## Ver 10.0.22, Dec 14, 2021\n- Add support for CHARACTER VARYING data type (e.g. H2)\n- Version bump of dependencies. \n\n## Ver 10.0.21, Mar 10, 2021\n- mysql has a BIGINT UNSIGNED type; treat it as a regular BIGINT for now.\n- Version bump of dependencies.\n\n## Ver 10.0.20, Dec 17, 2019\n- Add support for the \"name\" datatype (e.g. in postgresql).\n\n## Ver 10.0.19, Jul 02, 2019\n- Fix for Sql server when url contains username/password. \n- Add unit tests using TestContainer with Docker.\n- Version bump of dependencies.\n\n## Ver 10.0.18, May 04, 2019\n- Add support for datetimeoffset datatype. Published on maven central.\n\n## Ver 10.0.17, Apr 24, 2019\n- Fix for boolean datatype on postgres (announced as \"bool\" type)\n\n## Ver 10.0.16, Apr 12, 2019\nR2JDBC is a renjin extension providing database connectivity. It is Based on the renjin-dbi (https://github.com/bedatadriven/renjin-dbi). \nMost of the changes consists of support for more data types.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falipsa%2Fr2jdbc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falipsa%2Fr2jdbc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falipsa%2Fr2jdbc/lists"}