我意识到这个问题可能相当广泛,但我一直在寻找过去两天没有运气。
我在Visual Studio 2015中创建了一个项目,并使用使用SQL Server Management Studio创建的云数据库在该项目中创建了一个新的数据源。 我现在正在尝试编写项目中的登录页面,该页面从UI上的2个文本框中获取用户名和密码,并执行SQL查询以检查用户是否存在于数据库中以及他们的密码是否正确。 我熟悉数据库连接的Java代码,例如预准备语句和结果集函数。 是否有类似C#的东西?
谢谢,非常感谢您参考有用的文章或代码示例。
答案 0 :(得分:1)
我认为这可以帮到你: -
http://csharp.net-informations.com/data-providers/csharp-sql-server-connection.htm
http://www.codeproject.com/Articles/823854/How-to-connect-SQL-Database-to-your-Csharp-program
答案 1 :(得分:1)
这可能是检查它的最快但不是最好的方法。
FAILURE: Build failed with an exception.
* What went wrong:
org/apache/http/ssl/SSLInitializationException
* Try:
Run with --info or --debug option to get more log output.
* Exception is:
java.lang.NoClassDefFoundError: org/apache/http/ssl/SSLInitializationException
at org.gradle.internal.resource.transport.http.DefaultSslContextFactory.<init>(DefaultSslContextFactory.java:53)
at org.gradle.internal.resource.transport.http.HttpResourcesPluginServiceRegistry$GlobalScopeServices.createSslContextFactory(HttpResourcesPluginServiceRegistry.java:48)
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.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
at org.gradle.internal.service.DefaultServiceRegistry.invoke(DefaultServiceRegistry.java:426)
at org.gradle.internal.service.DefaultServiceRegistry.access$1200(DefaultServiceRegistry.java:62)
at org.gradle.internal.service.DefaultServiceRegistry$FactoryMethodService.invokeMethod(DefaultServiceRegistry.java:739)
at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.create(DefaultServiceRegistry.java:695)
at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectProvider.getInstance(DefaultServiceRegistry.java:537)
at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:577)
at org.gradle.internal.service.DefaultServiceRegistry.doGet(DefaultServiceRegistry.java:393)
at org.gradle.internal.service.DefaultServiceRegistry.get(DefaultServiceRegistry.java:378)
at org.gradle.internal.service.DefaultServiceRegistry$ParentServices.getService(DefaultServiceRegistry.java:949)
at org.gradle.internal.service.DefaultServiceRegistry$CompositeProvider.getService(DefaultServiceRegistry.java:894)
at org.gradle.internal.service.DefaultServiceRegistry$CompositeProvider.getService(DefaultServiceRegistry.java:894)
at org.gradle.internal.service.DefaultServiceRegistry$DefaultLookupContext$4.apply(DefaultServiceRegistry.java:1120)
at org.gradle.internal.service.DefaultServiceRegistry$DefaultLookupContext$4.apply(DefaultServiceRegistry.java:1117)
at org.gradle.internal.service.DefaultServiceRegistry$DefaultLookupContext.getServiceProvider(DefaultServiceRegistry.java:1074)
at org.gradle.internal.service.DefaultServiceRegistry$DefaultLookupContext.find(DefaultServiceRegistry.java:1062)
at org.gradle.internal.service.DefaultServiceRegistry.getServiceProvider(DefaultServiceRegistry.java:398)
at org.gradle.internal.service.DefaultServiceRegistry.doGet(DefaultServiceRegistry.java:390)
at org.gradle.internal.service.DefaultServiceRegistry.get(DefaultServiceRegistry.java:378)
at org.gradle.internal.service.DefaultServiceRegistry$ParentServices.getService(DefaultServiceRegistry.java:949)
at org.gradle.internal.service.DefaultServiceRegistry$CompositeProvider.getService(DefaultServiceRegistry.java:894)
at org.gradle.internal.service.DefaultServiceRegistry$CompositeProvider.getService(DefaultServiceRegistry.java:894)
at org.gradle.internal.service.DefaultServiceRegistry$DefaultLookupContext$4.apply(DefaultServiceRegistry.java:1120)
at org.gradle.internal.service.DefaultServiceRegistry$DefaultLookupContext$4.apply(DefaultServiceRegistry.java:1117)
at org.gradle.internal.service.DefaultServiceRegistry$DefaultLookupContext.getServiceProvider(DefaultServiceRegistry.java:1074)
at org.gradle.internal.service.DefaultServiceRegistry$DefaultLookupContext.find(DefaultServiceRegistry.java:1062)
at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.bind(DefaultServiceRegistry.java:669)
at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.prepare(DefaultServiceRegistry.java:582)
at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.getService(DefaultServiceRegistry.java:595)
at org.gradle.internal.service.DefaultServiceRegistry$OwnServices.getService(DefaultServiceRegistry.java:486)
at org.gradle.internal.service.DefaultServiceRegistry$CompositeProvider.getService(DefaultServiceRegistry.java:894)
at org.gradle.internal.service.DefaultServiceRegistry$DefaultLookupContext$4.apply(DefaultServiceRegistry.java:1120)
at org.gradle.internal.service.DefaultServiceRegistry$DefaultLookupContext$4.apply(DefaultServiceRegistry.java:1117)
at org.gradle.internal.service.DefaultServiceRegistry$DefaultLookupContext.getServiceProvider(DefaultServiceRegistry.java:1074)
at org.gradle.internal.service.DefaultServiceRegistry$DefaultLookupContext.find(DefaultServiceRegistry.java:1062)
at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.bind(DefaultServiceRegistry.java:669)
at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.prepare(DefaultServiceRegistry.java:582)
at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.getService(DefaultServiceRegistry.java:595)
at org.gradle.internal.service.DefaultServiceRegistry$OwnServices.getService(DefaultServiceRegistry.java:486)
at org.gradle.internal.service.DefaultServiceRegistry$CompositeProvider.getService(DefaultServiceRegistry.java:894)
at org.gradle.internal.service.DefaultServiceRegistry$DefaultLookupContext$4.apply(DefaultServiceRegistry.java:1120)
at org.gradle.internal.service.DefaultServiceRegistry$DefaultLookupContext$4.apply(DefaultServiceRegistry.java:1117)
at org.gradle.internal.service.DefaultServiceRegistry$DefaultLookupContext.getServiceProvider(DefaultServiceRegistry.java:1074)
at org.gradle.internal.service.DefaultServiceRegistry$DefaultLookupContext.find(DefaultServiceRegistry.java:1062)
at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.bind(DefaultServiceRegistry.java:669)
at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.prepare(DefaultServiceRegistry.java:582)
at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.getService(DefaultServiceRegistry.java:595)
at org.gradle.internal.service.DefaultServiceRegistry$OwnServices.getService(DefaultServiceRegistry.java:486)
at org.gradle.internal.service.DefaultServiceRegistry$CompositeProvider.getService(DefaultServiceRegistry.java:894)
at org.gradle.internal.service.DefaultServiceRegistry$DefaultLookupContext$4.apply(DefaultServiceRegistry.java:1120)
at org.gradle.internal.service.DefaultServiceRegistry$DefaultLookupContext$4.apply(DefaultServiceRegistry.java:1117)
at org.gradle.internal.service.DefaultServiceRegistry$DefaultLookupContext.getServiceProvider(DefaultServiceRegistry.java:1074)
at org.gradle.internal.service.DefaultServiceRegistry$DefaultLookupContext.find(DefaultServiceRegistry.java:1062)
at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.bind(DefaultServiceRegistry.java:669)
at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.prepare(DefaultServiceRegistry.java:582)
at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.getService(DefaultServiceRegistry.java:595)
at org.gradle.internal.service.DefaultServiceRegistry$OwnServices.getService(DefaultServiceRegistry.java:486)
at org.gradle.internal.service.DefaultServiceRegistry$CompositeProvider.getService(DefaultServiceRegistry.java:894)
at org.gradle.internal.service.DefaultServiceRegistry$DefaultLookupContext$4.apply(DefaultServiceRegistry.java:1120)
at org.gradle.internal.service.DefaultServiceRegistry$DefaultLookupContext$4.apply(DefaultServiceRegistry.java:1117)
at org.gradle.internal.service.DefaultServiceRegistry$DefaultLookupContext.getServiceProvider(DefaultServiceRegistry.java:1074)
at org.gradle.internal.service.DefaultServiceRegistry$DefaultLookupContext.find(DefaultServiceRegistry.java:1062)
at org.gradle.internal.service.DefaultServiceRegistry.getServiceProvider(DefaultServiceRegistry.java:398)
at org.gradle.internal.service.DefaultServiceRegistry.doGet(DefaultServiceRegistry.java:390)
at org.gradle.internal.service.DefaultServiceRegistry.get(DefaultServiceRegistry.java:374)
at org.gradle.internal.service.scopes.BuildScopeServices.createScriptObjectConfigurerFactory(BuildScopeServices.java:227)
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.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
at org.gradle.internal.service.DefaultServiceRegistry.invoke(DefaultServiceRegistry.java:426)
at org.gradle.internal.service.DefaultServiceRegistry.access$1200(DefaultServiceRegistry.java:62)
at org.gradle.internal.service.DefaultServiceRegistry$FactoryMethodService.invokeMethod(DefaultServiceRegistry.java:739)
at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.create(DefaultServiceRegistry.java:695)
at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectProvider.getInstance(DefaultServiceRegistry.java:537)
at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:577)
at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.assembleParameters(DefaultServiceRegistry.java:705)
at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.create(DefaultServiceRegistry.java:694)
at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectProvider.getInstance(DefaultServiceRegistry.java:537)
at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:577)
at org.gradle.internal.service.DefaultServiceRegistry.doGet(DefaultServiceRegistry.java:393)
at org.gradle.internal.service.DefaultServiceRegistry.get(DefaultServiceRegistry.java:374)
at org.gradle.initialization.DefaultGradleLauncherFactory.doNewInstance(DefaultGradleLauncherFactory.java:139)
at org.gradle.initialization.DefaultGradleLauncherFactory.newInstance(DefaultGradleLauncherFactory.java:102)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:38)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:81)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:46)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:173)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:241)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:214)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:207)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.Main.doAction(Main.java:33)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
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.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:55)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:36)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
Caused by: java.lang.ClassNotFoundException: org.apache.http.ssl.SSLInitializationException
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 116 more