为什么连接数据库失败呢? [问题点数:0分]

Bbs1
本版专家分:0
结帖率 100%
Bbs5
本版专家分:4124
Bbs4
本版专家分:1520
Bbs2
本版专家分:386
Bbs4
本版专家分:1153
Bbs7
本版专家分:24520
Blank
红花 2002年1月 Java大版内专家分月排行榜第一
2001年12月 Java大版内专家分月排行榜第一
2001年11月 Java大版内专家分月排行榜第一
2001年5月 Java大版内专家分月排行榜第一
2001年4月 Java大版内专家分月排行榜第一
2001年3月 Java大版内专家分月排行榜第一
Blank
黄花 2002年3月 Java大版内专家分月排行榜第二
2002年2月 Java大版内专家分月排行榜第二
2001年10月 Java大版内专家分月排行榜第二
asp.net页面连接数据库失败为什么?
页面错误提示rn在建立与服务器的连接时出错。在连接到 SQL Server 2005 时,在默认的设置下 SQL Server 不允许进行远程连接可能会导致此<em>失败</em>。 (provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错) rnrn另外asp.net用的数据库sql server 2005企业版的,我用sql server 2005 express可不可以做服务连接,因为那个例子可能是用企业版创建的表,我用express版可以打开吗?rnrn还有就是sql server 2005<em>为什么</em>没有mangange studio这个,是不是要另外装一个,rn
为什么总说我连接数据库失败???
using System;rnusing System.Collections;rnusing System.ComponentModel;rnusing System.Data;rnusing System.Drawing;rnusing System.Web;rnusing System.Web.SessionState;rnusing System.Web.UI;rnusing System.Web.UI.WebControls;rnusing System.Web.UI.HtmlControls;rnusing System.Data.SqlClient;rnnamespace WebApplication2rnrn /// rn /// WebForm1 的摘要说明。rn /// rn public class WebForm1 : System.Web.UI.Pagern rn protected System.Data.SqlClient.SqlConnection sqlConnection1;rn protected System.Web.UI.WebControls.Button Button1;rn protected System.Web.UI.WebControls.DataGrid DataGrid1;rn rn private void Page_Load(object sender, System.EventArgs e)rn rn // 在此处放置用户代码以初始化页面rnrn tryrn rn string sqlcn = "workstation id=WY;packet size=4096;integrated security=SSPI;data source=WY;persist security info=False;initial catalog=pubs";rn SqlConnection cn = new SqlConnection(sqlcn);rn cn.Open();rnrn SqlCommand cmd = new SqlCommand("author_infor",cn);rn cmd.CommandType = CommandType.StoredProcedure;rn SqlDataAdapter da = new SqlDataAdapter(cmd);rn //DataSet ds = new DataSet();rn da.Fill(dtb);rn DataGrid1.DataSource =dtb;rn DataGrid1.DataBind();rn rn catch(System.Exception err)rn rn Response.Write(err.Message);rn rn rn rnrn #region Web 窗体设计器生成的代码rn override protected void OnInit(EventArgs e)rn rn //rn // CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。rn //rn InitializeComponent();rn base.OnInit(e);rn rn rn /// rn /// 设计器支持所需的方法 - 不要使用代码编辑器修改rn /// 此方法的内容。rn /// rn private void InitializeComponent()rn rn this.Load += new System.EventHandler(this.Page_Load);rnrn rn #endregionrn rnrn
求教为什么连接数据库老是失败
[img=https://img-bbs.csdn.net/upload/201511/18/1447854749_187551.jpg][/img][img=https://img-bbs.csdn.net/upload/201511/18/1447854622_536955.jpg][/img],rnrn在设断点的地方总是出现错误,不知道是哪里出了问题
为什么连接数据库屡次失败
我使用wsad5.1连接mysql,db2数据库。可是按照教科书步骤作,都<em>失败</em>了。错误如下:rnconnection name:Con1rnDatabase:mysqlrnUser ID:rootrnPassword:(empty)rndatabase type:mysql,V3.23rnJDBC driver:mm.mysql jdbc net driverrnhost: localhostrnport number:3306rnClass location:mysql-connector-java-3.2.0-alpha-bin.jarrnconnection URL:(自动生成)rnrn连接后报错:rnIWAS0126E Problems encountered while trying to establish connection Con1.Reason:"java.sql.Savepoint"rnrnDB2地联结错误也是如此。报错如下:rnJVM terminated.Exit code=128rnC:\program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\.\eclipse\jre\bin\javaw.exern-Xj9rn-cp C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\.\eclipse\startup.jar org.eclipse.core.launcher.Mainrn-os win32rn-ws win32rn-arch x86rn-showsplash C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\.\eclipse\eclipse.exe -showsplash 600rn-data C:\Documents and Settings\waxiao-n\My Documents\IBM\wsappdev51\workspacernrn虽然我也下载了mysql的jdbc驱动包,但是我也不知道解压后该怎么用、具体解压到哪去:mysql-connector-java-3.2.0-alpha.zip。下载位置:www.mysql.comrn参考文档位置:rnCSDN技术中心 wsad5入门.htmrnCSDN技术中心 JSP+Java Bean访问MySQL数据库.htmrnrn使用开发环境:winXP+wsad5.1.2+mysql3.2.3/db2 8.1
为什么Server.CreateObject 失败呢?
我在页面中写rnrnrnProgIDMM.MmCtrl.1是我通过CLASSID7F148866-F98C-44EA-93A2-32B4BB9C1799在注册表中找到的rnrn访问后rnMicrosoft VBScript 编译器错误 错误 '800a03f6' rnrn缺少 'End' rnrn/iisHelp/common/500-100.asp,行242 rnrn服务器对象 错误 'ASP 0177 : 800401f3' rnrnServer.CreateObject <em>失败</em> rnrn/test/test.asp,行6 rnrn无效的 ProgID。 若要获取关于此消息的更多的信息,请访问 Microsoft 联机支持站点: http://www.microsoft.com/contentredirect.asp 。rnrn这什么原因呢?rn这文件夹已经设置everyone 可以读写了rnrnrn
为什么调用失败呢?
前台:rn $.ajax(rn type: "POST",rn contentType: "application/json; charset=utf-8",rn url: "Default.aspx/PrintLabel",rn data: "'LOT':'123456789'", rn success: function (result) rn alert("o000");rn alert(result.d);rn ,rn error: function (a) alert("error") rn );rnrn后台:rn [WebMethod]rn public static string PrintLabel(string LOT)rn rn return LOT; rn rnrn结果第一个弹出框是对的,第二个一致是0,即使我后台写 return “aaaa”; 还是弹出0
为什么跟踪失败呢?
我设单步,当step out(shift+F11)就跳出个菜单上写Can't trace into system DLLs. rn请大侠指教,谢谢! rn我在学校的机子上没有上述提示,在自己机子上就有,是不是VC设置问题呢?? rnrn
连接数据库失败
我本来已经搞好了一个利用SQL Server作为后台开发的一个学校管理系统rn 软件已经做好了rn 并且SQL建立的数据库及表的语句我都写好了rn 但是我就是那个配置文件不知道怎么来写rn 运行时都提示"<em>连接数据库</em><em>失败</em>"rn 我希望帮帮忙rnrn
连接数据库失败
1、大家看看我这么写有问题吗?rn2、2005和2003<em>连接数据库</em>的代码有区别吗?rnrnusing System;rnusing System.Data;rnusing System.Configuration;rnusing System.Web;rnusing System.Web.Security;rnusing System.Web.UI;rnusing System.Web.UI.WebControls;rnusing System.Web.UI.WebControls.WebParts;rnusing System.Web.UI.HtmlControls;rnusing System.Data.SqlClient;rnrnpublic partial class _Default : System.Web.UI.Page rnrn protected void Page_Load(object sender, EventArgs e)rn rn rn rn protected void Button1_Click(object sender, EventArgs e)rn rn tryrn rn SqlConnection myConn = new SqlConnection();rn string strConn = "server=localhost;uid=sa;pwd=;database=pubs";rn myConn.ConnectionString = strConn;rn myConn.Open();rn Response.Write(" ");rn myConn.Close();rn rn catchrn rn Response.Write(" ");rn rn rnrn
连接数据库失败??
rnrn系统说该页无法显示。(别的程序能正常显示)rn我的系统是2k server,是个单机单用户,以上的gg是服务器,student是数据库名rnxsjk是表名。我想可能是我<em>连接数据库</em>的语法错了,我也不知道我错在那,阁下能rn帮帮看看吗??rn谢谢!!
连接数据库失败
我在自己的机器上安装了oracle client,通过sql plus连接到服务器时出错,错误代码为rn12638,提示信息为凭证检索<em>失败</em>
部署后怎么连接数据库失败呢?
我在web服务器已经安装了NET Framework 1.1版可再发行组件包、mdac2.8,运行时提示sql server连接被拒绝,但在开发的机子上运行却没有这种出错情况。
为什么fopen打开失败呢?
bool Creat_Text(const char* str, const char* filename)nn char path[1024] = 0;n GetCurrentDirectory(1024, (LPWSTR)path);n strcat(path,"//");n strcat(path,filename);nn FILE* fp = fopen(path,"a+");n if (NULL == fp)n n return false;n nn fputs(str,fp);nn fclose(fp);n return true;n_
为什么程序运行中连接数据库失败!?急!
应用程序中有个库存查询界面,5秒钟对这个界面上的数据更新一遍,两三台机子进行测试,没有问题.30、40台机子一起用后,会随机的出现某几台机子会出现与数据库断开的情况!!不知道是不是刷新的关系!?还是由于其他的原因?!服务器(win2000 server与sybase数据库,1G的内存),sybase的server。cfg文件中我设置了50用户,200M的内存!rn请各位大虾多多赐教!
为什么连接数据库实例失败???请帮忙阿
各位大侠。rn我的本上有两个数据库实例,但现在其中一个数据库实例无法连接,在SQLPLUS中用用户名/密码@实例名连接的时候报错,错误提示如下:Ora_12520:TNS 监听程序无法找到需要的服务器类型的可用句柄。rn这是什么原因阿,如何解决,请各位大虾指教,小弟不胜感激。
打开串口失败 为什么呢?
VS08下编的win32程序 打开串口 <em>失败</em><em>为什么</em>呢?rn 建的是STANDARDSDK MIPSII平台设备的 程序放入设备中,设备串口和电脑PC机相连 rn 运行后,发现程序 打开串口<em>失败</em>?rn 有哪几种原因呢?驱动方面有问题?是不是驱动方面对串口的配置不对呢?还是怎么呢? 我不懂驱动rnvoid SendData(HDC hdc,LPCSTR buffer)rnrn HANDLE hcom;rn COMMCONFIG cc;rn DCB dcb;rn DWORD pt;rn RECT rect=20,20,60,60;rn hcom=CreateFile(L"COM1:",GENERIC_WRITE|GENERIC_READ,0,NULL,OPEN_EXISTING,NULL,NULL);rn if(hcom==INVALID_HANDLE_VALUE)rn rn DrawText(hdc,L"fail",5,&rect,DT_CENTER);rn return;rn rn GetCommState(hcom,&dcb);rn dcb.BaudRate=CBR_9600;rn dcb.fBinary=TRUE;rn dcb.fParity=FALSE;rn dcb.ByteSize=8;rn dcb.Parity=NOPARITY;rn dcb.StopBits=ONESTOPBIT;rn dcb.fRtsControl=RTS_CONTROL_ENABLE;rn dcb.fDtrControl=DTR_CONTROL_ENABLE;rn SetCommState(hcom,&cc.dcb);rn WriteFile(hcom,buffer,2,&pt,&ov);rnrnrn是不是也要在驱动中,把串口配置名为 COM1呢 (设备中共有两个串口)
为什么安装VC6.0失败
我的电脑是win2000专业版本,加SP4补丁,加OFFICE2000rn<em>为什么</em>安装VC6.0与VB6.0时,总到最后文件复制完毕后,提示安装<em>失败</em>,详细查看www.microsoft.com/msdn
装载图片失败----为什么呢?
rnrnrn BITMAP bm;rn HBITMAP hBitmap;rn HDC hSrcDC; rnrnrnhSrcDC = CreateCompatibleDC(m_memodc->m_hDC );rn hBitmap=(HBITMAP)LoadImage(AfxGetInstanceHandle(),temp,IMAGE_BITMAP,0,0,LR_LOADFROMFILE |LR_SHARED);//|LR_CREATEDIBSECTION);rn rn sint=GetObject(hBitmap, sizeof BITMAP, &bm);rn SelectObject(hSrcDC, hBitmap);rn rn GetClientRect(&rect);rn ::SetStretchBltMode(m_memodc->m_hDC ,COLORONCOLOR); rn ::StretchBlt(m_memodc->m_hDC, rect.left, rect.top, rect.right, rect.bottom, hSrcDC, 0, 0, bm.bmWidth, bm.bmHeight,+SRCCOPY);rnrnrn///以上代码运行一段时间后就出现图片文件装载<em>失败</em>rn///代码本身是每隔10多秒就装载一幅图,然后再在memode上做图,再显示出来,rn///可是到后面就显示不出来做为背景的图片了?rn///求救高手,谢谢rn
loadXML总是失败为什么呢?
环境是 vs2008,一个从vc6.0升级上来的工程。rn在使用loadXML的是,总是无法成功。rn测试用的xml文档可以ie里头正确显示。rnCoUninitialize();rn是已经调用了的。rnrnbool HtmlItf::IsSuccess(BSTR sXML)rnrnrnIXMLDOMDocument *pXmlDoc=NULL; rnrnHRESULT hr=CoCreateInstance(CLSID_DOMDocument,NULL, CLSCTX_INPROC_SERVER|CLSCTX_LOCAL_SERVER/*CLSCTX_ALL*/, IID_IXMLDOMDocument,(LPVOID*)&pXmlDoc); rnrnif(hr == S_OK)rnrnVARIANT_BOOL bFlag=VARIANT_FALSE;rnpXmlDoc->put_async(VARIANT_FALSE);rnpXmlDoc->put_validateOnParse(VARIANT_TRUE);rnhr = pXmlDoc->loadXML(sXML,&bFlag); ///get_documentElement(&pNodeElement);rnrnif(hr != S_OK)return false;rnrnIXMLDOMNodeList *pNodeList;rnrnhr = pNodeElement->get_childNodes(&pNodeList);rnrnif(hr == S_OK)rnrnIXMLDOMNode *pStateNode;rnBSTR s;rnBSTR sNodeName;rnlong NodeLen;rnpNodeList->get_length(&NodeLen);rnfor(int i=0;iget_item(i,&pStateNode);rnpStateNode->get_nodeName(&sNodeName);rnpStateNode->get_text(&s);rnif(sNodeName = BSTR("state"))rnrnif(s==BSTR("0"))rnreturn false;rnelse if(s==BSTR("1"))rnreturn true;rnrnrnrnrnrnreturn false;rn
为什么创建文件总是失败呢?
rn普通用户, 用open函数创建文件(不存在该文件)rnfd = open( path, O_CREAT | O_RDWR, S_IRUSE | S_IWUSR );rnrn<em>为什么</em>这样创建文件总是<em>失败</em>呢?如果时超级用户就没有这个问题。
为什么调用API失败呢?
我的系统是WIN XP,程序中用了下面的API,然后程序运行时报错:说找不到RegisterServiceProcess函数的入口。rnrn请问,该怎样解决?rnrnrnrnrnrnrnrnrnPrivate Declare Function GetCurrentProcessId Lib "kernel32" () As LongrnrnPrivate Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwType As Long) As LongrnrnPrivate Const RSP_SIMPLE_SERVICE = 1rnPrivate Const RSP_UNREGISTER_SERVICE = 0rnrnPrivate Sub Form_Load()rnrn Call RegisterServiceProcess(GetCurrentProcessId, 1)rnrnEnd Subrn
Metasploit连接数据库失败
Failed to connect to the database: could not connect to server: Connection refused Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432?
连接数据库失败与Log文件
我做的是个很小的 学生信息管理系统。当是做的时候用的是自带的ASA并创建了log!当我把程序拷到另外的机器上是<em>连接数据库</em>连不上!!!rnrn我查了一些资料,说是创建了log的原因!首先::原因是log导致的吗????其次:如果是 怎么才能连的上!!
连接数据库失败 急!
在建立与服务器的连接时出错。在连接到 SQL Server 2005 时,在默认的设置下 SQL Server 不允许进行远程连接可能会导致此<em>失败</em>。 (provider: 命名管道提供程序, error: 40 - 无法打开到 SQL Server 的连接)rnrn怎么解决啊?
myeclips6.0+tomcat6.0+sql2000连接数据库失败
public Connection getConnToSql2(String server,String dbname,String user,String pass,String port)rn rn //SQL Server驱动程序,用微软提供的JDBC驱动程序 rn sqldriver = "com.microsoft.jdbc.sqlserver.SQLServerDriver"; rn sqlURL = "jdbc:microsoft:sqlserver://"; //连接字符串一部分rn tryrn //完整的连接字符串rn sqlURL =sqlURL+server+":"+port+";DatabaseName="+dbname+";USER="+user+";PASSWORD="+pass+"";rn Class.forName(sqldriver);rn conn = DriverManager.getConnection(sqlURL);rn catch(Exception e)rn System.out.println("操作数据库出错,请仔细检查");rn System.err.println(e.getMessage());rn rn return conn;rn rnrn已经上是连接SQL2000的代码,怎么一连接就<em>失败</em>,不知道问题出在哪里?
C++连接数据库失败
在C++用DataGrid连接没有问题可以把表里的数据显示出来,rn但是我用rn _ConnectionPtr pConn(__uuidof(Connection));rnrnpConn->ConnectionString="Provider=SQLOLEDB.1;Persist Security Info=False;User ID=test1;Initial Catalog=HRSYS";rnpConn->Open("", "", "111111", adConnectUnspecified);rnrn只要运行到open时就会出现如下错误rn[DBNETLIB][ConnectionOpen (Connect()).]SQL Server 不存在或拒绝访问rnrn在头文件里加了 rn#import "C:\Program Files\Common Files\System\ado\msado15.dll" no_namespace rename("EOF","adoEOF") rename("BOF","adoBOF")rnrn请问这个是什么原因呢 谢谢rnrn
VB.NET连接数据库失败
以下是连接的代码:rnImports System.Data.SqlClientrnrnPublic Class Form1rn Dim conn As SqlConnection = New SqlConnection("Data Source=CONAN-PC\SQLExpress; AttachDbFilename=D:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\libry.mdf; Integrated Security= True; Initial Catalog=libry; Connect Timeout=30; User Instance= True")rn Dim adapter As SqlDataAdapterrn Dim dataset As New DataSetrn Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Loadrn End Subrnrn可是显示连接不上数据库,请问是什么问题呀?
OCILIB连接数据库初始化失败
vs10平台 win7 64位操作系统 我想通过我这台机器去连接虚拟机里的数据库 rn但OCI_Initialize 初始化的时候总是返回<em>失败</em> 我这台机器没有安装Oracle 因为我要写个程序访问服务器上的数据 有什么办法不
VC程序连接数据库失败
程序的客户端和服务器还有sql 2000应该没问题,就是运行时出现“数据库连接<em>失败</em>”“数据库查询<em>失败</em>”,不知道怎么回事,有的说是要配置数据源ODBC,不过我编程时编的SQL文件里面没有ODBC,还用配置吗?rn或者我把源代码用发上来吗?rn感觉应该是数据库配置问题吧?是不是还需要配置数据库?
连接数据库失败,请帮帮忙!
在JBuilder 6 + Weblogic 6.1 + MSSQLServer2000环境下:rnrn执行下述代码时出现异常,请高手帮忙解决一下,在此谢过:rn rn Connection con = null;rn tryrn rnrn Class.forName("weblogic.jdbc.mssqlserver4.Driver");rnrn jTextArea2.setText("success 1");rn con = DriverManager.getConnection ("jdbc:weblogic:mssqlserver4:Northwind@localhost","sa","pwd")rn jTextArea2.setText("success 2");rn Statement st = con.createStatement();rn jTextArea2.setText("success 3");rn ResultSet res = st.executeQuery("select * from Employees");rn ............rnrnrnjava.sql.SQLException: Can't open a socket on localhost:1433. Check host and port number and make sure the security manager allows this connection. You can also try running the SocketApplet (java.net.ConnectException: Connection refused: connect).
【求助】jsp页面连接数据库失败
数据库是mysql,TOMCAT的\conf\Catalina\localhost\dd.xml配置如下:rnrnrn rnrn--------------------------------------------------------------------------------rnJSP页面报错如下:rnHTTP Status 500 - rnrn--------------------------------------------------------------------------------rnrntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnorg.apache.jasper.JasperException: javax.servlet.ServletException: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications link failurernrnLast packet sent to the server was 0 ms ago.)rn org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:491)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:401)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rnrnrnroot cause rnrnjavax.servlet.ServletException: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications link failurernrnLast packet sent to the server was 0 ms ago.)rn org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:862)rn org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)rn org.apache.jsp.tomcatTest_jsp._jspService(tomcatTest_jsp.java:94)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rnrnrnroot cause rnrnorg.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications link failurernrnLast packet sent to the server was 0 ms ago.)rn org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)rn org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)rn org.apache.jsp.tomcatTest_jsp._jspService(tomcatTest_jsp.java:76)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rnrnrnroot cause rnrncom.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failurernrnLast packet sent to the server was 0 ms ago.rn sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rn sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)rn sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)rn java.lang.reflect.Constructor.newInstance(Constructor.java:513)rn com.mysql.jdbc.Util.handleNewInstance(Util.java:406)rn com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)rn com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2103)rn com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:718)rn com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:46)rn sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rn sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)rn sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)rn java.lang.reflect.Constructor.newInstance(Constructor.java:513)rn com.mysql.jdbc.Util.handleNewInstance(Util.java:406)rn com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:302)rn com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:282)rn org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)rn org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)rn org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)rn org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)rn org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)rn org.apache.jsp.tomcatTest_jsp._jspService(tomcatTest_jsp.java:76)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rnrnrnroot cause rnrncom.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failurernrnLast packet sent to the server was 0 ms ago.rn sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rn sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)rn sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)rn java.lang.reflect.Constructor.newInstance(Constructor.java:513)rn com.mysql.jdbc.Util.handleNewInstance(Util.java:406)rn com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)rn com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:666)rn com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1069)rn com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2031)rn com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:718)rn com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:46)rn sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rn sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)rn sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)rn java.lang.reflect.Constructor.newInstance(Constructor.java:513)rn com.mysql.jdbc.Util.handleNewInstance(Util.java:406)rn com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:302)rn com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:282)rn org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)rn org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)rn org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)rn org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)rn org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)rn org.apache.jsp.tomcatTest_jsp._jspService(tomcatTest_jsp.java:76)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn...............
连接数据库失败的问题
各位前辈: rn 我在用Delphi编写数据库程序的时候,编译生成EXE文件,在我台机可以运行,但拿到别人台机,则提示找不到数据库文件,我的数据库文件(mdb)与程序文件(EXE)都是在同一个程序目录中,而且在数据连接属性里设的是相对路径。理论上讲应该是可以找到数据库的,因为在同一目录,请问各位高手有没有什么idea!谢谢rn jackyrong
VC连接数据库失败
[code=c]CoInitialize(NULL);rn rn HRESULT hr = S_FALSE;rn ULONG ulRow = 0;rnrn _ConnectionPtr adocnct = NULL;rn _RecordsetPtr Rowset;;rn _bstr_t bsConn = "Provider=sqloledb;Initial Catalog=student;Data Source=********,***;";rnrn tryrn rn TESTHR(adocnct.CreateInstance(__uuidof(Connection)));rn //adocnct.CreateInstance("ADODB.Connection");rn adocnct->ConnectionTimeout = 30;rn adocnct->Open(bsConn, _T("sa"), _T("admin"), adConnectUnspecified);rn rn catch(_com_error &e)rn rn ErrorPtr pErr = NULL; rn if (adocnct->Errors->Count > 0)rn rn int n = adocnct->Errors->Count;rn for (int i=0; iErrors->GetItem(i);rn printf("Error number: %x\t%s\n", pErr->Number,(LPCSTR)pErr->Description); rn rn rnrn _bstr_t bstrSource(e.Source()); rn _bstr_t bstrDescription(e.Description()); rnrn printf("Error\n"); rn printf("\tCode = %08lx\n", e.Error()); rn printf("\tCode meaning = %s\n", e.ErrorMessage()); rn printf("\tSource = %s\n", (LPCSTR) bstrSource); rn printf("\tDescription = %s\n", (LPCSTR)bstrDescription); rnrn [/code] 我的代码是这个 我在本机测试一直连接不成功 open那块一直卡 但是我上传到服务器上运行 就能运行并连接成功 求哪位大神给个解决方案
ado连接数据库失败
非常奇怪:rn#import "C:\Program Files\Common Files\System\ado\msado15.dll" \rn no_namespace rename("EOF", "adoEOF")rn ::CoInitialize(NULL);rn _ConnectionPtr conn;rn HRESULT hr;rn hr = conn.CreateInstance(__uuidof(Connection));rn if(FAILED(hr))rn rn AfxMessageBox("failed");rn rn elsern rn AfxMessageBox("success");rn rnrn tryrn rn conn->Open("Provider = SQLOLEDB;Server = chenxin;Database = master;uid = sa;pwd = sa","","",NULL);rn rn catch(_com_error e)rn rn AfxMessageBox("数据库连接<em>失败</em>!");rn rnrn总是提示链接数据库<em>失败</em>,请高手指点,谢谢!
Navicat 连接数据库失败的原因
Navicat <em>连接数据库</em><em>失败</em>, 个人总结原因分两类 : 一 : Navicat 软件本身的原因 : 实际上就是 oci.dll 文件, 对应的就是一个 instantclient 文件夹, 里面包含 oci.dll 文件 oci.dll 的instantclient 文件夹是根据需要进行额外下载的, 理论上是可以随意放在电脑上的, 但是我们一般基于分类好管理, 都会放在...
mysql连接数据库失败
问题:    错误中包含not allow connection字样   原因:    mysql没有开启远程连接访问权限   解决:   1、进入mysql命令行内   2、执行命令  GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION; flush privileg
SQLyog连接数据库失败
数据库连接<em>失败</em>的问题
请教,连接数据库失败的原因
rnConnstr="DBQ="+server.mappath("new/newdata.mdb")+";DefaultDir=;DRIVER=Microsoft Access Driver (*.mdb);driverId=25’FIL=MS Access;ImplicitCommitSync=Yes;MaxBufferSize=512;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UserCommitSync=Yes;"rn连接的是rnSet Conn=Server.CreateObject("ADODB.Connection") rnConn.Open Connstr rn系统老是说Conn.Open Connstr 这句错误rn错误类型:rnMicrosoft OLE DB Provider for ODBC Drivers (0x80004005)rn我试过用系统DSN方式来连接,也不行,同样的错误。rn我是新手,刚刚接触asp,是不是还需要什么设置呢,系统是windows 2000+IIS5.0rn我验证过,服务器可以执行asp文件,hello,world!例子可以实现。rnrn
MAMP连接数据库失败解决方法
一直是用的是MAMP集成环境,最近发现一个问题,<em>连接数据库</em><em>失败</em>。。。 代码: mysql_connect(‘localhost:8888’,'root','root'); 用过MAMP的童鞋都知道,MAMP安装时默认的是8888端口,也就是说我们访问localhost,必须打localhost:8888,直接打localhost是访问不了的。 当然,我们<em>连接数据库</em>时:mysql_con...
COM+组件连接数据库失败
我用vb 6.0写了一个测试COM+下远程传输Recordset对象的例子,组件的TestC返回long值,Test返回一个recordset对象。rn虚拟机server 2003,本机是win7 64位操作系统。rn我在虚拟机里面和win7系统下运行相同代码测试这两个方法,虚拟机里面能执行返回结果,win7下只能执行TestC方法,执行Test方法报用户sa不能登录。网上找了一下,也没有找到解决方法,求指教。rnrncom+组件代码:rnOption ExplicitrnrnDim conn As ADODB.ConnectionrnDim rst As ADODB.RecordsetrnDim count As IntegerrnrnPublic Function Test() As ADODB.Recordsetrn Dim strconn As Stringrn strconn = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;pwd=sa;Initial Catalog=Northwind;Data Source=UFO-EBB345CC64C"rn conn.ConnectionString = strconnrn conn.CursorLocation = adUseClientrn conn.Openrn rst.ActiveConnection = connrn rst.Source = "select * from orders"rn rst.Openrn Set Test = rstrnEnd FunctionrnrnPublic Function testC() As Longrn count = count + 1rn testC = countrnEnd FunctionrnrnPrivate Sub Class_Initialize()rn count = 0rn Set conn = New ADODB.Connectionrn Set rst = New ADODB.RecordsetrnEnd SubrnrnPrivate Sub Class_Terminate()rn If rst.State = adStateOpen Then rst.Closern Set rst = Nothingrn If conn.State = adStateOpen Thenrn conn.Closern End Ifrn Set conn = NothingrnEnd Subrnrn远程客户端代码和本地的测试代码:rnOption ExplicitrnDim ts As proRemote.clsRemoternrnrnPrivate Sub Command1_Click()rn Dim s As Integerrn s = ts.testCrn MsgBox CStr(s)rnEnd SubrnrnPrivate Sub Command2_Click()rn Dim ss As ADODB.Recordsetrn Set ss = ts.Testrn MsgBox ss(2)rn ss.Closern Set ss = NothingrnEnd SubrnrnPrivate Sub Form_Initialize()rn Set ts = New proRemote.clsRemotern rnEnd SubrnrnPrivate Sub Form_Terminate()rn Set ts = NothingrnEnd Sub
ADO方式连接数据库失败
使用ADO方式<em>连接数据库</em><em>失败</em>,代码如下:rn[code=C/C++]void ADOConn::OnInitADOConn()rnrn ::CoInitialize(NULL);rn tryrn rn m_pConnection.CreateInstance("ADODB.Connection");rnrn CString strConnect;rn strConnect = _T("Provider==SQLOLEDB.1");rn strConnect += _T(";Password=")+DbInfo.csPassward;rn strConnect += _T(";Persist Security Info=True");rn strConnect += _T(";User ID=")+DbInfo.csUSerName;rn strConnect += _T(";Initial Catalog=")+DbInfo.csDBName;rn strConnect += _T(";Data Source=")+DbInfo.csDadaSource;rn strConnect += _T("\n;");rnrn m_pConnection->Open(strConnect.GetBuffer(strConnect.GetLength()+1),"","",adModeUnknown);rn rn catch (_com_error e)rn rn AfxMessageBox(e.Description());rn rn[/code]rn在open的时候出现错误,错误提示:rn[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specifiedrnrn请教各位高人.
win10连接数据库失败,求助
报错如下图rn[img=https://img-bbs.csdn.net/upload/201712/19/1513666162_482120.jpg][/img]rnrn情况是这样的:rn有一台开发用的电脑,系统是win10rn在这台电脑上边用虚拟机装了winserver2008,用桥接方式与本机处于同一个局域网rn在winserver2008上装上了sqlserver2012rnrn在win10开发机上,用.net4.0 写了一个程序,连接指向虚拟机的数据库,运行时出现了以上报错rn做了各种排查:rn1、win10开发机上装有Microsoft SQL Server Management Studio 17,能正常连上虚拟机上的sqlserver2012数据库服务rn2、把编译好的程序放到虚拟机上运行,正常连上数据库rn3、把程序放到同一局域网上另一台win7家用机上,装上了.net 4.0后就能正常连接rn4、把程序放到同一局域网上另一台win10家用机上,出现同样的报错rnrn看上去好像跟win10有关,但不知道怎么解决,问题查了好几天都没处理好,请各位大神帮帮忙,谢谢
Hibernate连接数据库失败
java.lang.ClassNotFoundException: com.mchange.v2.c3p0.DataSourcesrn报错信息是不是跟数据源有关,怎么解决?
连接数据库失败什么原因
HTTP Status 500 - rnrn--------------------------------------------------------------------------------rnrntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnorg.apache.jasper.JasperException: org.apache.jasper.JasperException: Unable to load class for JSPrn org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:156)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rnrnrnroot cause rnrnorg.apache.jasper.JasperException: Unable to load class for JSPrn org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:620)rn org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:144)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rnrnrnroot cause rnrnjava.lang.ClassNotFoundException: org.apache.jsp.data_jsprn java.net.URLClassLoader$1.run(URLClassLoader.java:200)rn java.security.AccessController.doPrivileged(Native Method)rn java.net.URLClassLoader.findClass(URLClassLoader.java:188)rn org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:134)rn org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66)rn org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:618)rn org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:144)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/6.0.20 logs.rnrnrn系统提示错误如上,给答案请给具体点rnrn
mfc连接数据库失败
[code=c]void CAddDlg::OnBnClickedButton1()rnrn // TODO: 在此添加控件通知处理程序代码rn UpdateData(TRUE);rn CoInitialize(NULL);//初始化COM库rn _ConnectionPtr pConn(_uuidof(Connection));//利用智能指针定义了一个ADO Connection对象,rn //利用关键字_uuidof获取ADO Connection接口的全局唯一标识符(GUID),对pConn对象初始化rn _RecordsetPtr pRst(_uuidof(Recordset));//利用智能指针定义了一个ADO Recordset对象rn pConn->ConnectionString="Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=pubs;Data Source=XP-201308221218";//为数据口连接对象的连接字符串赋值rn pConn->Open("","","",adConnectUnspecified);//这里可以直接为这些参数传递一个空字符串,因为它们已经在连接字符串中设置好了rn //pRst=pConn->Execute("select * from 菜单",NULL,adCmdText);rn //pRst->AddNew(_variant_t(m_addname),m_addprice);rn //pRst->m_strName=m_addname;rn //pRst->AddNew("菜名",_variant_t(m_addname));rn //pRst->AddNew("单价",m_addprice);rnrn //pRst->AddNew();rn //pRst->PutCollect("菜单",_variant_t(m_addname));rn //pRst->Update();rnrn _variant_t RecordsAffected;rn pRst=pConn->Execute("INSERT INTO 菜单 (菜名,单价) VALUES ((_variant_t)m_addname,(_variant_t)m_addprice)",&RecordsAffected,adCmdText);rn pRst->Close();//关闭记录集rn pConn->Close();//关闭连接rn pRst.Release();//释放智能指针在COM接口上的引用计数rn pConn.Release();rn CoUninitialize();//卸载COM库[/code]rnrnrn错误为:estaurant.exe 中的 0x7c812fd3 处有未经处理的异常: Microsoft C++ 异常: 内存位置 0x0012ebbc 处的 _com_error。
VB连接数据库失败的解决方法
用VB做了一个管理系统,用到数据库查询,由于系统在局域网内使用的,所以有时候会碰到路由器断电或者网线掉线等情况发生,这是VB数据库查询错误,强制退出系统,有没有什么方法解决一下,可以在数据库连接不上时提示操作用户检查出现的问题,但是不要退出管理系统。下面是我用的<em>连接数据库</em>的代码:rnPublic Function ConnectString() _rn As StringrnrnConnectString = "Provider=SQLOLEDB.1;User ID=sa;password=12345633;Initial Catalog=carddatabase;Data Source=" & IPstrrnrnEnd FunctionrnPublic Function ExecuteSQL(ByVal SQL _rn As String, MsgString As String) _rn As ADODB.Recordsetrn'executes SQL and returns Recordsetrn Dim cnn As ADODB.Connectionrn Dim rst As ADODB.Recordsetrn Dim sTokens() As Stringrn rn On Error GoTo ExecuteSQL_Errorrn rn sTokens = Split(SQL)rn Set cnn = New ADODB.Connectionrn cnn.Open ConnectStringrn If InStr("INSERT,DELETE,UPDATE", _rn UCase$(sTokens(0))) Thenrn cnn.Execute SQLrn MsgString = sTokens(0) & _rn " query successful"rn Elsern Set rst = New ADODB.Recordsetrn rst.CursorLocation = 3rn rst.Open Trim$(SQL), cnn, _rn adOpenKeyset, _rn adLockOptimisticrn 'rst.MoveLast 'get RecordCountrn Set ExecuteSQL = rstrn MsgString = "查询到" & rst.RecordCount & _rn " 条记录 "rn End Ifrn rnExecuteSQL_Exit:rn Set rst = Nothingrn Set cnn = Nothingrn Exit FunctionrnExecuteSQL_Error:rn MsgString = "查询错误: " & _rn Err.Descriptionrn Resume ExecuteSQL_ExitrnEnd Function
VC 连接数据库失败
我的程序上现在有一个数据库文件:TTIM4.mdf。我用VS打开程序,连接的时候出错、rnrn<em>连接数据库</em><em>失败</em> 错误信息 idispatch error #3105rnrn代码如下:rnrnrn AfxOleInit();rn HRESULT hr;rn //Data Source=.\SQLEXPRESS;AttachDbFilename="D:\SourceCode\仿qq p2p通讯\TTIM4.mdf";Integrated Security=True;Connect Timeout=30;User Instance=Truern tryrn rn hr = m_pConnection.CreateInstance("ADODB.Connection");///创建Connection对象rn if(SUCCEEDED(hr))rn rn hr = m_pConnection->Open("Provider=SQLOLEDB.1;Data Source=HET8-20140818HH\SQLEXPRESS;AttachDbFilename=TTIM4.mdf;Integrated Security=SSP;User Instance=True;Database=TTIM4;Trusted_Connection=yes","","",adModeUnknown);///<em>连接数据库</em>rn rn rn rn catch(_com_error e)///捕捉异常rn rn CString errormessage;rn errormessage.Format(L"<em>连接数据库</em><em>失败</em>!\r\n错误信息:%s",e.ErrorMessage());rn AfxMessageBox(errormessage);///显示错误信息rn return FALSE;rn
VC++连接数据库失败解决方法
VC++<em>连接数据库</em><em>失败</em>解决方法.使VC++对数据库编程的时候,开始几天连接正常,后来忽然某天连接不上了,代码没有问题,也不报错,就是连接不上,也找不到 原因和解决的方法.本人曾经就遇到这样的情况,上网发现很多朋友也遇到同样的饿问题,找不出解决方法,后来自己发现个方法,绝对有效,解决这个问题
连接数据库失败是什么原因?
用APACHE作为服务器,MYSQL作为数据库,都是用ROOT用户,密码:123456。报<em>连接数据库</em><em>失败</em>是什么原因?rn我用SQLYOG查看数据库是正常的。用户名和密码没错。是什么原因?
ADO连接数据库失败
CDialogEx::OnInitDialog();rn // TODO: Add extra initialization herern _bstr_t strcnn(_T("Provider=Microsoft.ACE.OLEDB.12.0; Data Source=leobank.accdb"));rn tryrn rn m_pConnection.CreateInstance(__uuidof(Connection));rn m_pConnection->Open(strcnn,_T(""),_T(""),adModeUnknown);rn m_pRecordset.CreateInstance(__uuidof(Recordset));rn rn catch (_com_error e)rn rn AfxMessageBox(_T("<em>连接数据库</em><em>失败</em>"));rn rn return TRUE; // return TRUE unless you set the focus to a control
连接数据库失败,求请教。
[size=14px]大家好,我原来没做过PHP,所以想过来求教一下。rn 事情是这样的,我朋友找了一家公司做了一个展示性网站,然后用的是他们的空间。几个月前,感觉对方公司空间不稳定,然后申请了阿里云的空间,并且把PHP网站和数据库也移了过去。rn 但是昨天我朋友和这家公司空间合同到期后,突然网站就上不去了,找这家公司询问情况,对方表示 网站早已移到我朋友租的阿里云服务器,和他们空间到期后停止没有任何关系。[/size]rnrn[img=https://img-bbs.csdn.net/upload/201601/20/1453271443_928519.jpg][/img]rnrnA Database Error OccurredrnUnable to connect to your database server using the provided settings.rnrnrn database.php 文件中的设置rnrn[img=https://img-bbs.csdn.net/upload/201601/20/1453272389_242922.jpg][/img]rn
PB连接数据库失败
[code=VB][DBMS_PROFILES]rnProfiles=GMFCPD08rnrnrn[Profile GMFCPD08]rnDBMS=O10 Oracle10g (10.1.0)rnDatabase=rnUserId=rnDatabasePassword=rnLogId=mdmsidevrnLogPassword=mdmspwd1!rnServerName=117.105.92.**rnDBParm="Database='GMFCPD08'"rnLock=rnPrompt=FALSErnAutoCommit=FALSE[/code]rnrn这是pb连接的ini代码。。rn确定的是,数据库肯定能连上,因为我用Toad试练了一下,成功了。rn那面的数据库可能是11,应该没关系吧。我这用的是pb10.5所以,选项<em>连接数据库</em>上,没有11版本的oracle。只有10的。可是连接<em>失败</em>,报的是12154.在网上查,发现时无法解析指定的连接标识符。rn不知道问题是处在什么地方了。rnrn看它的一个文件代码有这些,不知道是什么能帮忙说明一下代码吗。rn[code=VB]global type gf_oracheck from function_objectrnend typernrnforward prototypesrnglobal subroutine gf_oracheck ()rnend prototypesrnrnglobal subroutine gf_oracheck ();boolean lb_filecheck, lb_checkrninteger li_FileNum, li_count, li_pos, li_FileNum_copyrnString ls_linernrn//Oracle Client TNSNAMES.ORA 파일 유무 체크rnlb_filecheck = FileExists(GS_TNSNAME)rnif Not lb_filecheck then returnrnrn//File Open(Read용과 Write용 두개를 Open)rnli_FileNum = FileOpen(GS_TNSNAME, LineMode!)rnli_FileNum_copy = FileOpen(GS_TNSNAME_COPY, LINEMODE!, WRITE!, LOCKREADWRITE!, REPLACE!)rnrnli_count = 0rnrnlb_check = falserndo while(true)rn if FileRead(li_FileNum , ls_line) = -100 then rn exit rn end if rn if trim(UPPER(mid(ls_line, 1, 9))) = "GMFCPD08=" or trim(UPPER(mid(ls_line, 1, 10))) = "GMFCPD08 =" then //TNS검색rn li_count = 1rn elsern if li_count > 0 and li_count < 7 then //TNS 6줄까지만 검색하여 IP를 변경한다.(다른 TNS를 수정할 수 있으므로)rn li_count++rn li_pos = Pos(ls_line, GS_OLD_IP_ADDR)rn if li_pos > 0 thenrn ls_line = Replace(ls_line, li_pos, len(GS_OLD_IP_ADDR), GS_IP_ADDR)rn lb_check = truern end ifrn end ifrn end ifrn FileWrite(li_FileNum_copy, ls_line)rnlooprnFileClose(li_FileNum)rnFileClose(li_FileNum_copy)rnrn//TNSNAME에 GMFCPD08이 없을 경우 마지막줄에 추가한다.rnif li_count = 0 thenrn li_FileNum = FileOpen(GS_TNSNAME, LineMode!, Write!, LockReadWrite!, Append!)rn// FileWrite(li_FileNum, "~r~nGMFCPD08 =~r~n" &rn// + " (DESCRIPTION =~r~n" &rn// + " (ADDRESS_LIST =~r~n" &rn// + " (ADDRESS = (PROTOCOL = TCP)(HOST = measuring.gmdat.com)(PORT = 1521))~r~n" &rn// + " )~r~n" &rn// + " (CONNECT_DATA =~r~n" &rn// + " (SID = GMFCPD08)~r~n" &rn// + " (SERVER = DEDICATED)~r~n" &rn// + " )~r~n" &rn// + " )")rn FileWrite(li_FileNum, "~r~nGMFCPD08 =~r~n" &rn + " (DESCRIPTION =~r~n" &rn + " (ADDRESS_LIST =~r~n" &rn + " (ADDRESS = (PROTOCOL = TCP)(HOST = 117.105.159.12)(PORT = 1525))~r~n" &rn + " )~r~n" &rn + " (CONNECT_DATA =~r~n" &rn + " (SID = GMFCPD08)~r~n" &rn + " (SERVER = DEDICATED)~r~n" &rn + " )~r~n" &rn + " )")rn FileClose(li_FileNum)rnelse rn if lb_check thenrn FileDelete(GS_TNSNAME) //기존 Tnsnames.ora파일 삭제rn FileCopy(GS_TNSNAME_COPY, GS_TNSNAME, True) //복사본의 이름을 tnsnames.ora로 변경rn end ifrnend ifrnFileDelete(GS_TNSNAME_COPY) //복사본을 삭제한다.rnrnrnend subroutinernrn[/code]
连接数据库失败”数据库时断时续
一个web应用连接一个oracle数据库,应用和数据库在同一台服务器上,登录web的时候会报“<em>连接数据库</em><em>失败</em>”,但有时候又能登。同时登录人数大概40多个,设置的最大session数是500。rn 查看数据库能正常登陆,应用也没死,服务器资源利用率不高,表空间也没满,在console里查看服务器的健康状况显示“overloaded”。rn 然后我把应用下掉,数据库重启,再把应用起起来,大概五分钟不到,服务器又成“overloaded”状态,数据库又开始时断时续状态。最后我只好把连接池重新建了一下,暂时没有问题,但是还没有测过几十个人同时登录的情况。rn 请问大侠,这是什么问题呢?之前也有几十个人同时登陆的问题,服务器表现良好,突然之间就瘫掉了,期间没有做过任何更改。
连接数据库失败,求帮助
[code=c]private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) rn if (textBox1 ->Text =="")rn rn MessageBox::Show ("请输入要连接的数据库名称");rnrn rn elsern rn tryrn rn String ^ConStr="Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=" + textBox1->Text ->Trim () + "Data Source=PC201305071632";rnrn SqlConnection ^conn=gcnew SqlConnection(ConStr);rnrn conn ->Open();rn if (conn->State==ConnectionState::Open )rn rn label1->Text = "数据库【" + textBox1->Text ->Trim () + "】已经连接并打开";rn rn rn catch(Exception ^ )rn rn MessageBox::Show ("数据库连接<em>失败</em>");rn rn rn [/code]rn如上,安照书上写的 改了下连接字符串 是哪里的问题? 可以编译 但是就是 总显示 连接<em>失败</em> 是连接字符串的问题吗?
Sql Server连接数据库失败
sql server<em>连接数据库</em><em>失败</em>,我们可以从以下几个方面去分析问题: 1.数据库服务是否打开。 2.数据库连接配置是否正确。 3.账号密码是否正确。2,3点都可以本地登录验证一下。 4.项目是否导入了jdbc相关的jar包。 以上都排除过后,就需要分析其他的原因了。在此记一下我的一个经历。有次启动项目包数据库连接<em>失败</em>的错,但是我昨天才登录成功了,什么都没动过,今天突然就不行,把以上原因...
用ODBC连接数据库失败
import java.sql.*; rnrnpublic class Example152 rn rnrn public static void main(String args[]) rn Connection con; rn Statement sql; rn ResultSet rs; rn try rn Class.forName("sunny.jdbc.odbc.JdbcOdbcDriver"); rn rn catch(ClassNotFoundException e) rn System.out.println(""+e); rn rn rn try rn con=DriverManager.getConnection("jdbc:odbc:sunny","gxy","123"); rn sql=con.createStatement(); rn rs=sql.executeQuery("SELECT name,english FROM chengjibiao WHERE english>=80 "); rn while(rs.next()) rn String name=rs.getString(1); rn int english=rs.getInt("english"); rn System.out.println("姓名:"+name); rn System.out.println("英语:"+english); rn rn con.close(); rn rn catch(SQLException e) rn System.out.println(e); rn rn rn rn rn rn我根据书本上的提示在控制面板中创建了数据源sunny,并选择了数据库student.mdb rnrn但是用上面的程序<em>连接数据库</em>(access数据库)后报错: rnjava.lang.ClassNotFoundException: sunny.jdbc.odbc.JdbcOdbcDriver rnjava.sql.SQLException: No suitable driver rnrn不知道是什么原因出现这样的错误 rn
连接数据库失败!急!!!
pb8.0的应用程序连oracle8i时报错:ORA_00020:maximum number of process(215) exceeded!
关于连接数据库失败的问题
各位前辈: rn 我用ADOConnection连接Access数据库,再用ADOQuery去连接ADOConnection,在设置”数据连接属性“的时候我在输入数据库名称里用的是相对路径(即不带任何盘符与路径,只有文件名与扩展名),编译运行生成EXE文件在我自己台机运行能找到数据库文件,但拿到别人的机器里运行就总提示找不到数据库文件,我都不知<em>为什么</em>?请各位高手指点迷津,谢谢,万分感激!rn jackyrong
hibernate连接数据库失败
org.hibernate.tool.schema.spi.SchemaManagementException: Unable to open JDBC connection for schema management targetrn at org.hibernate.tool.schema.internal.TargetDatabaseImpl.prepare(TargetDatabaseImpl.java:42)rn at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigration(SchemaMigratorImpl.java:56)rn at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:129)rn at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:97)rn at org.hibernate.internal.SessionFactoryImpl.(SessionFactoryImpl.java:481)rn at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444)rn at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:708)rn at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:724)rn at com.hibernate.test.MyTest.testsave(MyTest.java:17)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)rn at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)rn at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)rn at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)rn at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)rn at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:69)rn at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:48)rn at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)rn at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)rn at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)rn at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)rn at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)rn at org.junit.runners.ParentRunner.run(ParentRunner.java:292)rn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)rnCaused by: java.sql.SQLException: Connections could not be acquired from the underlying database!rn at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:118)rn at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:689)rn at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:140)rn at org.hibernate.c3p0.internal.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:73)rn at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcEnvironmentInitiator.java:180)rn at org.hibernate.tool.schema.internal.TargetDatabaseImpl.prepare(TargetDatabaseImpl.java:38)rn ... 31 morernCaused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.rn at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1418)rn at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:606)rn at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:526)rn at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutAndMarkConnectionInUse(C3P0PooledConnectionPool.java:755)rn at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:682)rn ... 35 morernrn我的配置文件rn端口号我改成了3366 没有错rnrn rn com.mysql.jdbc.Driverrn jdbc:mysql//192.168.23.1:3366/testrn rootrn 1234rn rn org.hibernate.dialect.MySQL5Dialectrn rn org.hibernate.c3p0.internal.C3P0ConnectionProviderrn rn threadrn rn rn updatern rn rn
php连接数据库失败
使用xampp时phpmyadmin页面可以进去,但是php<em>连接数据库</em>时显示错误,以下是错误提示内容rnAccess denied for user ''@'localhost' (using password: NO)rnrnrn求大神帮忙看看,百度了好多问题还在,有点懵
C#.net连接数据库失败
我的数据库在服务器dbserver99上,我在其他机器上运行ODBC测试都可以,dbserver99上本地测试也可以,就是不能按如下方式在其他机器上访问数据库。我用的是SqlConnection (.NET) 。请大家帮忙查一下rn
sqlcmd 连接数据库失败
sqlcmd -S 127.0.0.1\MSSQLSERVERrnHResult 0x57,级别 16,状态 1rnSQL 网络接口: 连接字符串无效 [87].rnSqlcmd: 错误: Microsoft SQL Native Client : 建立到服务器的连接时发生错误。连接到rn SQL Server 2005 时,默认设置 SQL Server 不允许远程连接这个事实可能会导致<em>失败</em>。rn。rnSqlcmd: 错误: Microsoft SQL Native Client : 登录超时已过期。rnrnps:已经启动TCP\IPrnrn这个什么原因?
mysql_connect连接数据库失败
用命令行可以登录mysql,进行查询等各种操作rn试了一个最基本的<em>连接数据库</em>操作<em>失败</em>了,代码如下rnrnrnrn我确信用户名密码是对的rnrn打开页面,提示rnWarning: mysql_connect(): Access denied for user 'user'@'localhost' (using password: NO)rnrn看了不少资料,不太管用。rn谢谢
服务器连接数据库失败!!!!asp.net
“/”应用程序中的服务器错误。rn--------------------------------------------------------------------------------rnrn用户 'cnp3018_db' 登录<em>失败</em>。 rn说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 rnrn异常详细信息: System.Data.SqlClient.SqlException: 用户 'cnp3018_db' 登录<em>失败</em>。
*.ini文件连接数据库失败
INI:rn// Profile testrnSQLCA.DBMS = "MSS Microsoft SQL Server"rnSQLCA.Database = "test"rnSQLCA.LogPass = "sql"rnSQLCA.ServerName = "26A07AA40D419"rnSQLCA.LogId = "sa"rnSQLCA.AutoCommit = FalsernSQLCA.DBParm = ""rnrnApplication的OPEN事件中代码:rnsqlca.logpass=profilestring("e:\test.ini","database","logpassword"," ")rnsqlca.servername=profilestring("e:\test.ini","database","servername"," ")rnsqlca.UserID=profilestring("e:\test.ini","database","UserID"," ")rnsqlca.DBPass=profilestring("e:\test.ini","database","databasepassword"," ")rnsqlca.Lock=profilestring("e:\test.ini","database","LOCK"," ")rnsqlca.DbParm=profilestring("e:\test.ini","database","DbParm"," ")rnconnect using sqlca;rn messagebox("error",string(sqlca.sqlcode))rnif sqlca.sqlcode=-1 thenrn rollback;rn halt close;rn messagebox("1","1")rn return rnend if rnrnrnopen(w_exam4)rnrnmessagebox()提示sqlca.sqlcode=-1,请问是哪里写的有问题?谢谢
jdbc连接数据库失败
[img=https://img-bbs.csdn.net/upload/201705/07/1494142353_881179.png][/img][img=https://img-bbs.csdn.net/upload/201705/07/1494142362_451997.png][/img][img=https://img-bbs.csdn.net/upload/201705/07/1494142370_217447.png][/img]rnrn麻烦各位给看一下,错误信息如下:rn五月 07, 2017 3:10:15 下午 org.apache.catalina.core.StandardContext listenerStartrnSEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/conf/spring/spring-kernal.xml]: Invocation of init method failed; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1512)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)rn at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4723)rn at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)rn at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)rn at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)rn at java.util.concurrent.FutureTask.run(Unknown Source)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)rn at java.lang.Thread.run(Unknown Source)rnCaused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.rn at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)rn at java.lang.reflect.Constructor.newInstance(Unknown Source)rn at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)rn at com.mysql.jdbc.Util.getInstance(Util.java:381)rn at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:984)rn at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)rn at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)rn at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2364)rn at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:781)rn at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:46)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)rn at java.lang.reflect.Constructor.newInstance(Unknown Source)rn at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)rn at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:352)rn at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:284)rn at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1375)rn at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1431)rn at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:618)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1638)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1579)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509)rn ... 20 morernCaused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failurernrnThe last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.rn at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)rn at java.lang.reflect.Constructor.newInstance(Unknown Source)rn at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)rn at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)rn at com.mysql.jdbc.MysqlIO.(MysqlIO.java:343)rn at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2288)rn ... 39 morernCaused by: java.net.ConnectException: Connection timed out: connectrn at java.net.DualStackPlainSocketImpl.connect0(Native Method)rn at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)rn at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)rn at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)rn at java.net.AbstractPlainSocketImpl.connect(Unknown Source)rn at java.net.PlainSocketImpl.connect(Unknown Source)rn at java.net.SocksSocketImpl.connect(Unknown Source)rn at java.net.Socket.connect(Unknown Source)rn at java.net.Socket.connect(Unknown Source)rn at java.net.Socket.(Unknown Source)rn at java.net.Socket.(Unknown Source)rn at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:253)rn at com.mysql.jdbc.MysqlIO.(MysqlIO.java:292)rn ... 40 more
Jsp+SQLServer200连接数据库失败
我<em>连接数据库</em>的程序如下:rnpublic Connection getConnection()rn String user="sa";rn String pwd="";rnrn String classforname="com.microsoft.jdbc.sqlserver.SQLServerDriver";rn String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=xscj";rn tryrn Class.forName(classforname);rn con=DriverManager.getConnection(url,user,pwd);rn stmt=con.createStatement();rnrn catch(SQLException e) e.printStackTrace();rn catch(ClassNotFoundException e)e.printStackTrace();rnrn return con;rn rn说明:我的数据库名是xscj,数据库用户sa ,没有密码。结果程序执行到 con=DriverManager.getConnection(url,user,pwd); 这句后就抛出异常:rnrntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnorg.apache.jasper.JasperExceptionrn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrnrnroot cause rnrnjava.lang.NullPointerExceptionrn javax.servlet.GenericServlet.getServletContext(GenericServlet.java:159)rn bookshop.login_confirm.doError(login_confirm.java:78)rn bookshop.login_confirm.doPost(login_confirm.java:28)rn org.apache.jsp.login_005fconfirm_jsp._jspService(login_005fconfirm_jsp.java:55)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/5.0.27 logs.rnrn请各位多多关照,这是什么原因? 急急急急急急
dbExpress连接数据库失败
我用SQLConnetction组件(dbExpress)连接到SQLServer服务器时我在dbExpress Connections对话框中设置连接的HostName属性为“Localhost” User属性为“sa” Password属性为“空”<em>为什么</em>不行,测试连接总是<em>失败</em>。弹出一个“Failure to Connect:SQL Error :Error Mapping Failed的对话框。(我SQL Server服务器用的是SQL Server身份验证 ,登录名为“sa” 密码为“空”)
DBHelper中连接数据库失败
在asp.net中我将连接字符串直接写在页面中就能连接成功,但是将连接字符串写在DBHelper中就出现以下错误:rn[color=#FF0000]rn“/web”应用程序中的服务器错误。rn--------------------------------------------------------------------------------rnrn无法打开登录 'Stuassmanager' 中请求的数据库。登录<em>失败</em>。rn用户 'PC-200911301058\Administrator' 登录<em>失败</em>。 rn说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 rnrn异常详细信息: System.Data.SqlClient.SqlException: 无法打开登录 'Stuassmanager' 中请求的数据库。登录<em>失败</em>。rn用户 'PC-200911301058\Administrator' 登录<em>失败</em>。[/color]rn[code=C#]rnpublic static class DBHelperrn rn //<em>连接数据库</em>的字符串rn //private static string conStr = "server=.;Initial Catalog=Stuassmanage;Integrated Security=true;";rn ////<em>连接数据库</em>的字符串rn //private static string conStr ="Data Source=PC-200911301058;Initial Catalog=Stuassmanage;Integrated Security=True";rn //私有的连接对象rn private static SqlConnection connection;rnrn public class Datarn rn private Data()rn rnrn rn public static string SqlConStringrn rn get return ConfigurationManager.AppSettings["StuassmanageConnectionString"]; rn rn rnrn //公共静态的连接对象供外部访问rn public static SqlConnection Connectionrn rn getrn rn if (connection == null)rn rn //connection = new SqlConnection(conStr);rn connection = new SqlConnection(Data.SqlConString);//新建一个连接对象rn connection.Open();rn rn if (connection.State == ConnectionState.Closed)//如果连接对象是关闭的,则将其打开rn rn connection.Open();rn rn if (connection.State == ConnectionState.Broken)//如果连接对象的连接断开了,现将其关闭再打开rn rn connection.Close();rn connection.Open();rn rn return connection;rn rn rn[/code]rn以上几种连接字符串都不行,包括将连接字符串写在webconfig
连接数据库失败(初学。net)
<em>连接数据库</em><em>失败</em>,SQLSever2000已装,系统2000AdvancedServer,程序如下WebForm1.aspx.csrnusing System;rnusing System.Data.SqlClient;rnusing System.Collections;rnusing System.ComponentModel;rnusing System.Data;rnusing System.Drawing;rnusing System.Web;rnusing System.Web.SessionState;rnusing System.Web.UI;rnusing System.Web.UI.WebControls;rnusing System.Web.UI.HtmlControls;rnrnnamespace ex01rnrn /// rn /// WebForm1 的摘要说明。rn /// rn public class WebForm1 : System.Web.UI.Pagern rn private void Page_Load(object sender, System.EventArgs e)rn rn // 在此处放置用户代码以初始化页面rn Response.Write("link ");rn SqlConnection myConnection=new SqlConnection("server=localhost;uid=sa;pwd=sa");rn tryrn rn myConnection.Open();rn Response.Write("OK!");rn rn catch rn rnrn Response.Write("Sorry!");rn rn rnrn #region Web Form Designer generated codern override protected void OnInit(EventArgs e)rn rn //rn // CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。rn //rn InitializeComponent();rn base.OnInit(e);rn rn rn /// rn /// 设计器支持所需的方法 - 不要使用代码编辑器修改rn /// 此方法的内容。rn /// rn private void InitializeComponent()rn rn this.Load += new System.EventHandler(this.Page_Load);rn rn #endregionrn rnrn显示:rnlinkrnSorry!rnrn致谢!rn
客户端程序连接数据库失败
服务器是win2003的系统,sql 2000的数据库,[color=#FF0000]在其他电脑上安装客户端程序,都可以连上数据库[/color]。rn但是惟独有一个电脑装上程序以后连不上数据库(该台电脑的防火墙都关掉了),我用telnet ip 1433都能连上,说明这台电脑没有屏蔽1433端口,但是程序却连不上数据库([color=#FF0000]<em>连接数据库</em>的字符串肯定是对的,因为其他电脑上装的同样的客户端可以连到数据库[/color])。rn请问各位大虾们问题出在哪呢?
问题:连接数据库失败的困惑
环境:oracle9.0.1 + win2000+pb9.0,rnrn刚开始在开发时,安装oracle9i客户端,使用pb9.0通过microsoft odbc from oralce连接服务器,总是报“无法解析server_name",(我连接sqlplus正常),后来从oracle网站下载了 Oracle ODBC Client driver,使用后连接服务器ok了,程序运行正常,但进行打包发布到其他客户端(均安装9i client,没装pb9.0)机子时,rn报:DBMS 090 oracle9i (9.0.1) is not supported in your current installtion,难道odbc 对oracle支持真的不够,还是我使用不当?折磨我已经二天,SOS! rnrn附ini文件rnrnSQLCA.DBMS = "O90 Oracle9i (9.0.1)"rnSQLCA.LogPass = "BBB"rnSQLCA.ServerName = "ourserver"rnSQLCA.LogId = "gb"rnSQLCA.AutoCommit = FalsernSQLCA.DBParm = ""rnrnconnect;rnif sqlca.sqlcode <> 0 thenrn MessageBox ("数据库连接<em>失败</em>!", sqlca.sqlerrtext)---在此处报错rn returnrnend ifrnOPEN(w_main)
C#连接数据库失败怎么办
数据库我不太熟悉,不知道哪里写错了rnusing System;rnusing System.Collections.Generic;rnusing System.ComponentModel;rnusing System.Data;rnusing System.Drawing;rnusing System.Text;rnusing System.Windows.Forms;rnusing System.Data.SqlClient;rnrnnamespace lianjieSQLrnrn public partial class Form1 : Formrn rn public Form1()rn rn InitializeComponent();rn rnrn private void button1_Click(object sender, EventArgs e)rn rn if (textBox1.Text=="")rn rn MessageBox.Show("请输入数据库名称");rnrn rn elsern rn tryrn rn string constr = "server=LESLIE-PC;database=textBox1.Text ;uid=leslie_PC;pwd=";rn SqlConnection conn = new SqlConnection(constr);rn conn.Open();rn if (conn.State==ConnectionState.Open)rn rn label1.Text = " 数据库" + textBox1.Text.Trim() + "已经连接并打开";rn rn rn catch (System.Exception )rn rn MessageBox.Show("数据库打开<em>失败</em>");rn rn rn rn rnrn数据库用户名和密码我不知道在哪里看string constr = "server=LESLIE-PC;database=textBox1.Text ;uid=leslie_PC;pwd="问题就处在这里,请问怎么查看数据库的服务器名称和用户名密码,我用的是SQL server 2008这个软件
怎样显示“连接数据库失败”?
public Connection getConnection()rn rn String nurl="";rn String user="";rn String password="";rn String driverAddr="";rn tryrn rn driverAddr="com.microsoft.jdbc.sqlserver.SQLServerDriver";rn Class.forName(driverAddr).newInstance();rn nurl=this.nurl; rn user=this.user;rn password=this.password; rn this.con=DriverManager.getConnection(nurl,user,password);rn rn catch(Exception e)rn rn System.out.println("联机数据库<em>失败</em>¡");rn rn finallyrn rn return this.con;rn rn我的问题是如果出现异常的,并且能够捕捉到,但是怎么样才能让ie显示<em>连接数据库</em><em>失败</em>?
Ubuntu下连接数据库失败
错误信息msg:Client does not support authentication protocol requested by server; consider upgrading MySQL client,sqlstate:08004 mysql 版本:5.7 解决办法 1.mysql -uroot -ppwd 2.ALTER USER 'root'@'localhost' I...
linux下连接数据库失败 ora-12154
前两天<em>连接数据库</em>时突然出现:<em>连接数据库</em><em>失败</em> ora-12154 最后百度了一下 说是oracle数据库的监听服务挂了 应该进行启动。 启动过程在这里做个记录(不过就是一些简单的命令而已): 1 使用xshell连接oracle所部署的服务器; 2 执行sqlplus username/password,<em>连接数据库</em>; 3 执行connect /as ...
JFinal连接数据库失败
.com.jfinal.plugin.activerecord.ActiveRecordException: java.sql.SQLException: Connections could not be acquired from the underlying database! [Cause: com.mchange.v2.resourcepool.CannotAcquireResour
[棘手]连接数据库失败!!!莫名其妙!
在建立与服务器的连接时出错。在连接到 SQL Server 2005 时,在默认的设置下 SQL Server 不允许进行远程连接可能会导致此<em>失败</em>。(provider:命令管道提供程序,error:40-无法打开到SQL Server的连接)(Microsoft SQL Server,错误:2)rnrn问题是这样的,这个数据库服务器用了好长时间,一直都是好好的,密码也没变过。可是昨天......rn使用企业管理器sa帐户密码登录...<em>失败</em>!rn使用企业管理器并且选择"使用Windows身份验证"登录依然<em>失败</em>!当时就郁闷了~rn可是过了一会儿,好了,一切正常了!还挺兴奋的!rn可是今天,又无法登录了,无论是用sa帐户还是Windows身份验证,这到底是什么原因啊???rn太困惑了,请高手指路~
如何判断连接数据库失败
Set conn=Server.CreateObject ("ADODB.Connection")rn conn.open "DRIVER=SQL Server;SERVER=localhost;UID=sa;PWD=sa;DATABASE=test"rn如何判断conn.open <em>失败</em>,找了一些资料,它们用超时来判断,不行,如果是用户名或密码错误,返回错误时间很短
连接数据库失败com.util.DBAccessException: ???????????????!
at com.util.ConnectionManager.getConnection(ConnectionManager.java:29)rn at com.operation.TitlesBean.getTitles(TitlesBean.java:29)rn at org.apache.jsp.books_jsp._jspService(books_jsp.java:167)rn at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)rn at java.lang.Thread.run(Unknown Source)rnrnrn确定是数据库的问题但不知道出在哪 ????
JDBC连接数据库失败
代码如下:rnpackage chapter8;rnimport java.sql.*;rnpublic class SimpleJDBC rnrn public static void main(String[] args) throws SQLException, ClassNotFoundException rn // TODO Auto-generated method stubrn Class.forName("com.mysql.jdbc.Driver");rn System.out.println("Driver loaded");rn Connection connection = DriverManager.getConnection("jdbc:mysql://localhost/test");rn System.out.println("Database connected");rn Statement statement = connection.createStatement();rn ResultSet resultSet = statement.executeQuery("select firstName, mi, "rn + "lastName from Student where lastName " + " = 'Smith'");rn while(resultSet.next())rn System.out.println(resultSet.getString(1) + "\t" + rn resultSet.getString(2) + "\t" + resultSet.getString(3));rn connection.close();rnrn rnrnrn控制台信息如下:rnURL:[http://api.push.baidu.com/rest/3.0/tag/add_devices]rnparams:[apikey=xxxxxxxxxxxxxxxxxxxx&channel_ids=%5B%22xxxxxxxxxxxxxxxxx%22%5D&device_type=3&sign=24868fb6a168e0b4d15a1cdcea8edf0b&tag=xxxxx&timestamp=1494248588]rnHttpStatusCode:[500]rnResponse:["request_id":301132284,"error_code":30600,"error_msg":"Internal Server Error"]rnrnrequestId: 301132284, errorCode: 30600, errorMessage: Internal Server Errorrn
高分求教,连接数据库失败
环境:SQL SERVER 2000,程序C++、Delphi。rn整套系统分为服务器端与客户端;rn数据库与服务器端(C++开发)装在一台机器上面,客户端(Delphi开发)装在另一台机上面。rn服务器端<em>连接数据库</em>方式为ODBC连接(先配置ODBC,rn然后再用字符串去指定这个ODBC),rn客户端连接方式为ADO(用了一个数据模块TDataModule里面定义了一个TADOConnection,用UDL文件配置数据库参数,然后TADOConnection,去加载UDL文件去<em>连接数据库</em>)。rnrn现在的问题是:客户端的程序一旦长时间放在不动,你再去操作的话就抛"连接<em>失败</em>",服务器端有时候也会出现连接问题,从而导致执行语句不成功。rnrn请问这种问题要怎么解决?
急!连接数据库失败
我在服务器中的SQL SERVER建立数据库Arn在DELPHI中用ADO连接,在数据库连接属性中rn提供者:MICROSOFT OLE DB PROVIDER FOR SQL SERVERrn连接:服务器名:SQL SERVER服务器的名字rn 登陆信息:SA ,密码(密码正确的)rn服务器上选择的数据库:数据库名rn在测试连接中提示rn初始化提供者中发生错误,测试连接<em>失败</em>,客户端无法建立连接rn那是那里的错误哩,请指教rn
flex 连接数据库失败??
我是按 http://hi.baidu.com/dapao98301/blog/item/eff43ed557b44509a08bb75f.html 给我的提示做的,现在总是rnrnrnrn这段代码,弹出找不到“dataService1” ,我在remoting-config.xml 配置中加入的是如下代码:rnrnrn rn com.connectDB.DateServiceImplrn rnrnrn确定类文件是没错的,我的数据库是用mysql,mysql的jar放置了lib下面,不知道还有什么没有配置的吗????rnrn请各位大侠帮帮忙,急!!!
通用access软件界面编程,书加源码下载
通用access软件界面编程,书加源码,非常适合access软件编程的初学者和老手 相关下载链接:[url=//download.csdn.net/download/llxxhh2002/1987684?utm_source=bbsseo]//download.csdn.net/download/llxxhh2002/1987684?utm_source=bbsseo[/url]
视频需要密码的解决方法下载
如果视频需要密码的解决方法 华图视频文件播放问题解决方法 相关下载链接:[url=//download.csdn.net/download/xuxiaof1999/2317828?utm_source=bbsseo]//download.csdn.net/download/xuxiaof1999/2317828?utm_source=bbsseo[/url]
连连看外挂C++源码下载
以前写的,玩练练看的时候用人家的外挂总感觉不happy,于是自己写了个,直接编译可用的qq连连看源码,希望此游戏还未改版! 相关下载链接:[url=//download.csdn.net/download/yulongying/3477889?utm_source=bbsseo]//download.csdn.net/download/yulongying/3477889?utm_source=bbsseo[/url]
相关热词 c# gdi 占用内存 c#中遍历字典 c#控制台模拟dos c# 斜率 最小二乘法 c#进程延迟 c# mysql完整项目 c# grid 总行数 c# web浏览器插件 c# xml 生成xsd c# 操作sql视图
我们是很有底线的