Warning: Trying to access array offset on value of type bool in /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php on line 16

Warning: Trying to access array offset on value of type bool in /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php on line 16

Warning: Trying to access array offset on value of type bool in /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php on line 16

Warning: Cannot modify header information - headers already sent by (output started at /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php:16) in /home/feltexco/public_html/felix/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php:16) in /home/feltexco/public_html/felix/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php:16) in /home/feltexco/public_html/felix/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php:16) in /home/feltexco/public_html/felix/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php:16) in /home/feltexco/public_html/felix/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php:16) in /home/feltexco/public_html/felix/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php:16) in /home/feltexco/public_html/felix/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/feltexco/public_html/felix/wp-content/plugins/google-maps-ready/modules/options/models/options.php:16) in /home/feltexco/public_html/felix/wp-includes/rest-api/class-wp-rest-server.php on line 1758
{"id":1237,"date":"2014-08-04T10:10:00","date_gmt":"2014-08-04T13:10:00","guid":{"rendered":"http:\/\/www.feltex.com.br\/felix\/?p=1237"},"modified":"2015-02-04T14:19:03","modified_gmt":"2015-02-04T16:19:03","slug":"jdbc-conectar-banco-dados-microsoft-access","status":"publish","type":"post","link":"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-microsoft-access\/","title":{"rendered":"JDBC: Conectar com Banco de Dados Microsoft Access (Java 8)"},"content":{"rendered":"

JDBC: Conectar com Banco de Dados Microsoft Access (Java 8)<\/H1><\/p>\n

A partir da vers\u00e3o 8 do Java n\u00e3o existe mais suporte \u00e0 acesso via JDBC para arquivos mdb ou accdb. Ent\u00e3o para isso foi criada uma solu\u00e7\u00e3o de acesso chamada UcanAccess<\/a> que \u00e9 um projeto Open Source.
\n Esta \u00e9 a sua alternativa quando, utilizando o Java vers\u00e3o 8, para manipular dados oriundos de bancos de dados MS Access.<\/p>\n

<\/p>\n

\r\n\r\npackage br.com.feltex.jdbc.conexao;\r\n\r\nimport java.io.File;\r\nimport java.sql.Connection;\r\nimport java.sql.DatabaseMetaData;\r\nimport java.sql.DriverManager;\r\nimport java.sql.ResultSet;\r\n\r\npublic class ConexaoAccessJava8 {\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\tConnection con = null;\r\n\t\ttry {\t\t\r\n\r\n\t\t\t\/\/ Nome do arquivo\r\n\t\t\tString filename = \"D:\/temp\/mdb\/Northwind.mdb\";\r\n\r\n\t\t\tFile arquivo = new File(filename);\r\n\r\n\t\t\t\/\/ Verifica se o arquivo n\u00e3o existe.\r\n\t\t\tif (!arquivo.exists()) {\r\n\t\t\t\tSystem.err.println(\"Arquivo n\u00e3o existe!\");\r\n\t\t\t}\r\n\r\n\t\t\tString database = \"jdbc:ucanaccess:\/\/\" + filename.trim();\r\n\r\n\t\t\tSystem.out.println(database);\r\n\t\t\t\r\n\t\t\t\/\/ Realiza a conex\u00e3o com o banco de dados\r\n\t\t\tcon = DriverManager.getConnection(database);\r\n\r\n\t\t\t\/\/ Faz a leitura dos metadados do Banco\r\n\t\t\tDatabaseMetaData d = con.getMetaData();\r\n\r\n\t\t\tResultSet rs = d.getTables(null, null, \"%\", null);\r\n\r\n\t\t\twhile (rs.next()) {\r\n\t\t\t\tSystem.out.println(rs.getString(3));\r\n\t\t\t}\r\n\r\n\t\t\trs.close();\r\n\t\t\tcon.close();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}\r\n}\r\n\r\n\r\n\r\n<\/pre>\n

Abra\u00e7os e bons estudos! Vida que segue!<\/p>\n

Links relacionados:<\/H2>
\n Acesse nosso tutorial de JDBC:
aqui<\/a>
\n
Tutorial Oracle<\/a><\/p>\n

ODBC: Conectar com Banco de Dados via ODBC<\/a><\/p>\n

Instala\u00e7\u00e3o e Configura\u00e7\u00e3o do Banco de Dados PostGreSQL<\/a><\/p>\n

Instala\u00e7\u00e3o e Configura\u00e7\u00e3o do Banco de Dados MySQL<\/a><\/p>\n

Gostou do post? Agrade\u00e7a o autor compartilhando nas redes sociais. Clique nos links abaixo: <\/H2><\/p>\n","protected":false},"excerpt":{"rendered":"

JDBC: Conectar com Banco de Dados Microsoft Access (Java 8) A partir da vers\u00e3o 8 do Java n\u00e3o existe mais suporte \u00e0 acesso via JDBC para arquivos mdb ou accdb. Ent\u00e3o para isso foi criada uma solu\u00e7\u00e3o de acesso chamada …<\/p>\n

JDBC: Conectar com Banco de Dados Microsoft Access (Java 8)<\/span> Read More »<\/a><\/p>\n

<\/p>\n","protected":false},"author":1,"featured_media":1843,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0},"categories":[1],"tags":[],"yoast_head":"\nJDBC: Conectar com Banco de Dados Microsoft Access<\/title>\n<meta name=\"description\" content=\"Teremos um exemplo de JDBC: Conectar com Banco de Dados Microsoft Access\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-microsoft-access\/\" \/>\n<meta property=\"og:locale\" content=\"pt_BR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JDBC: Conectar com Banco de Dados Microsoft Access\" \/>\n<meta property=\"og:description\" content=\"Teremos um exemplo de JDBC: Conectar com Banco de Dados Microsoft Access\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-microsoft-access\/\" \/>\n<meta property=\"og:site_name\" content=\"Aprenda Java\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/feltex.br\" \/>\n<meta property=\"article:published_time\" content=\"2014-08-04T13:10:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2015-02-04T16:19:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.feltex.com.br\/felix\/wp-content\/uploads\/2014\/08\/JDBC.png\" \/>\n\t<meta property=\"og:image:width\" content=\"400\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"Andr\u00e9 F\u00e9lix\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. tempo de leitura\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minuto\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.feltex.com.br\/felix\/#website\",\"url\":\"https:\/\/www.feltex.com.br\/felix\/\",\"name\":\"Aprenda Java\",\"description\":\"Cursos de java, SQL e Engenharia de Software\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.feltex.com.br\/felix\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"pt-BR\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-microsoft-access\/#primaryimage\",\"inLanguage\":\"pt-BR\",\"url\":\"https:\/\/www.feltex.com.br\/felix\/wp-content\/uploads\/2014\/08\/JDBC.png\",\"contentUrl\":\"https:\/\/www.feltex.com.br\/felix\/wp-content\/uploads\/2014\/08\/JDBC.png\",\"width\":400,\"height\":400},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-microsoft-access\/#webpage\",\"url\":\"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-microsoft-access\/\",\"name\":\"JDBC: Conectar com Banco de Dados Microsoft Access\",\"isPartOf\":{\"@id\":\"https:\/\/www.feltex.com.br\/felix\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-microsoft-access\/#primaryimage\"},\"datePublished\":\"2014-08-04T13:10:00+00:00\",\"dateModified\":\"2015-02-04T16:19:03+00:00\",\"author\":{\"@id\":\"https:\/\/www.feltex.com.br\/felix\/#\/schema\/person\/1e49f842c6254b4561b66ccf573c2069\"},\"description\":\"Teremos um exemplo de JDBC: Conectar com Banco de Dados Microsoft Access\",\"breadcrumb\":{\"@id\":\"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-microsoft-access\/#breadcrumb\"},\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-microsoft-access\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-microsoft-access\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"JDBC: Conectar com Banco de Dados Microsoft Access (Java 8)\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.feltex.com.br\/felix\/#\/schema\/person\/1e49f842c6254b4561b66ccf573c2069\",\"name\":\"Andr\\u00e9 F\\u00e9lix\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.feltex.com.br\/felix\/#personlogo\",\"inLanguage\":\"pt-BR\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d2d9cc82cab40245e6f803982b1448e6?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d2d9cc82cab40245e6f803982b1448e6?s=96&r=g\",\"caption\":\"Andr\\u00e9 F\\u00e9lix\"},\"sameAs\":[\"http:\/\/www.feltex.com.br\"],\"url\":\"https:\/\/www.feltex.com.br\/felix\/author\/andre.felix\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JDBC: Conectar com Banco de Dados Microsoft Access","description":"Teremos um exemplo de JDBC: Conectar com Banco de Dados Microsoft Access","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-microsoft-access\/","og_locale":"pt_BR","og_type":"article","og_title":"JDBC: Conectar com Banco de Dados Microsoft Access","og_description":"Teremos um exemplo de JDBC: Conectar com Banco de Dados Microsoft Access","og_url":"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-microsoft-access\/","og_site_name":"Aprenda Java","article_publisher":"https:\/\/www.facebook.com\/feltex.br","article_published_time":"2014-08-04T13:10:00+00:00","article_modified_time":"2015-02-04T16:19:03+00:00","og_image":[{"width":400,"height":400,"url":"https:\/\/www.feltex.com.br\/felix\/wp-content\/uploads\/2014\/08\/JDBC.png","type":"image\/png"}],"twitter_misc":{"Escrito por":"Andr\u00e9 F\u00e9lix","Est. tempo de leitura":"1 minuto"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/www.feltex.com.br\/felix\/#website","url":"https:\/\/www.feltex.com.br\/felix\/","name":"Aprenda Java","description":"Cursos de java, SQL e Engenharia de Software","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.feltex.com.br\/felix\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"pt-BR"},{"@type":"ImageObject","@id":"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-microsoft-access\/#primaryimage","inLanguage":"pt-BR","url":"https:\/\/www.feltex.com.br\/felix\/wp-content\/uploads\/2014\/08\/JDBC.png","contentUrl":"https:\/\/www.feltex.com.br\/felix\/wp-content\/uploads\/2014\/08\/JDBC.png","width":400,"height":400},{"@type":"WebPage","@id":"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-microsoft-access\/#webpage","url":"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-microsoft-access\/","name":"JDBC: Conectar com Banco de Dados Microsoft Access","isPartOf":{"@id":"https:\/\/www.feltex.com.br\/felix\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-microsoft-access\/#primaryimage"},"datePublished":"2014-08-04T13:10:00+00:00","dateModified":"2015-02-04T16:19:03+00:00","author":{"@id":"https:\/\/www.feltex.com.br\/felix\/#\/schema\/person\/1e49f842c6254b4561b66ccf573c2069"},"description":"Teremos um exemplo de JDBC: Conectar com Banco de Dados Microsoft Access","breadcrumb":{"@id":"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-microsoft-access\/#breadcrumb"},"inLanguage":"pt-BR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-microsoft-access\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-microsoft-access\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"JDBC: Conectar com Banco de Dados Microsoft Access (Java 8)"}]},{"@type":"Person","@id":"https:\/\/www.feltex.com.br\/felix\/#\/schema\/person\/1e49f842c6254b4561b66ccf573c2069","name":"Andr\u00e9 F\u00e9lix","image":{"@type":"ImageObject","@id":"https:\/\/www.feltex.com.br\/felix\/#personlogo","inLanguage":"pt-BR","url":"https:\/\/secure.gravatar.com\/avatar\/d2d9cc82cab40245e6f803982b1448e6?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d2d9cc82cab40245e6f803982b1448e6?s=96&r=g","caption":"Andr\u00e9 F\u00e9lix"},"sameAs":["http:\/\/www.feltex.com.br"],"url":"https:\/\/www.feltex.com.br\/felix\/author\/andre.felix\/"}]}},"_links":{"self":[{"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/posts\/1237"}],"collection":[{"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/comments?post=1237"}],"version-history":[{"count":13,"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/posts\/1237\/revisions"}],"predecessor-version":[{"id":1848,"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/posts\/1237\/revisions\/1848"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/media\/1843"}],"wp:attachment":[{"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/media?parent=1237"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/categories?post=1237"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/tags?post=1237"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}