{"id":91,"date":"2011-04-12T18:33:00","date_gmt":"2011-04-12T18:33:00","guid":{"rendered":"http:\/\/behstant.com\/blog\/?p=91"},"modified":"2011-04-12T18:33:00","modified_gmt":"2011-04-12T18:33:00","slug":"error-de-conexion-netbeans-6-9-1-con-sql-server","status":"publish","type":"post","link":"https:\/\/behstant.com\/blog\/java\/error-de-conexion-netbeans-6-9-1-con-sql-server\/","title":{"rendered":"Error de conexion Netbeans 6.9.1 con SQL Server"},"content":{"rendered":"<p><span style=\"font-family:arial;\">Bueno despu\u00e9s de estar intentado muchas veces y horas la conexion y meterme en todos lados del sistema solucione mi problema de una forma muy f\u00e1cil.<\/span><\/p>\n<p><span style=\"font-family:arial;\">Primero que nada, la solucion que presento a continuaci\u00f3n no garantiza que vaya a ser la misma en los mismos equipos. Actualmente estaba haciendo la conexion con las siguientes caracteristicas de software:<\/span><\/p>\n<p><span style=\"font-family:arial;\">Sistema Operativo: Windows 7 Home <\/span><br \/><span style=\"font-family:arial;\">Sql server: SQL Server 2008<\/span><br \/><span style=\"font-family:arial;\">Netbeans: 6.9.1<\/span><\/p>\n<p><span style=\"font-family:arial;\">Y el error que me salio al intentar hacer la conexion fue la siguiente:<\/span><\/p>\n<p><span style=\"font-size:85%;\"><span style=\"font-family:courier new;\">&#8220;com.microsoft.sqlserver.jdbc.SQLServerException: No se pudo realizar la conexi\u00f3n TCP\/IP al host localhost, <span style=\"color: rgb(255, 0, 0); font-weight: bold;\">puerto 1433<\/span>. Error: &#8220;Connection refused: connect. Verifique las propiedades de conexi\u00f3n, compruebe que hay una instancia de SQL Server ejecut\u00e1ndose en el host y aceptando las conexiones TCP\/IP en el puerto y compruebe que no hay ning\u00fan firewall bloqueando las conexiones TCP en el puerto.&#8221;<\/span><\/span><\/p>\n<p><span style=\"font-family:arial;\">La razon por que me sal\u00eda este error era por que el el MSSQL estaba asignando el purto din\u00e1micamente, y como en la conexi\u00f3n yo le indicaba que usar\u00e1 ese puerto no realizaba la conexi\u00f3n. Entonces la soluci\u00f3n fue cambiar en mi c\u00f3digo Java de esto:<\/p>\n<p><\/span><span style=\"font-family:arial;\"><span style=\"font-size:85%;\"><span style=\"font-family:courier new;\">String url = &#8220;jdbc:sqlserver:\/\/localhost\\\\sqlserver:<\/span><span style=\"font-weight: bold; color: rgb(255, 0, 0);font-family:courier new;\" >1433<\/span><span style=\"font-family:courier new;\">;databaseName=Northwind&#8221;;<\/span><br \/><span style=\"font-family:courier new;\"> Class.forName(&#8220;com.microsoft.sqlserver.jdbc.SQLServerDriver&#8221;);<\/span><br \/><span style=\"font-family:courier new;\"> System.out.println(&#8220;El driver de MSSQL se realizo con exito&#8221;);<\/span><br \/><span style=\"font-family:courier new;\"> connSQLServer = DriverManager.getConnection(url, &#8220;northwind&#8221;, &#8220;****&#8221;)<\/span><\/span><\/p>\n<p>a esto:<br \/><\/span><span style=\"font-family:arial;\"><br \/><span style=\"font-size:85%;\"><span style=\"font-family:courier new;\">String url = &#8220;jdbc:sqlserver:\/\/localhost\\\\sqlserver;databaseName=Northwind&#8221;;<\/span><br \/><span style=\"font-family:courier new;\">Class.forName(&#8220;com.microsoft.sqlserver.jdbc.SQLServerDriver&#8221;);<\/span><br \/><span style=\"font-family:courier new;\">System.out.println(&#8220;El driver de MSSQL se realizo con exito&#8221;);<\/span><br \/><span style=\"font-family:courier new;\">connSQLServer = DriverManager.getConnection(url, &#8220;northwind&#8221;, &#8220;****&#8221;)<\/p>\n<p><span style=\";font-family:arial;font-size:100%;\"  >Y con esto quedo solucionado mi problema que me costo horas :p<\/span><br \/><\/span><\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bueno despu\u00e9s de estar intentado muchas veces y horas la conexion y meterme en todos lados del sistema solucione mi problema de una forma muy f\u00e1cil. Primero que nada, la solucion que presento a continuaci\u00f3n no garantiza que vaya a ser la misma en los mismos equipos. Actualmente estaba haciendo la conexion con las siguientes &#8230; <a title=\"Error de conexion Netbeans 6.9.1 con SQL Server\" class=\"read-more\" href=\"https:\/\/behstant.com\/blog\/java\/error-de-conexion-netbeans-6-9-1-con-sql-server\/\" aria-label=\"Read more about Error de conexion Netbeans 6.9.1 con SQL Server\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[20,19,21],"tags":[],"class_list":["post-91","post","type-post","status-publish","format-standard","hentry","category-base-de-datos","category-java","category-netbeans"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Error de conexion Netbeans 6.9.1 con SQL Server &#187; The Code<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/behstant.com\/blog\/java\/error-de-conexion-netbeans-6-9-1-con-sql-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Error de conexion Netbeans 6.9.1 con SQL Server &#187; The Code\" \/>\n<meta property=\"og:description\" content=\"Bueno despu\u00e9s de estar intentado muchas veces y horas la conexion y meterme en todos lados del sistema solucione mi problema de una forma muy f\u00e1cil. Primero que nada, la solucion que presento a continuaci\u00f3n no garantiza que vaya a ser la misma en los mismos equipos. Actualmente estaba haciendo la conexion con las siguientes ... Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/behstant.com\/blog\/java\/error-de-conexion-netbeans-6-9-1-con-sql-server\/\" \/>\n<meta property=\"og:site_name\" content=\"The Code\" \/>\n<meta property=\"article:published_time\" content=\"2011-04-12T18:33:00+00:00\" \/>\n<meta name=\"author\" content=\"Reedyseth\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Reedyseth\" \/>\n<meta name=\"twitter:site\" content=\"@Reedyseth\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Reedyseth\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/behstant.com\/blog\/java\/error-de-conexion-netbeans-6-9-1-con-sql-server\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/behstant.com\/blog\/java\/error-de-conexion-netbeans-6-9-1-con-sql-server\/\"},\"author\":{\"name\":\"Reedyseth\",\"@id\":\"http:\/\/behstant.com\/blog\/#\/schema\/person\/760327e1ee480ad2aabe8e40d784ec9f\"},\"headline\":\"Error de conexion Netbeans 6.9.1 con SQL Server\",\"datePublished\":\"2011-04-12T18:33:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/behstant.com\/blog\/java\/error-de-conexion-netbeans-6-9-1-con-sql-server\/\"},\"wordCount\":284,\"commentCount\":16,\"articleSection\":[\"Base de Datos\",\"Java\",\"Netbeans\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/behstant.com\/blog\/java\/error-de-conexion-netbeans-6-9-1-con-sql-server\/\",\"url\":\"https:\/\/behstant.com\/blog\/java\/error-de-conexion-netbeans-6-9-1-con-sql-server\/\",\"name\":\"Error de conexion Netbeans 6.9.1 con SQL Server &#187; The Code\",\"isPartOf\":{\"@id\":\"http:\/\/behstant.com\/blog\/#website\"},\"datePublished\":\"2011-04-12T18:33:00+00:00\",\"author\":{\"@id\":\"http:\/\/behstant.com\/blog\/#\/schema\/person\/760327e1ee480ad2aabe8e40d784ec9f\"},\"breadcrumb\":{\"@id\":\"https:\/\/behstant.com\/blog\/java\/error-de-conexion-netbeans-6-9-1-con-sql-server\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/behstant.com\/blog\/java\/error-de-conexion-netbeans-6-9-1-con-sql-server\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/behstant.com\/blog\/java\/error-de-conexion-netbeans-6-9-1-con-sql-server\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/behstant.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Error de conexion Netbeans 6.9.1 con SQL Server\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/behstant.com\/blog\/#website\",\"url\":\"http:\/\/behstant.com\/blog\/\",\"name\":\"The Code\",\"description\":\"Learn Web Solutions in WordPress, PHP, jand also purchase code solutions.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/behstant.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"http:\/\/behstant.com\/blog\/#\/schema\/person\/760327e1ee480ad2aabe8e40d784ec9f\",\"name\":\"Reedyseth\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/117af509aa15be89968fe955258a7bf8ed362ec2adf1afcf2af50a976f2349fa?s=96&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/117af509aa15be89968fe955258a7bf8ed362ec2adf1afcf2af50a976f2349fa?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/117af509aa15be89968fe955258a7bf8ed362ec2adf1afcf2af50a976f2349fa?s=96&r=g\",\"caption\":\"Reedyseth\"},\"description\":\"My Google Profile+\",\"sameAs\":[\"http:\/\/behstant.com\"],\"url\":\"https:\/\/behstant.com\/blog\/author\/reedyseth\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Error de conexion Netbeans 6.9.1 con SQL Server &#187; The Code","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:\/\/behstant.com\/blog\/java\/error-de-conexion-netbeans-6-9-1-con-sql-server\/","og_locale":"en_US","og_type":"article","og_title":"Error de conexion Netbeans 6.9.1 con SQL Server &#187; The Code","og_description":"Bueno despu\u00e9s de estar intentado muchas veces y horas la conexion y meterme en todos lados del sistema solucione mi problema de una forma muy f\u00e1cil. Primero que nada, la solucion que presento a continuaci\u00f3n no garantiza que vaya a ser la misma en los mismos equipos. Actualmente estaba haciendo la conexion con las siguientes ... Read more","og_url":"https:\/\/behstant.com\/blog\/java\/error-de-conexion-netbeans-6-9-1-con-sql-server\/","og_site_name":"The Code","article_published_time":"2011-04-12T18:33:00+00:00","author":"Reedyseth","twitter_card":"summary_large_image","twitter_creator":"@Reedyseth","twitter_site":"@Reedyseth","twitter_misc":{"Written by":"Reedyseth","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/behstant.com\/blog\/java\/error-de-conexion-netbeans-6-9-1-con-sql-server\/#article","isPartOf":{"@id":"https:\/\/behstant.com\/blog\/java\/error-de-conexion-netbeans-6-9-1-con-sql-server\/"},"author":{"name":"Reedyseth","@id":"http:\/\/behstant.com\/blog\/#\/schema\/person\/760327e1ee480ad2aabe8e40d784ec9f"},"headline":"Error de conexion Netbeans 6.9.1 con SQL Server","datePublished":"2011-04-12T18:33:00+00:00","mainEntityOfPage":{"@id":"https:\/\/behstant.com\/blog\/java\/error-de-conexion-netbeans-6-9-1-con-sql-server\/"},"wordCount":284,"commentCount":16,"articleSection":["Base de Datos","Java","Netbeans"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/behstant.com\/blog\/java\/error-de-conexion-netbeans-6-9-1-con-sql-server\/","url":"https:\/\/behstant.com\/blog\/java\/error-de-conexion-netbeans-6-9-1-con-sql-server\/","name":"Error de conexion Netbeans 6.9.1 con SQL Server &#187; The Code","isPartOf":{"@id":"http:\/\/behstant.com\/blog\/#website"},"datePublished":"2011-04-12T18:33:00+00:00","author":{"@id":"http:\/\/behstant.com\/blog\/#\/schema\/person\/760327e1ee480ad2aabe8e40d784ec9f"},"breadcrumb":{"@id":"https:\/\/behstant.com\/blog\/java\/error-de-conexion-netbeans-6-9-1-con-sql-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/behstant.com\/blog\/java\/error-de-conexion-netbeans-6-9-1-con-sql-server\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/behstant.com\/blog\/java\/error-de-conexion-netbeans-6-9-1-con-sql-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/behstant.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Error de conexion Netbeans 6.9.1 con SQL Server"}]},{"@type":"WebSite","@id":"http:\/\/behstant.com\/blog\/#website","url":"http:\/\/behstant.com\/blog\/","name":"The Code","description":"Learn Web Solutions in WordPress, PHP, jand also purchase code solutions.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/behstant.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"http:\/\/behstant.com\/blog\/#\/schema\/person\/760327e1ee480ad2aabe8e40d784ec9f","name":"Reedyseth","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/117af509aa15be89968fe955258a7bf8ed362ec2adf1afcf2af50a976f2349fa?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/117af509aa15be89968fe955258a7bf8ed362ec2adf1afcf2af50a976f2349fa?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/117af509aa15be89968fe955258a7bf8ed362ec2adf1afcf2af50a976f2349fa?s=96&r=g","caption":"Reedyseth"},"description":"My Google Profile+","sameAs":["http:\/\/behstant.com"],"url":"https:\/\/behstant.com\/blog\/author\/reedyseth\/"}]}},"_links":{"self":[{"href":"https:\/\/behstant.com\/blog\/wp-json\/wp\/v2\/posts\/91","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/behstant.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/behstant.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/behstant.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/behstant.com\/blog\/wp-json\/wp\/v2\/comments?post=91"}],"version-history":[{"count":0,"href":"https:\/\/behstant.com\/blog\/wp-json\/wp\/v2\/posts\/91\/revisions"}],"wp:attachment":[{"href":"https:\/\/behstant.com\/blog\/wp-json\/wp\/v2\/media?parent=91"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/behstant.com\/blog\/wp-json\/wp\/v2\/categories?post=91"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/behstant.com\/blog\/wp-json\/wp\/v2\/tags?post=91"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}