连接数据库出错,求解答! 2C

2016-11-08 12:49:31 [WARN ][ThreadPoolAsynchronousRunner:608] com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@127fa03 -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks!
2016-11-08 12:49:31 [WARN ][ThreadPoolAsynchronousRunner:624] com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@127fa03 -- APPARENT DEADLOCK!!! Complete Status:
Managed Threads: 3
Active Threads: 3
Active Tasks:
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@1fd25ce (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1)
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@bd36fa (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2)
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@646bfb (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0)
Pending Tasks:
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@ed3b53
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@d1f0ad
Pool thread stack traces:
Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1,5,main]
java.net.PlainSocketImpl.socketConnect(Native Method)
java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
java.net.Socket.connect(Socket.java:529)
java.net.Socket.connect(Socket.java:478)
java.net.Socket.(Socket.java:375)
java.net.Socket.(Socket.java:189)
oracle.net.nt.TcpNTAdapter.connect(Unknown Source)
oracle.net.nt.ConnOption.connect(Unknown Source)
oracle.net.nt.ConnStrategy.execute(Unknown Source)
oracle.net.resolver.AddrResolution.resolveAndExecute(Unknown Source)
oracle.net.ns.NSProtocol.establishConnection(Unknown Source)
oracle.net.ns.NSProtocol.connect(Unknown Source)
oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:844)
oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:268)
oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:414)
oracle.jdbc.driver.T4CConnection.(T4CConnection.java:165)
oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2,5,main]
java.net.PlainSocketImpl.socketConnect(Native Method)
java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
java.net.Socket.connect(Socket.java:529)
java.net.Socket.connect(Socket.java:478)
java.net.Socket.(Socket.java:375)
java.net.Socket.(Socket.java:189)
oracle.net.nt.TcpNTAdapter.connect(Unknown Source)
oracle.net.nt.ConnOption.connect(Unknown Source)
oracle.net.nt.ConnStrategy.execute(Unknown Source)
oracle.net.resolver.AddrResolution.resolveAndExecute(Unknown Source)
oracle.net.ns.NSProtocol.establishConnection(Unknown Source)
oracle.net.ns.NSProtocol.connect(Unknown Source)
oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:844)
oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:268)
oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:414)
oracle.jdbc.driver.T4CConnection.(T4CConnection.java:165)
oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0,5,main]
java.net.PlainSocketImpl.socketConnect(Native Method)
java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
java.net.Socket.connect(Socket.java:529)
java.net.Socket.connect(Socket.java:478)
java.net.Socket.(Socket.java:375)
java.net.Socket.(Socket.java:189)
oracle.net.nt.TcpNTAdapter.connect(Unknown Source)
oracle.net.nt.ConnOption.connect(Unknown Source)
oracle.net.nt.ConnStrategy.execute(Unknown Source)
oracle.net.resolver.AddrResolution.resolveAndExecute(Unknown Source)
oracle.net.ns.NSProtocol.establishConnection(Unknown Source)
oracle.net.ns.NSProtocol.connect(Unknown Source)
oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:844)
oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:268)
oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:414)
oracle.jdbc.driver.T4CConnection.(T4CConnection.java:165)
oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)

1个回答

