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":527,"date":"2014-03-24T11:45:16","date_gmt":"2014-03-24T14:45:16","guid":{"rendered":"http:\/\/www.feltex.com.br\/felix\/?p=527"},"modified":"2014-12-29T18:16:40","modified_gmt":"2014-12-29T20:16:40","slug":"jdbc-conectar-banco-dados-ibm-db2","status":"publish","type":"post","link":"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-ibm-db2\/","title":{"rendered":"JDBC: Conectar com Banco de Dados IBM DB2"},"content":{"rendered":"

JDBC: Conectar com Banco de Dados IBM DB2<\/H2><\/p>\n

Ol\u00e1 amigos!
\nHoje iremos aprender como realizar uma conex\u00e3o com o Banco de Dados IBM DB2.<\/p>\n

<\/p>\n

\r\n\r\npackage br.com.feltex.bancodados;\r\n\r\nimport java.sql.Connection;\r\nimport java.sql.DriverManager;\r\nimport java.sql.PreparedStatement;\r\nimport java.sql.ResultSet;\r\n\r\npublic class ConexaoDB2 {\r\n\r\n\tpublic static void main(String[] args) {\r\n\r\n\t\tSystem.out.println(\"Inicio ConexaoDB2\");\r\n\t\ttry {\r\n\t\t\tString usuario = \"usuario\";\r\n\t\t\tString senha = \"senha\";\r\n\t\t\tClass.forName(\"com.ibm.db2.jcc.DB2Driver\");\r\n\t\t\tConnection conexao = DriverManager.getConnection(\r\n\t\t\t\t\t\"jdbc:db2:\/\/127.0.0.1:50000\/bdacademicNet\", usuario, senha);\r\n\t\t\tPreparedStatement pstm = conexao\r\n\t\t\t\t\t.prepareStatement(\"Select * from tbaluno\");\r\n\r\n\t\t\tResultSet rs = pstm.executeQuery();\r\n\r\n\t\t\twhile (rs.next()) {\r\n\t\t\t\tSystem.out.println(\"Nome Aluno: \" + rs.getString(\"nome\"));\r\n\t\t\t}\r\n\t\t\trs.close();\r\n\t\t\tpstm.close();\r\n\t\t\tconexao.close();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tSystem.out.println(\"Fim ConexaoDB2\");\r\n\t}\r\n}\r\n<\/pre>\n

Driver JDBC IBM DB2<\/a>
\nAbra\u00e7os e bons estudos.<\/p>\n

Links relacionados <\/H2><\/p>\n

Exemplo completo com JSF Primefaces + Hibernate + MySQL<\/a><\/p>\n

JDBC: Conectar com Banco de Dados SQLServer<\/a><\/p>\n

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

JDBC: Conectar com Banco de Dados PostgreSQL<\/a><\/p>\n

JDBC: Conectar com Banco de Dados Microsoft Access<\/a>
\n
JDBC: Aprenda a conectar com Banco de Dados MySQL<\/a><\/p>\n

N\u00e3o se esque\u00e7a de curtir este post nas redes sociais. D\u00ea a sua contribui\u00e7\u00e3o social e ajude o autor:<\/H2><\/p>\n","protected":false},"excerpt":{"rendered":"

JDBC: Conectar com Banco de Dados IBM DB2 Ol\u00e1 amigos! Hoje iremos aprender como realizar uma conex\u00e3o com o Banco de Dados IBM DB2.<\/p>\n","protected":false},"author":1,"featured_media":1766,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0},"categories":[5],"tags":[],"yoast_head":"\nJDBC: Conectar com Banco de Dados IBM DB2<\/title>\n<meta name=\"description\" content=\"JDBC: Conectar com Banco de Dados IBM DB2\" \/>\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-ibm-db2\/\" \/>\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 IBM DB2\" \/>\n<meta property=\"og:description\" content=\"JDBC: Conectar com Banco de Dados IBM DB2\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-ibm-db2\/\" \/>\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-03-24T14:45:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-12-29T20:16:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.feltex.com.br\/felix\/wp-content\/uploads\/2014\/03\/IBM-DB2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"512\" \/>\n\t<meta property=\"og:image:height\" content=\"512\" \/>\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-ibm-db2\/#primaryimage\",\"inLanguage\":\"pt-BR\",\"url\":\"https:\/\/www.feltex.com.br\/felix\/wp-content\/uploads\/2014\/03\/IBM-DB2.png\",\"contentUrl\":\"https:\/\/www.feltex.com.br\/felix\/wp-content\/uploads\/2014\/03\/IBM-DB2.png\",\"width\":512,\"height\":512},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-ibm-db2\/#webpage\",\"url\":\"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-ibm-db2\/\",\"name\":\"JDBC: Conectar com Banco de Dados IBM DB2\",\"isPartOf\":{\"@id\":\"https:\/\/www.feltex.com.br\/felix\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-ibm-db2\/#primaryimage\"},\"datePublished\":\"2014-03-24T14:45:16+00:00\",\"dateModified\":\"2014-12-29T20:16:40+00:00\",\"author\":{\"@id\":\"https:\/\/www.feltex.com.br\/felix\/#\/schema\/person\/1e49f842c6254b4561b66ccf573c2069\"},\"description\":\"JDBC: Conectar com Banco de Dados IBM DB2\",\"breadcrumb\":{\"@id\":\"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-ibm-db2\/#breadcrumb\"},\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-ibm-db2\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-ibm-db2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"JDBC: Conectar com Banco de Dados IBM DB2\"}]},{\"@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 IBM DB2","description":"JDBC: Conectar com Banco de Dados IBM DB2","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-ibm-db2\/","og_locale":"pt_BR","og_type":"article","og_title":"JDBC: Conectar com Banco de Dados IBM DB2","og_description":"JDBC: Conectar com Banco de Dados IBM DB2","og_url":"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-ibm-db2\/","og_site_name":"Aprenda Java","article_publisher":"https:\/\/www.facebook.com\/feltex.br","article_published_time":"2014-03-24T14:45:16+00:00","article_modified_time":"2014-12-29T20:16:40+00:00","og_image":[{"width":512,"height":512,"url":"https:\/\/www.feltex.com.br\/felix\/wp-content\/uploads\/2014\/03\/IBM-DB2.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-ibm-db2\/#primaryimage","inLanguage":"pt-BR","url":"https:\/\/www.feltex.com.br\/felix\/wp-content\/uploads\/2014\/03\/IBM-DB2.png","contentUrl":"https:\/\/www.feltex.com.br\/felix\/wp-content\/uploads\/2014\/03\/IBM-DB2.png","width":512,"height":512},{"@type":"WebPage","@id":"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-ibm-db2\/#webpage","url":"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-ibm-db2\/","name":"JDBC: Conectar com Banco de Dados IBM DB2","isPartOf":{"@id":"https:\/\/www.feltex.com.br\/felix\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-ibm-db2\/#primaryimage"},"datePublished":"2014-03-24T14:45:16+00:00","dateModified":"2014-12-29T20:16:40+00:00","author":{"@id":"https:\/\/www.feltex.com.br\/felix\/#\/schema\/person\/1e49f842c6254b4561b66ccf573c2069"},"description":"JDBC: Conectar com Banco de Dados IBM DB2","breadcrumb":{"@id":"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-ibm-db2\/#breadcrumb"},"inLanguage":"pt-BR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-ibm-db2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-ibm-db2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"JDBC: Conectar com Banco de Dados IBM DB2"}]},{"@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\/527"}],"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=527"}],"version-history":[{"count":6,"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/posts\/527\/revisions"}],"predecessor-version":[{"id":1765,"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/posts\/527\/revisions\/1765"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/media\/1766"}],"wp:attachment":[{"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/media?parent=527"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/categories?post=527"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.feltex.com.br\/felix\/wp-json\/wp\/v2\/tags?post=527"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}