{"id":13437864,"url":"https://github.com/rawrafox/rust-jdbc","last_synced_at":"2025-03-19T18:30:51.180Z","repository":{"id":132231461,"uuid":"97039281","full_name":"rawrafox/rust-jdbc","owner":"rawrafox","description":"Rust-JDBC bindings","archived":false,"fork":false,"pushed_at":"2020-01-23T18:16:26.000Z","size":37,"stargazers_count":17,"open_issues_count":3,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-05T19:25:13.361Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rawrafox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-07-12T18:17:27.000Z","updated_at":"2024-08-05T19:25:13.362Z","dependencies_parsed_at":"2023-06-12T13:00:27.725Z","dependency_job_id":null,"html_url":"https://github.com/rawrafox/rust-jdbc","commit_stats":null,"previous_names":["rawrasaur/rust-jdbc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rawrafox%2Frust-jdbc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rawrafox%2Frust-jdbc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rawrafox%2Frust-jdbc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rawrafox%2Frust-jdbc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rawrafox","download_url":"https://codeload.github.com/rawrafox/rust-jdbc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244483146,"owners_count":20460066,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-07-31T03:01:00.775Z","updated_at":"2025-03-19T18:30:50.804Z","avatar_url":"https://github.com/rawrafox.png","language":"Rust","funding_links":[],"categories":["Development tools"],"sub_categories":["FFI"],"readme":"# jdbc #\n\nA Rust library that allows you to use JDBC and JDBC drivers.\n\n## Usage\n\nFirst, add the following to your `Cargo.toml`:\n\n```toml\n[dependencies]\njdbc = \"0.1\"\n```\n\nNext, add this to your crate root:\n\n```rust\nextern crate jdbc;\n```\n\nThen you can in your main function do something like this:\n\n```rust\nlet jvm_options = [\"-Djava.class.path=./jars/postgresql-42.1.1.jar\", \"-Xcheck:jni\"];\nlet _ = unsafe { jvm::JVM::from_options(\u0026jvm_options) };\n\nlet url = \"jdbc:postgresql://localhost/test\";\n\nlet connection = DriverManager::get_connection(url).unwrap();\nlet statement = connection.create_statement().unwrap();\nlet result_set = statement.execute_query(\"SELECT * FROM customers\").unwrap();\nlet metadata = result_set.get_meta_data().unwrap();\nlet columns = metadata.get_column_count().unwrap();\n\nwhile result_set.next().unwrap() {\n  print!(\"row:\");\n  for i in 1 .. columns + 1 {\n    print!(\" {:?}\", result_set.get_string(i).unwrap());\n  }\n  println!(\"\");\n}\n```\n\n## What is jdbc? ##\n\nThe primary purpose of this crate is to allow you to use Java JDBC database\ndrivers from Rust in a convenient way with a relatively safe interface. It does\nthis via embedding a JVM in your process so be aware that if you use JNI in some\nother way in your app you will need to tell jdbc to play nice.\n\n## Platforms ##\n\nI am testing on my Mac, but I would love to setup some CI to get this party\nstarted.\n\n## Contributing ##\n\nPatches are welcome, don't forget to add yourself to the Authors list.\n\n## Authors ##\n\n - Aurora \u003c@rawrasaur, aurora@aventine.se\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frawrafox%2Frust-jdbc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frawrafox%2Frust-jdbc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frawrafox%2Frust-jdbc/lists"}