目测是连接异常,可能是连接池异常。你检查看看是不是连接池大小,然后在看看是不是忘记导入oracle的相关jar包了。或者环境不匹配。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
插入数据出错.求解答
我的工程中,含有多个PAGE对话框,我现在PAGE对话框上创建了一个CGrid控件,为了让我能在这控件上插入数据,我在PAGE代码中加了插入函数,如下:rn[code=C/C++]rnBOOL CPageJgcx::UpdataGrid(int iID,CString strtm,int iResult)rnrn CString sID=_T("");rn CString sResult=_T("");rn sID.Format("%d",iID);rn sResult.Format("%d",iResult);rnrn pGridResult->ShowWindow(SW_HIDE);rn pGridUpdata->ShowWindow(SW_SHOW);rnrn pGridUpdata->InsertRow(sID);rn pGridUpdata->SetRowHeight(pGridUpdata->GetRowCount()-1,pGridUpdata->GetRowHeight(0)); rn int nrow=pGridUpdata->GetRowCount()-1;rn pGridUpdata->SetItemText(nrow,1,strtm);rn pGridUpdata->SetItemText(nrow,2,sResult);rn pGridUpdata->SetRedraw(1,1);rn pGridUpdata->Invalidate();rn return TRUE;rnrn[/code]rn,如果我在当前page中调用这个函数,是正确的,但我在主对话框(不是PAGE),去调用这个函数,就出现错误,调用如下:rn[code=C/C++]rnCPageJgcx jgcx;rnjgcx.UpdataGrid(1,"fff",1);rn[/code],求解答?????????
asp页面连接数据库出错,请求解答
我在Win2000 server上安装了Oracle9i,链接数据库却出错,请高手解答:rn我的页面是这样写的:rn<%@ Language=VBScript %>rnrnrn New Document rnrnrntest odbc connect:rn rn<%rn dim dbname,g_re,g_cn,sqlstrrn dbname = "DRIVER=Microsoft ODBC for Oracle;UID=webcdr;PWD=1234;SERVER=webbill;"rn Set g_cn=server.CreateObject ("adodb.connection")rn Set g_re=server.CreateObject ("adodb.recordset")rn sqlstr="select * from rb_info "rn g_cn.open dbnamern g_re.open g_cn,sqlrn%>rn rntest success!rnrnrnrn提示错误如下:rnrntest odbc connect: rnrnMicrosoft VBScript 编译器错误 错误 '800a03f6' rnrn缺少 'End' rnrn/iisHelp/common/500-100.asp,行242 rnrnMicrosoft OLE DB Provider for ODBC Drivers 错误 '80004005' rnrn[Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle on SQL_HANDLE_ENV failed rnrn/yym.asp,行15rnrn请问我的问题出在什么地方?该如何解答rn
WPF初始化出错,求解答
这个是加载主页面的时候报的错误,WPF的 在Main mw=new Main()处出错rnat WpfClient.Login.Login.Image_MouseLeftButtonDown(Object sender, MouseButtonEventArgs e) in D:\LocalClient\Client\WpfClient\Login\Login.xaml.cs:line 433 at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent) at System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e) at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args) at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted) at System.Windows.Input.InputManager.ProcessStagingArea() at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input) at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport) at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel) at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
VS2010出错,求高手解答
上次打开的WinForm项目窗体设计视图没关闭的情况下rnrn下次再打开就会报错,把所有窗体设计视图关闭了,下次打开就不会报错,报错提示如下:rnrn rnrn[color=#800000]devenv.exe - 系统错误Exception Processing Message 0xc0000005 rnParameters0x000007FEFD5D715C 0x000007FEFD5D715C0x000007FEFD5D715C 0x000007FEFD5D715C[/color]rnrn rnrn请教是什么问题影响的?rnrn我重置过VS到默认状态了,但还是不能解决这个问题。
代码出错,求大神解答
using UnityEngine;rnusing System.Collections;rnrnpublic class cubeScript : MonoBehaviour rnrn // Use this for initializationrn void Start () rn rn rn rn rn // Update is called once per framern void Update () rn rn rn rn void OnGUI()rnrnrn if (GUI.Button(new Rect(440, Screen.height - 25, 65, 23), "Snapshot"))rn rn LoadHelp.UploadPNG(this, "Snapshot", delegate(bool result)rn rn if (result)rn rn Application.Externaleval_r("alert('ok')");rn rn rn );rn rnrnrn他说我有错错在 LoadHelp.UploadPNG(this, "Snapshot", delegate(bool result)这行rn然后显示是这样的错误Assets/DressingroomExample/cubeScript.cs(22,10): error CS0103: The name `LoadHelp' does not exist in the current contextrn这是什么问题?
zen-cart系统安装出错,求解答
安装了这个系统之后,模板总是显示不正确,出现偏差以及部分中间的内容不显示,应该不是模板的问题,在本地安装就可以正常显示,但是安装到服务器上就不行了,初步判定应该也不是服务器的问题,因为放到两个服务器上都不行,很纠结。有哪位老大安装过这玩意,给指点下!拜谢啦!问题如下图:rn[img=http://www.giftter.com/00.gif][/img]
c return 出错。求解答
感觉是不是我眼龊了哪里没看清楚,mid最后一次的值时2,然后return mid,result得到的却是1,为什么?rn```rn#includernrnint binary_Search(int a[],int low,int high,int key)rn if(low>high) return -1;rn elsern int mid=low+(high-low)/2;rn printf("low=%d,mid=%d,high=%d\n",low,mid,high);rn if(a[mid]==key) rn printf("a[mid]=%d,mid=%d\n",a[mid],mid);rn return mid;rn rn if(a[mid]key)rn binary_Search(a,low,mid-1,key);rn rnrnrnrnint main()rn int a[]=0,1,2,3,4,5,6,7,9,10,11,12,13,14,15,16;rn int result;rn result=binary_Search(a,0,16,2);rn printf("result=%d\n",result);rn return 0;rnrn```rnrnrn![图片说明](https://img-ask.csdn.net/upload/201602/23/1456217607_395491.png)
mysql创建表出错,求解答
CREATE TABLE seckill(n'seckill_id' BIGINT NOT NULL AUTO_INCREMENT COMMENT '秒杀商品id',n'name' VARCHAR(120) NOT NULL COMMENT '商品名称',n'number' INT NOT NULL COMMENT '商品数量',n'start_time' TIMESTAMP NOT NULL COMMENT '开始时间',n'end_time' TIMESTAMP NOT NULL COMMENT '结束时间',n'create_time' TIMESTAMP NOT NULL DEFAULT current_timestamp COMMENT '创建时间',nPRIMARY KEY (seckill_id),nKEY idx_start_time(start_time),nKEY idx_end_time(end_time),nKEY idx_create_time(create_time)n)ENGINE=InnoDB AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8 COMMENT '描述库存表';n[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''seckill_id' BIGINT NOT NULL AUTO_INCREMENT COMMENT '秒杀商品id',n'name' VA' at line 2
连接数据库出错。
conn.open 连接字符串的时候,总是出现下面的问题。rn怎么回事?rnrnMicrosoft OLE DB Provider for ODBC Drivers 错误 '80040e4d' rnrn[Microsoft][ODBC SQL Server Driver][SQL Server]用户 'web_msSite' 登录失败。原因: 未与信任 SQL Server 连接相关联。 rnrn我确认用户名账户和密码是存在且正确的。rn
连接数据库出错
Servlet中Init方法读取数据库配置文件rn public void init() throws ServletException rn try rn InputStream is = this.getServletContext().getResourceAsStream("/WEB-INF/classes/db.config");rn Properties p = new Properties();rn p.load(is);rn DB.url = p.getProperty("url");rn DB.driver= p.getProperty("driver");rn DB.username = p.getProperty("username");rn DB.password = p.getProperty("password");rn catch (Exception e) rn e.printStackTrace();rn rnrn配置文件信息db.configrnrndriver=net.sourceforge.jtds.jdbc.Driverrnurl=jdbc:jtds:sqlserver://localhost:1433/SelectCoursernusername=sarnpassword=sasarnrn连接数据库时代码如下:rnpublic class DbUtil rn public static void main(String[] args) rn System.out.println(new DbUtil().getConnection());rn rn public Connection getConnection() rn Connection con = null;rn try rn Class.forName(DB.driver);rn con = DriverManager.getConnection(DB.url, DB.username, DB.password);rn catch (Exception e) rn e.printStackTrace();rn rn return con;rn rnrnrn出现的错误是:rnjava.lang.NullPointerExceptionrn at java.lang.Class.forName0(Native Method)rn at java.lang.Class.forName(Unknown Source)rn at cn.edu.jmi.util.DbUtil.getConnection(DbUtil.java:32)rn at cn.edu.jmi.util.DbUtil.main(DbUtil.java:27)rnnullrn
连接数据库出错!
用VS2008 数据控件连接SQLserver2005标准版时出现在 [color=#FF0000]“建立与服务器的连接时出错。在连接到 SQL Server 2005 时,在默认的设置下 SQL Server 不允许进行远程连接可能会导致此失败。 (provider: 命名管道提供程序, error: 40 - 无法打开到 SQL Server 的连接)”[/color]……试了好几次,都以失败告终!不知道是下载的数据库有问题还是其他什么地方需要改的?求解决,谢谢!
连接数据库出错!
“/WebApplication1”应用程序中的服务器错误。rn--------------------------------------------------------------------------------rnrnLogin failed for user 'sa'. Reason: Not associated with a trusted SQL Server connection. rn说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
连接数据库出错?
java.sql.SQLException:Io异常:Connection refused(DESCRIPTION=(TMP=)(VSNNUM=150999040)(ERR=12505)(ERROR_STACK=(ERROR=(ERROR=(CODE=12505)(EMFI=4))))rn我的程序运行得很好,换了几个oracle服务器都没问题,但是现在换了另一台oracle却出现这种错误,一直没找到原因(用的是jdbc直接与数据库连接),如用odbc则可以连上.
连接数据库出错~
sql="select * from user where user='"&user&"' and password='"&password&"'"rnset conn=Server.CreateObject("adodb.connection")rnset userRS=Server.CreateObject("adodb.Recordset")rnconn.open "provider=Microsoft.jet.oledb.4.0; data source="&server.MapPath("forum.mdb")rnuserRS.open sql,conn,adOpenForwardOnly,adLockOptimistic,adCmdText //这一行报错
连接数据库出错?
rn try //扑捉异常错误rn rn TADOConnection *ADOConnection=new TADOConnection(NULL);rn ADOConnection->Connected=false;rn ADOConnection->ConnectionString="Provider=MSDASQL.1;Password=AAA;Persist Security Info=True;User ID=BBB;Data Source=CCC";rn ADOConnection->LoginPrompt=false;rn ADOConnection->Connected=true;rnrnrn catch(Exception &exception)rn rn Application->MessageBoxA(" 连接服务器不正确! \n 请检查网络或与系统管理员联系!","警告 !",MB_OK+MB_ICONSTOP);rn Application->Terminate();rn rnrn我用 ADOConnection 连接数据库 当连接数据库出错时好像catch 不能关闭程序 rn因为其他窗体要用到ADOConnectionrn所以老是在rnWINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)rnrn tryrn rn Application->Initialize();rn Application->Title = "";rn Application->CreateForm(__classid(TFormMain), &FormMain);rn Application->CreateForm(__classid(TFormLogin), &FormLogin);rn Application->CreateForm(__classid(TFormManage), &FormManage);rn .rn . rn .rn rn Application->Run();rn rnrn运行,不停的弹出对话框说"Miss Connection or ConnectionString"rn
连接数据库出错,
连接DBF数据库时提示:rnrn[Microsoft][ODBC 驱动程序管理器] 驱动程序不支持此功能
连接数据库出错!!
我用的是jbuilder9,在userhome里面加入了mysql的连接驱动程序MySQL,在tools/enterprise setup下面的Database Driver里面加入了MySQL.confrn在project properties/Required Libraries里面引入了MySQLrn我在frame里面添加了database,在他的connection里面的rnDriver里写入org.gjt.mm.mysql.Driver(com.mysql.jdbc.Driver也试过)rnURL里加入 :jdbc:mysql://localhost/test(我用SQLyog测试过,可以连接)rnusername:root(默认)rnpassword: (默认)rnclasspath里面也设置了路径rn但是每次测试连接都是报错,我的朋友在他的机器上面用了相同的方法却是一点问题都没有rn不知道是怎么回事,请哪位老大给点意见,谢谢!!!
PB连接数据库怎么这么多错误,求解答
[img=https://img-bbs.csdn.net/upload/201407/17/1405562227_101359.png][/img]
ado连接数据库出现的问题,(求高手解答)
我写的程序是用ado读取数据,但是软件运行后第一个读取的时候有时候连接上有时候连接不上,很不稳定,如果连接上了一直操作是没有问题的,但是放在那过个把小时再去取数据可能又连接不上了,连接的字符串是没有问题的rn有时候是读取几次出错后或者是重启动软件就可以连上了,不知道什么原因,下面是连接数据库的函数代码rn[code=C/C++]rnBOOL CAdoOleDB::Connect(LPCTSTR lpszConnectString, const long lOptions)rnrn tryrn rn HRESULT hr = m_ptrConnection.CreateInstance("ADODB.Connection");rn rn if (SUCCEEDED(hr))rn rn m_ptrConnection->CommandTimeout = 60;rn m_ptrConnection->Mode = adModeShareDenyNone;rn m_ptrConnection->CursorLocation = adUseClient; rn if (SUCCEEDED(m_ptrConnection->Open(lpszConnectString, _T(""), _T(""), lOptions)))rn return TRUE; rn rn rn catch (_com_error er)rn rn char buffer[MAX_PATH];rn sprintf(buffer, _T("error connecting database---%s\n"), er.ErrorMessage());rn MsgBox(buffer);rn rn return FALSE;rn rn catch (...)rn rn MsgBox(_T("while connectiong database,it is unknow error!!!"));rn rnrn return FALSE; rnrn[/code]rn程序中lpszConnectString参数是肯定正确的,另外调试从不出过这问题,调试环境是XP,但是现在出问题的环境是VSTA,会不会有点关系,另外测试用的5台VSTA机器好象有一台是一直没有问题的,会不会跟这个有关系或者说其中的一些系统设置问题?rn希望大家能给点意见或想法,谢谢了rnrn
一个VC.NET 中连接数据库的问题!!求解答~~~
我连接数据库部分的代码:rnLPCSTR strSql = "select * from vckbasetable";rn CString constr;rn constr.Format("Driver=SQL Server;Server=张伟;DATABASE=JLSY;UID=sa;PWD=");rn BSTR strB = constr.AllocSysString();rn tryrn rn m_pRecordset.CreateInstance("ADODB.Recordset");rn m_pConnection->Open(strB,"","",adModeUnknown);rn m_pRecordset->Open(_bstr_t(strSql), (IDispatch*)m_pConnection,adOpenDynamic,adLockOptimistic,adCmdText); rn _variant_t TheValue; //VARIANT数据类型rn TheValue = m_pRecordset->GetCollect("WZDM");//得到字段BIG_NAME的值rnrn可是我编译的时候总是说我定义的strSql是无效的指针,我改成CString类型的也是这个情况,拜托高手帮忙看看。我是新手。
求解答求解答
一般公司招C++程序员是写什么样的程序?windows程序还是什么?rnC++到底能写些什么东西?rn一直说写游戏写游戏,但是我就是不明白怎么写游戏?rnVC++?MFC?API?我怎么感觉这三样都是另外的语言啊???????
求解答,求解答,求解答,谢谢
![图片](https://img-ask.csdn.net/upload/201512/14/1450082237_371680.jpg)
连接数据库的疑问,盼望解答!!
大家知道连接数据库可以先加载数据库驱动,如:rnClass.forName("COM.ibm.db2.jdbc.app.DB2Driver").newInstance();rn然后建立一个数据库连接,如:rnConnection conn=DriverManager.getConnection(jdbc:db2:demo,USER,PASSWORD);rn可是我发现不提供用户名和密码也可以访问到我本地的db2 --demo数据库rn也就是说,用Connection conn=DriverManager.getConnection(jdbc:db2:demo);rn也可以从demo里面获取数据。rnrn为什么呢?这两种形式都是合法的吗?那又有什么区别呢?rn程序不需要用户名和密码就能访问,安全性不是有问题嘛???还是这时的验证和Windows 2000的验证集成了呢??rnrn望指教!rn
用ADO.net连接数据库出错,error26,急求!
在建立与服务器的连接时出错。在连接到 SQL Server 2005 时,在默认的设置下 SQL Server 不允许进行远程连接可能会导致此失败。 (provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错)rnrnrn是从机房的机器上弄的,可以操作,拿到自己的虚拟机上,就不行了,重新建立了数据库,vs里的连接字符串也根据机器名改了,账号密码无误。"Data Source=PC-201206042253\\SQLEXPRESS;Initial Catalog=MasterFollowerDB;User ID=sa;pwd=这里是密码";rnrnrn用尽了网上的所有办法,外围配置了,服务除了sql server integration services都开启了,端口1433用telnet测试是开着的,sa用户可以正常登陆sqlserver,在vs2008里添加数据源的时候,测试连接是成功的。rnrnrnrn求解啊,纠结了好几天了。。。。。
相关热词 c# stream 复制 android c# c#监测窗口句柄 c# md5 引用 c# 判断tabtip 自己写个浏览器程序c# c# 字符串变成整数数组 c#语言编程写出一个方法 c# 转盘抽奖 c#选中treeview