使用JDBC-ODBC Bridge连接到SQLServer [英] Connecting to SQLServer using JDBC-ODBC Bridge

查看:145
本文介绍了使用JDBC-ODBC Bridge连接到SQLServer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在写一个应用程序的帽子,该帽子是在MySQL上原型化的,现在正在连接到Oracle数据库.

I'm writing an applicationt hat was prototyped on MySQL and is now connecting to an Oracle database.

要连接到oracle数据库(已建立表结构),我要做的就是更改连接字符串.

All I had to do to connect to the oracle database (having built up the table structure) was change the connection string.

连接到另一台计算机上的SQL Server DB的格式是什么?

What is the format to connect to a SQL Server DB on another machine?

我已经阅读了一些教程,这些教程告诉您使用SQL Server JDBC适配器,但是我希望配置该应用程序,使其与数据库无关,并且只需让连接字符串指定协议等即可.

I've read some tutorials which tell you to use the SQL Server JDBC adaptor but I'd rather configure the application so that it's database agnostic, and just have the connection string specify the protocol etc.

我见过的任何参考资料都告诉您如何在SQL Server中使用网桥,要求安装ODBC数据源,这不理想,因为我的应用程序可能在Linux或Windows上运行.

Any references I've seen which tell you how to use the bridge with SQL Server require the ODBC Data Source to be installed, this is less than ideal as my app may run on Linux or windows.

我没有做任何复杂的事情,只是插入.

I'm not doing anything complicated just inserts.

推荐答案

您不应在生产环境中使用JDBC-ODBC桥.它比其他JDBC驱动程序要慢得多,只有在没有JDBC驱动程序时才需要.

You should not use the JDBC-ODBC bridge in a production environment. It is much slower than other JDBC drivers and only necessary when a JDBC driver is not available.

SQL Server具有 JDBC驱动程序可从Microsoft获得.如果使用它,则将获得所需的结果.

SQL Server has a JDBC driver available from Microsoft. If you use it then you will get the required result.

使用ODBC桥,您别无选择,只能安装ODBC驱动程序.

With the ODBC bridge you have no choice but to install the ODBC driver.

文章描述了连接字符串您将需要使用它来连接到SQL Server.

This article describes the connection string you will need to use to connect to the SQL Server.

这篇关于使用JDBC-ODBC Bridge连接到SQLServer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