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":406,"date":"2014-03-12T23:57:00","date_gmt":"2014-03-13T02:57:00","guid":{"rendered":"http:\/\/www.feltex.com.br\/felix\/?p=406"},"modified":"2015-01-16T14:18:54","modified_gmt":"2015-01-16T16:18:54","slug":"jdbc-conectar-banco-dados-mysql","status":"publish","type":"post","link":"https:\/\/www.feltex.com.br\/felix\/jdbc-conectar-banco-dados-mysql\/","title":{"rendered":"JDBC MySQL: Aprenda a conectar com Banco de Dados mais usado na internet"},"content":{"rendered":"JDBC: Conectar com Banco de Dados MySQL<\/H1><\/p>\n
Ol\u00e1 amigos! Hoje iremos aprender como realizar uma conex\u00e3o com o Banco de Dados MySQL.<\/p>\n
\n<\/p>\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 ConexaoMySQL {\r\n\r\n\/\/**\r\n\r\npublic static void main(String[] args) {\r\n\tSystem.out.println(\"Inicio ConexaoMySQL\");\r\n\ttry {\r\n\r\n Class.forName(\"com.mysql.jdbc.Driver\");\r\n\t\tConnection conexao = DriverManager.getConnection(\r\n\t\t\t\t\"jdbc:mysql:\/\/localhost:3306\/bdacademicnet\", \"root\",\r\n\t\t\t\t\"teco01\");\r\n\t\tPreparedStatement pstm = conexao\r\n\t\t\t\t.prepareStatement(\"select * from information_schema.tables\");\r\n\r\n\t\tResultSet rs = pstm.executeQuery();\r\n\r\n\t\twhile (rs.next()) {\r\n\t\t System.out.println(\"Nome tabela: \" + rs.getString(\"table_name\"));\r\n\t\t}\r\n\t\trs.close();\r\n\t\tpstm.close();\r\n\t\tconexao.close();\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tSystem.out.println(\"Fim ConexaoMySQL\");\r\n\t}\r\n}\r\n<\/pre>\n