I have a java compiled jar file, which accept the connection string as follows: -Uusername -Ppassword -Sservername:port
This string works fine with the default instance of SQL Server, I mean as long as you supply the name of the SQL Server as 'SQLServer', but if I want to run it against the named instance of SQL Server like 'SQLSERVER\NamedInstance' then the connection is failing, giving me the unknown host error. Any idea why?I've got this connection string
driver={SQL Server};server=MachineName\Mercure;uid=sa;pwd=pwd
I've created the instance name during the installation of MSDE
and it seems that SQL Server was installed with the computer name
ONLINE HELP
Computer Name
The Computer Name dialog box in Setup allows you to install Microsoft SQL Server 2000 on your local computer, on a remote computer, or on a virtual server.
All options for installing and upgrading are available on the local computer. Advanced options, including registry rebuild, unattended installation, and upgrading to a cluster are not available on a remote installation. If you are running Setup on a clustered computer, the Virtual Server option is available.
Options
Local Computer
By default, the name in the edit box is the local machine name, that is, the computer on which Setup is running. For a local installation, accept the default and click Next.
Note If you are installing tools only, Local Computer will be the only option available on this dialog box.
Remote Computer
Enter a computer name for a remote installation, or click Browse to locate the remote computer.
Virtual Server
Enter the name of a new or existing Virtual SQL Server to manage.
This option is available only when Microsoft Cluster Service (MSCS) is detected on an Windows NT or Windows 2000 Enterprise operating system.
Browse
Click the Browse button to locate a remote computer.
This button is available only when the Remote Computer option is selected.|||What JDBC driver are you using? If it's Microsoft's then it does support named instances. I think this was introduced in SP2 of the JDBC driver. Let me know and I'll post and example. If it's another jdbc driver usually you can supply the port number the instance is running in the connection string.|||-S//MachineName/DBNAME:1599
where 1599 is the Named Instance Port numbersql
Showing posts with label java. Show all posts
Showing posts with label java. Show all posts
Monday, March 26, 2012
Wednesday, March 21, 2012
N' prefix required or not?
Need to provide international support for the product. Use
SqlServer 2000 for repository; DataDirect JDBC driver and
Java code for the application.
Using nvarchar datatypes for columns. Data entry/retrieval
will be through Java code. When send SQL commands through
Java/JDBC; do we need to prefix the constants with the N'
prefix example - INSERT INTO abc VALUES (N'xyz') or will
INSERT INTO abc VALUES ('xyz') store the data in unicode.
If the datatype supports unicode chars do we still need to
use the N'prefix? Also assuming data is stored in unicode;
when using in where clause while selecting will we have to
use SELECT * from abc where f1 =N'xyx' for it to be
retrieved? FYI, All database access is through Java/JDBC
which both claim to provide full international/unicode
support.
Thanks,If you are sending in hard-coded strings, then you will need to prefix them
with N to indicate that the string is Unicode. Otherwise, unicode strings
will be stored as a series of junk characters in SQL Server.
--
HTH,
SriSamp
Please reply to the whole group only!
http://www32.brinkster.com/srisamp
"AB" <anonymous@.discussions.microsoft.com> wrote in message
news:900901c3e9f5$a1fc1f20$a501280a@.phx.gbl...
> Need to provide international support for the product. Use
> SqlServer 2000 for repository; DataDirect JDBC driver and
> Java code for the application.
> Using nvarchar datatypes for columns. Data entry/retrieval
> will be through Java code. When send SQL commands through
> Java/JDBC; do we need to prefix the constants with the N'
> prefix example - INSERT INTO abc VALUES (N'xyz') or will
> INSERT INTO abc VALUES ('xyz') store the data in unicode.
> If the datatype supports unicode chars do we still need to
> use the N'prefix? Also assuming data is stored in unicode;
> when using in where clause while selecting will we have to
> use SELECT * from abc where f1 =N'xyx' for it to be
> retrieved? FYI, All database access is through Java/JDBC
> which both claim to provide full international/unicode
> support.
> Thanks,
SqlServer 2000 for repository; DataDirect JDBC driver and
Java code for the application.
Using nvarchar datatypes for columns. Data entry/retrieval
will be through Java code. When send SQL commands through
Java/JDBC; do we need to prefix the constants with the N'
prefix example - INSERT INTO abc VALUES (N'xyz') or will
INSERT INTO abc VALUES ('xyz') store the data in unicode.
If the datatype supports unicode chars do we still need to
use the N'prefix? Also assuming data is stored in unicode;
when using in where clause while selecting will we have to
use SELECT * from abc where f1 =N'xyx' for it to be
retrieved? FYI, All database access is through Java/JDBC
which both claim to provide full international/unicode
support.
Thanks,If you are sending in hard-coded strings, then you will need to prefix them
with N to indicate that the string is Unicode. Otherwise, unicode strings
will be stored as a series of junk characters in SQL Server.
--
HTH,
SriSamp
Please reply to the whole group only!
http://www32.brinkster.com/srisamp
"AB" <anonymous@.discussions.microsoft.com> wrote in message
news:900901c3e9f5$a1fc1f20$a501280a@.phx.gbl...
> Need to provide international support for the product. Use
> SqlServer 2000 for repository; DataDirect JDBC driver and
> Java code for the application.
> Using nvarchar datatypes for columns. Data entry/retrieval
> will be through Java code. When send SQL commands through
> Java/JDBC; do we need to prefix the constants with the N'
> prefix example - INSERT INTO abc VALUES (N'xyz') or will
> INSERT INTO abc VALUES ('xyz') store the data in unicode.
> If the datatype supports unicode chars do we still need to
> use the N'prefix? Also assuming data is stored in unicode;
> when using in where clause while selecting will we have to
> use SELECT * from abc where f1 =N'xyx' for it to be
> retrieved? FYI, All database access is through Java/JDBC
> which both claim to provide full international/unicode
> support.
> Thanks,
Labels:
application,
code,
database,
datadirect,
driver,
international,
java,
jdbc,
microsoft,
mysql,
oracle,
prefix,
product,
provide,
repository,
required,
server,
sql,
sqlserver
Monday, February 20, 2012
My java does not work?
Hello. I have just got windows xp profesional x64.When i am on the internett my jave does not open the programs and games.Can some one help me please.Thanks.
Hello Swupp,
Most internet applications that require Java will typically prompt and provide you with with options for downloading the Java Runtime environment (JRE) automatically. To do this manually, you can always download and install the Java Runtime Environment (JRE) 5.0 Update 8 directly from http://java.sun.com/javase/downloads/index.jsp.
Please note that in the future, you may want to post directly on an Internet Explorer or Windows forum for a quicker and more thorough reply to topics relating to this issue.
Regards,
Jaaved Mohammed
Subscribe to:
Posts (Atom)