对于想了解在MicrosoftSQLServer上创建删除表需要什么特权?dbowner可以吗?的读者,本文将是一篇不可错过的文章,我们将详细介绍创建和删除表的sql语句,并且为您提供关于25.[Mi
对于想了解在Microsoft SQL Server上创建删除表需要什么特权?dbowner可以吗?的读者,本文将是一篇不可错过的文章,我们将详细介绍创建和删除表的sql语句,并且为您提供关于25. [Microsoft][ODBC SQL Server Driver][DBNETLI...、Caused by com microsoft sqlserver jdbc SQLServerException、com microsoft sqlserver jdbc SQLServerException 到主机 的 TCP/I、com.microsoft.sqlserver.jdbc.SQLServerException的有价值信息。
本文目录一览:- 在Microsoft SQL Server上创建删除表需要什么特权?dbowner可以吗?(创建和删除表的sql语句)
- 25. [Microsoft][ODBC SQL Server Driver][DBNETLI...
- Caused by com microsoft sqlserver jdbc SQLServerException
- com microsoft sqlserver jdbc SQLServerException 到主机 的 TCP/I
- com.microsoft.sqlserver.jdbc.SQLServerException
在Microsoft SQL Server上创建删除表需要什么特权?dbowner可以吗?(创建和删除表的sql语句)
我对 SQL Server 不太 满意
,我有以下疑问:我必须要求创建一个可以在某些数据库上工作的用户。该用户必须创建\删除表,在这些表中插入\删除记录。
必须为这些用户在这些数据库上设置哪种类型的权限? dbowner 是否可以执行这些操作?(特别重要的是该用户可以创建\删除表)还是我缺少什么?
答案1
小编典典首先要了解使用角色的好处:
- 角色是分层安全模型的一部分:
- 登录安全性-连接到服务器
- 数据库安全性–确保对数据库的访问
- 数据库对象-访问单个数据库对象和数据**
预定义的数据库角色 您可能需要创建自己的 角色 ,但是您可以访问多个预定义的数据库角色:
- db_owner:成员具有完全访问权限。
- db_accessadmin:成员可以管理Windows组和SQL Server登录。
- db_datareader:成员可以读取所有数据。
- db_datawriter:成员可以在表中添加,删除或修改数据。
- db_ddladmin:允许用户创建,删除或修改数据库中的任何对象,而不管谁拥有。
- db_securityadmin:成员可以修改角色成员身份并管理权限。
- db_bckupoperator:成员可以备份数据库。
- db_denydatareader:成员可以查看数据库中的数据。
- db_denydatawriter:成员可以更改或删除表或视图中的数据。
固定角色: 固定服务器角色在整个服务器范围内应用,并且有几个预定义的服务器角色:
- SysAdmin:任何成员都可以在服务器上执行任何操作。
- ServerAdmin:任何成员都可以在服务器上设置配置选项。
- SetupAdmin:任何成员都可以管理链接的服务器以及SQL Server的启动选项和任务。
- 安全管理员:任何成员都可以管理服务器安全。
- ProcessAdmin:任何成员都可以杀死在SQL Server上运行的进程。
- DbCreator:任何成员都可以创建,更改,删除和还原数据库。
- DiskAdmin:任何成员都可以管理SQL Server磁盘文件。
- BulkAdmin:任何成员都可以运行批量插入命令。
25. [Microsoft][ODBC SQL Server Driver][DBNETLI...
今天工作上要读一个sqlserver,于是用昨天装的sqlserver2005附加了下数据库,附加就比较简单了,找到那个MDF文件附加上就好了。但是一切就绪后,修改了下配置文件里的
local database 连接字符串:
local="Driver={SQL Server};Server=localhost;Database=GranarySystem_Station1;User=sa;Password=;Persist Security Info=False;"
报错来了: [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server 不存在或访问被拒绝.
我确认了好几遍,没错啊,驱动也有,账号密码都对,默认的嘛。于是改成127.0.0.1还是如此。未果。
google到如下一篇:
一般连接sql数据库,
IP_connstr="driver={SQL Server}; server=127.0.0.1;database=数据库名字;uid=sa;pwd=密码"
这样写没错,一般情况下不会出错,但如果出现
“[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server 不存在或访问被拒绝”
其原因就是能从百度中搜索找到的,其中这个需要你注意:
其实很简单,把server=127.0.0.1的127.0.0.1
改为
打开你的IIS,展开internet 信息服务
**(本地计算机)
**就是需要的东西,例如你的是webnet
那你连接数据库改为
IP_connstr="driver={SQL Server}; server=webnet;database=数据库名字;uid=sa;pwd=密码"
折腾了几个小时,解决了,共享下。
Caused by com microsoft sqlserver jdbc SQLServerException
1、错误描述
org.springframework.dao.TransientDataAccessResourceException: PreparedStatementCallback; sql []; 索引 1 超出范围。; nested exception is com.microsoft.sqlserver.jdbc.sqlServerException: 索引 1 超出范围。 at org.springframework.jdbc.support.sqlStatesqlExceptionTranslator.doTranslate(sqlStatesqlExceptionTranslator.java:106) at org.springframework.jdbc.support.AbstractFallbacksqlExceptionTranslator.translate(AbstractFallbacksqlExceptionTranslator.java:73) at org.springframework.jdbc.support.AbstractFallbacksqlExceptionTranslator.translate(AbstractFallbacksqlExceptionTranslator.java:81) at org.springframework.jdbc.support.AbstractFallbacksqlExceptionTranslator.translate(AbstractFallbacksqlExceptionTranslator.java:81) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:660) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:695) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:727) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:737) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:787) at org.springframework.jdbc.core.JdbcTemplate.queryForList(JdbcTemplate.java:877) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74) at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83) at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runchild(SpringJUnit4ClassRunner.java:233) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runchild(SpringJUnit4ClassRunner.java:87) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runchildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:176) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: com.microsoft.sqlserver.jdbc.sqlServerException: 索引 1 超出范围。 at com.microsoft.sqlserver.jdbc.sqlServerException.makeFromDriverError(sqlServerException.java:190) at com.microsoft.sqlserver.jdbc.sqlServerPreparedStatement.setterGetParam(sqlServerPreparedStatement.java:714) at com.microsoft.sqlserver.jdbc.sqlServerPreparedStatement.setobjectNoType(sqlServerPreparedStatement.java:910) at com.microsoft.sqlserver.jdbc.sqlServerPreparedStatement.setobject(sqlServerPreparedStatement.java:935) at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_setobject(FilterChainImpl.java:2923) at com.alibaba.druid.filter.Filteradapter.preparedStatement_setobject(Filteradapter.java:1298) at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_setobject(FilterChainImpl.java:2920) at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.setobject(PreparedStatementProxyImpl.java:398) at com.alibaba.druid.pool.DruidPooledPreparedStatement.setobject(DruidPooledPreparedStatement.java:476) at org.springframework.jdbc.core.StatementCreatorUtils.setValue(StatementCreatorUtils.java:402) at org.springframework.jdbc.core.StatementCreatorUtils.setParameterValueInternal(StatementCreatorUtils.java:235) at org.springframework.jdbc.core.StatementCreatorUtils.setParameterValue(StatementCreatorUtils.java:166) at org.springframework.jdbc.core.ArgumentPreparedStatementSetter.doSetValue(ArgumentPreparedStatementSetter.java:66) at org.springframework.jdbc.core.ArgumentPreparedStatementSetter.setValues(ArgumentPreparedStatementSetter.java:47) at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:701) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:644) ... 36 more
2、错误原因
在Java连接Sql Server数据库,做查询语句时,利用静态常量编写sql语句
private static final String QUERY_STUDENT = "";
sql语句没有加进去,并且student表中存在索引,导致报错
3、解决办法
将sql语句插入到静态常量里,重新运行测试用例
再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow
com microsoft sqlserver jdbc SQLServerException 到主机 的 TCP/I
1、错误描述
2017-04-05 11:30:08,031 [localhost-startStop-1] DEBUG [org.springframework.jdbc.core.JdbcTemplate] - Executing sql query [select getdate()] 2017-04-05 11:30:29,163 [localhost-startStop-1] ERROR [com.alibaba.druid.pool.DruidDataSource] - init datasource error com.microsoft.sqlserver.jdbc.sqlServerException: 到主机 的 TCP/IP 连接失败。 java.net.ConnectException: Connection timed out: connect at com.microsoft.sqlserver.jdbc.sqlServerException.makeFromDriverError(UnkNown Source) at com.microsoft.sqlserver.jdbc.sqlServerConnection.connectHelper(UnkNown Source) at com.microsoft.sqlserver.jdbc.sqlServerConnection.loginWithoutFailover(UnkNown Source) at com.microsoft.sqlserver.jdbc.sqlServerConnection.connect(UnkNown Source) at com.microsoft.sqlserver.jdbc.sqlServerDriver.connect(UnkNown Source) at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:148) at com.alibaba.druid.filter.stat.StatFilter.connection_connect(StatFilter.java:211) at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:142) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1377) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1431) at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:618) at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:915) at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:911) at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:98) at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111) at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:388) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:468) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:478) at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:488) at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:494) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:589) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcesspropertyValues(AutowiredAnnotationBeanPostProcessor.java:289) at org.springframework.beans.factory.support.AbstractAutowireCapablebeanfactory.populateBean(AbstractAutowireCapablebeanfactory.java:1185) at org.springframework.beans.factory.support.AbstractAutowireCapablebeanfactory.doCreateBean(AbstractAutowireCapablebeanfactory.java:537) at org.springframework.beans.factory.support.AbstractAutowireCapablebeanfactory.createBean(AbstractAutowireCapablebeanfactory.java:475) at org.springframework.beans.factory.support.Abstractbeanfactory$1.getobject(Abstractbeanfactory.java:304) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.Abstractbeanfactory.doGetBean(Abstractbeanfactory.java:300) at org.springframework.beans.factory.support.Abstractbeanfactory.getBean(Abstractbeanfactory.java:195) at org.springframework.beans.factory.support.DefaultListablebeanfactory.preInstantiateSingletons(DefaultListablebeanfactory.java:703) at org.springframework.context.support.AbstractApplicationContext.finishbeanfactoryInitialization(AbstractApplicationContext.java:760) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) at org.springframework.web.context.ContextLoaderListener.contextinitialized(ContextLoaderListener.java:106) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4729) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5167) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1101) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1786) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) 2017-04-05 11:30:29,195 [localhost-startStop-1] ERROR [com.alibaba.druid.pool.DruidDataSource] - dataSource init error com.microsoft.sqlserver.jdbc.sqlServerException: 到主机 的 TCP/IP 连接失败。 java.net.ConnectException: Connection timed out: connect at com.microsoft.sqlserver.jdbc.sqlServerException.makeFromDriverError(UnkNown Source) at com.microsoft.sqlserver.jdbc.sqlServerConnection.connectHelper(UnkNown Source) at com.microsoft.sqlserver.jdbc.sqlServerConnection.loginWithoutFailover(UnkNown Source) at com.microsoft.sqlserver.jdbc.sqlServerConnection.connect(UnkNown Source) at com.microsoft.sqlserver.jdbc.sqlServerDriver.connect(UnkNown Source) at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:148) at com.alibaba.druid.filter.stat.StatFilter.connection_connect(StatFilter.java:211) at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:142) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1377) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1431) at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:618) at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:915) at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:911) at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:98) at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111) at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:388) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:468) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:478) at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:488) at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:494) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:589) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcesspropertyValues(AutowiredAnnotationBeanPostProcessor.java:289) at org.springframework.beans.factory.support.AbstractAutowireCapablebeanfactory.populateBean(AbstractAutowireCapablebeanfactory.java:1185) at org.springframework.beans.factory.support.AbstractAutowireCapablebeanfactory.doCreateBean(AbstractAutowireCapablebeanfactory.java:537) at org.springframework.beans.factory.support.AbstractAutowireCapablebeanfactory.createBean(AbstractAutowireCapablebeanfactory.java:475) at org.springframework.beans.factory.support.Abstractbeanfactory$1.getobject(Abstractbeanfactory.java:304) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.Abstractbeanfactory.doGetBean(Abstractbeanfactory.java:300) at org.springframework.beans.factory.support.Abstractbeanfactory.getBean(Abstractbeanfactory.java:195) at org.springframework.beans.factory.support.DefaultListablebeanfactory.preInstantiateSingletons(DefaultListablebeanfactory.java:703) at org.springframework.context.support.AbstractApplicationContext.finishbeanfactoryInitialization(AbstractApplicationContext.java:760) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) at org.springframework.web.context.ContextLoaderListener.contextinitialized(ContextLoaderListener.java:106) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4729) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5167) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1101) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1786) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) 2017-04-05 11:30:29,197 [localhost-startStop-1] INFO [com.alibaba.druid.pool.DruidDataSource] - {dataSource-1} inited 2017-04-05 11:30:29,200 [localhost-startStop-1] INFO [com.alibaba.druid.pool.DruidDataSource] - {dataSource-1} closed 2017-04-05 11:30:29,201 [localhost-startStop-1] ERROR [org.springframework.web.context.ContextLoader] - Context initialization Failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘adviceMesSupport‘: Injection of autowired dependencies Failed; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is com.microsoft.sqlserver.jdbc.sqlServerException: 到主机 的 TCP/IP 连接失败。 java.net.ConnectException: Connection timed out: connect at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcesspropertyValues(AutowiredAnnotationBeanPostProcessor.java:292) at org.springframework.beans.factory.support.AbstractAutowireCapablebeanfactory.populateBean(AbstractAutowireCapablebeanfactory.java:1185) at org.springframework.beans.factory.support.AbstractAutowireCapablebeanfactory.doCreateBean(AbstractAutowireCapablebeanfactory.java:537) at org.springframework.beans.factory.support.AbstractAutowireCapablebeanfactory.createBean(AbstractAutowireCapablebeanfactory.java:475) at org.springframework.beans.factory.support.Abstractbeanfactory$1.getobject(Abstractbeanfactory.java:304) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.Abstractbeanfactory.doGetBean(Abstractbeanfactory.java:300) at org.springframework.beans.factory.support.Abstractbeanfactory.getBean(Abstractbeanfactory.java:195) at org.springframework.beans.factory.support.DefaultListablebeanfactory.preInstantiateSingletons(DefaultListablebeanfactory.java:703) at org.springframework.context.support.AbstractApplicationContext.finishbeanfactoryInitialization(AbstractApplicationContext.java:760) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) at org.springframework.web.context.ContextLoaderListener.contextinitialized(ContextLoaderListener.java:106) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4729) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5167) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1101) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1786) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is com.microsoft.sqlserver.jdbc.sqlServerException: 到主机 的 TCP/IP 连接失败。 java.net.ConnectException: Connection timed out: connect at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:388) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:468) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:478) at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:488) at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:494) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:589) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcesspropertyValues(AutowiredAnnotationBeanPostProcessor.java:289) ... 26 more Caused by: com.microsoft.sqlserver.jdbc.sqlServerException: 到主机 的 TCP/IP 连接失败。 java.net.ConnectException: Connection timed out: connect at com.microsoft.sqlserver.jdbc.sqlServerException.makeFromDriverError(UnkNown Source) at com.microsoft.sqlserver.jdbc.sqlServerConnection.connectHelper(UnkNown Source) at com.microsoft.sqlserver.jdbc.sqlServerConnection.loginWithoutFailover(UnkNown Source) at com.microsoft.sqlserver.jdbc.sqlServerConnection.connect(UnkNown Source) at com.microsoft.sqlserver.jdbc.sqlServerDriver.connect(UnkNown Source) at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:148) at com.alibaba.druid.filter.stat.StatFilter.connection_connect(StatFilter.java:211) at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:142) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1377) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1431) at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:618) at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:915) at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:911) at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:98) at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111) at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77) ... 40 more 四月 05,2017 11:30:29 上午 org.apache.catalina.core.StandardContext listenerStart 严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘adviceMesSupport‘: Injection of autowired dependencies Failed; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is com.microsoft.sqlserver.jdbc.sqlServerException: 到主机 的 TCP/IP 连接失败。 java.net.ConnectException: Connection timed out: connect at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcesspropertyValues(AutowiredAnnotationBeanPostProcessor.java:292) at org.springframework.beans.factory.support.AbstractAutowireCapablebeanfactory.populateBean(AbstractAutowireCapablebeanfactory.java:1185) at org.springframework.beans.factory.support.AbstractAutowireCapablebeanfactory.doCreateBean(AbstractAutowireCapablebeanfactory.java:537) at org.springframework.beans.factory.support.AbstractAutowireCapablebeanfactory.createBean(AbstractAutowireCapablebeanfactory.java:475) at org.springframework.beans.factory.support.Abstractbeanfactory$1.getobject(Abstractbeanfactory.java:304) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.Abstractbeanfactory.doGetBean(Abstractbeanfactory.java:300) at org.springframework.beans.factory.support.Abstractbeanfactory.getBean(Abstractbeanfactory.java:195) at org.springframework.beans.factory.support.DefaultListablebeanfactory.preInstantiateSingletons(DefaultListablebeanfactory.java:703) at org.springframework.context.support.AbstractApplicationContext.finishbeanfactoryInitialization(AbstractApplicationContext.java:760) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) at org.springframework.web.context.ContextLoaderListener.contextinitialized(ContextLoaderListener.java:106) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4729) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5167) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1101) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1786) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is com.microsoft.sqlserver.jdbc.sqlServerException: 到主机 的 TCP/IP 连接失败。 java.net.ConnectException: Connection timed out: connect at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:388) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:468) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:478) at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:488) at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:494) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:589) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcesspropertyValues(AutowiredAnnotationBeanPostProcessor.java:289) ... 26 more Caused by: com.microsoft.sqlserver.jdbc.sqlServerException: 到主机 的 TCP/IP 连接失败。 java.net.ConnectException: Connection timed out: connect at com.microsoft.sqlserver.jdbc.sqlServerException.makeFromDriverError(UnkNown Source) at com.microsoft.sqlserver.jdbc.sqlServerConnection.connectHelper(UnkNown Source) at com.microsoft.sqlserver.jdbc.sqlServerConnection.loginWithoutFailover(UnkNown Source) at com.microsoft.sqlserver.jdbc.sqlServerConnection.connect(UnkNown Source) at com.microsoft.sqlserver.jdbc.sqlServerDriver.connect(UnkNown Source) at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:148) at com.alibaba.druid.filter.stat.StatFilter.connection_connect(StatFilter.java:211) at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:142) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1377) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1431) at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:618) at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:915) at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:911) at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:98) at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111) at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77) ... 40 more
2、错误原因
本地连接Sql Server数据库,未打开telnet协议
3、解决办法
(1)打开开始输入“cmd”,在命令窗口输入:telnet 127.0.0.1
(2)如果提示“不是内部命令”,需要设置telnet协议‘
(3)控制面板--->程序--->打开或关闭Windows功能,将telnet客户端和服务端都勾选上
(4)计算机--->管理--->服务--->开启telnet服务
再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow
com.microsoft.sqlserver.jdbc.SQLServerException
com.microsoft.sqlserver.jdbc.SQLServerException: 通过端口 1433 连接到主机 localhost 的 TCP/IP 连接失败。错误:Connection refused: connect。请验证连接属性,并检查 SQL Server 的实例正在主机上运行,且在此端口接受 TCP/IP 连接,还要确保防火墙没
com.microsoft.sqlserver.jdbc.SQLServerException: 通过端口 1433 连接到主机 localhost 的 TCP/IP 连接失败。错误:“Connection refused: connect。请验证连接属性,并检查 SQL Server 的实例正在主机上运行,美国服务器,且在此端口接受 TCP/IP 连接,香港服务器,还要确保防火墙没有阻止到此端口的 TCP 连接。”。
对于hibernate链接SQL Server2008出现这种原因及我本人的解决办法
需要在项目中引入sqljdbc4.jar
出现这种原因:1.可能是SQL Server服务器没有启动
2.SQL Server网络配置TCP/IP没启用
3.客户端协议中查看TCP/IP默认的端口号是不是1433
解决办法:打开sql server configuration manager
1. 在可会端协议中查看TCP/IP默认的端口号是不是1433,并保证该项启动
2. 启动SQL Server网络配置/MSSQLSERVERd的协议/ TCP/IP
3. 重新启动SQL Server服务/SQL Server(MSSQLSERVER)服务器
经过以上步骤问题应该就可以解决了
,香港服务器租用
我们今天的关于在Microsoft SQL Server上创建删除表需要什么特权?dbowner可以吗?和创建和删除表的sql语句的分享已经告一段落,感谢您的关注,如果您想了解更多关于25. [Microsoft][ODBC SQL Server Driver][DBNETLI...、Caused by com microsoft sqlserver jdbc SQLServerException、com microsoft sqlserver jdbc SQLServerException 到主机 的 TCP/I、com.microsoft.sqlserver.jdbc.SQLServerException的相关信息,请在本站查询。
本文标签: