Problem when create connection to SQl Server ( charecter set cp1255 not found ))
Hello my name is Ron ,
i want to connect to SQL SERVER with the microsoft driver
from Java ( with jDeveloper ) .
then i did the following steps:
1) i download and install the jdbc driver for Sql server
on my machine ( windows XP with , JDK 1.3 )
2) i update my classpath with the .Jar lib file of the driver .
3) when creating the connection
i'm using the
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
this is Ok , the driver was loaded .
4) when trying the GetConnction
Connection conn = DriverManager.getConnection
("jdbc:microsoft:sqlserver://server1:1433","username","secret");
i get the following error:
[Microsoft][SQLServer 2000 Driver for JDBC]Character set CP1255 not found in com.microsoft.util.transliteration.properties.
please help me with this . any idea ?
thanks in advance
Roni
Ron,
Try following this document
http://otn.oracle.com/products/jdev/howtos/bc4j/bc_psqlserverwalkthrough.html
from the how-tos archive.
Also, try to change the compiler encoding to UTF-8. you do this in the project setting window.
http://otn.oracle.com/products/jdev/htdocs/vcmigration/weblogic/unicode.gif
http://otn.oracle.com/products/jdev/htdocs/vcmigration/weblogic/unicode2.gif
good luck
Similar Messages
-
Problem with connection to SQl Server ( charecter set cp1255 not found )
Hello my name is Ron ,
i want to connect to SQL SERVER with the microsoft driver
from Java ( with jDeveloper ) .
then i did the following steps:
1) i download and install the jdbc driver for Sql server
on my machine ( windows XP with , JDK 1.3 )
2) i update my classpath with the .Jar lib file of the driver .
3) when creating the connection
i'm using the
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
this is Ok , the driver was loaded .
4) when trying the GetConnction
Connection conn = DriverManager.getConnection
("jdbc:microsoft:sqlserver://server1:1433","username","secret");
i get the following error:
[Microsoft][SQLServer 2000 Driver for JDBC]Character set CP1255 not found in com.microsoft.util.transliteration.properties.
please help me with this . any idea ?
thanks in advance
RoniRon,
Try following this document
http://otn.oracle.com/products/jdev/howtos/bc4j/bc_psqlserverwalkthrough.html
from the how-tos archive.
Also, try to change the compiler encoding to UTF-8. you do this in the project setting window.
http://otn.oracle.com/products/jdev/htdocs/vcmigration/weblogic/unicode.gif
http://otn.oracle.com/products/jdev/htdocs/vcmigration/weblogic/unicode2.gif
good luck -
Creating connection to SQl Server
I'm trying to establish a connection to sql server. I have set the third party JDBC drivers to point to jtds-1.2.jar. When I try and create a new connection I get Status : Failure -I/O Error: SSo Failed : Native SSPI library not loaded. Check the java.library.path system property.
Any ideas on what I need to do to fix this?
Thanks
SteveWe got the same error message with the current version of SQL Developer 1.1.3 and the early adaptor version of SQL Developer Migration Workbench on Windows
The solution we found on the net (http://www.nabble.com/MSSQL-JDBC-driver-t361081.html) was
According to the README.SSO file in the JDTD installation you must have the ntlmauth.dll file in your PATH.
Make sure that you do, or try to set the java.library.path system property to the directory containing this
file, that is <jtds-dir>/SSO -
Can not read Chinese data when DB Connect to SQL server 2000
Hi,
Our BW server( BW3.5 not unicode ) is installed on MS SQL server 2000. We try to connect the BW SQL server with db connect function. We create some test views in the Northwind DB. We are be able to access data from source system in rsa1 by db connect. The problem is that all the Chinese characters are displayed as ?????. Is there any special setting for accessing multibyte characters in MS SQL server 2000? Please advise.
Thank you,
JeffThe field of VIEW in the sqlserver which code is chinese must be the nvarchar.
You can try it. -
Permission denied when creating database in Sql Server 2008 for SQLExpress
I'm getting an permission error while restoring the database. I'm using SQL Server 2008 SQLEXPRESS
I'm able to create the user using this script " CREATE LOGIN [darth\vader] FROM WINDOWS;
GO;"
But when I try to give role to the user it's still give me permission error.. SP_ADDSRVROLEMEMBER ‘darth\vader’, ‘sysadmin’
Can someone guide me how to resolve this issue?http://msdn.microsoft.com/en-us/library/ms186858.aspx
Permissions
If the database being restored does not exist, the user must have CREATE DATABASE permissions to be able to execute RESTORE. If the database exists, RESTORE permissions default to members of the sysadmin and dbcreator fixed
server roles and the owner (dbo) of the database (for the FROM DATABASE_SNAPSHOT option, the database always exists).
RESTORE permissions are given to roles in which membership information is always readily available to the server. Because fixed database role membership can be checked only when the database is accessible and undamaged, which is not always the case when RESTORE
is executed, members of the db_ownerfixed database role do not have RESTORE permissions.
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
What is the application name when CMS connects to SQL server 2005
Hi, We are BOXI R2 SP3. We have 3 servers with CMS installed on each. We have 3 separate web servers. When I monitor sessions in SQL server 2005 then I see 6 process. 2 process are from each processing servers but the application name for 2 servers ( 4 processes) are WIndows Installer-unicode and for third server its Business Objects Enterprise.
I think all the env should be same in a cluster so not sure how to correct this issue.
Thanks,No Answer so closing this topic.
-
Problem in creating Connection with 9iApplication Server
I'm getting an Error while testing the connection to application server
IO Error connection Refused !!!
I'm using 9iDS 9.0.2.0 can can anybody help Me..I tried port 1811 and it worked, this is probably installation dependent. Forgot which file I found the correct port, but search around
-
Problem when creating connection pool for Informix
Hi all,
could you please help me to create a connection pool for informix?
I use a com.informix.jdbcx.IfxXADataSource driver and here are the properties
user=informix
password=informix
url=jdbc:informix-sqli://TW010766:1526/vka:informixserver=TW010766
dataSourceName=TestEntityPool2
portNumber=1526
databaseName=vka
ifxIFXHOST=TW010766
serverName=vka
Here is the error message :
Error during Data Source creation: weblogic.common.ResourceException: DataSource(TestEntity)
can't be created with non-existent Pool (connection or multi) (TestEntityPool2)
at weblogic.jdbc.common.internal.JdbcInfo.validateConnectionPool(JdbcInfo.java:127)
at weblogic.jdbc.common.internal.JdbcInfo.startDataSource(JdbcInfo.java:189)
at weblogic.jdbc.common.internal.JDBCService.addDeploymentx(JDBCService.java:293)
at weblogic.jdbc.common.internal.JDBCService.addDeployment(JDBCService.java:270)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:375)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(DeploymentTarget.java:303)
at weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeployments(DeploymentTarget.java:256)
at weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(DeploymentTarget.java:207)
Could you please tell me what's wrong with the configuration?
Many thanks in advance.
HoangHoang Nguyen wrote:
For JBuilder :
URL : jdbc:informix-sqli://tra019746:1526/vka:informixserver=vka
Driver : com.informix.jdbcx.IfxXADataSource
username : informix; password : informix
For WebLogic :
URL : jdbc:informix-sqli://tra019746:1526/vka:informixserver=vka
Driver : com.informix.jdbcx.IfxXADataSource
Properties : password=informix
user=informixOk. The problem may have to do with your reiterating all the properties below.
url=jdbc:informix-sqli://tra019746:1526/vka:informixserver=vka
portNumber=1526
databaseName=vka
serverName=vka
ifxIFXHOST=tra019746All these above are implicit in the URL you give to jBuilder and weblogic.
Try defining the pool with only the user and password as properties.
>
>
Error:
Error during Data Source creation: weblogic.common.ResourceException:
DataSource(TestEntity)
can't be created with non-existent Pool (connection or multi) (TestEntityPool2)
at weblogic.jdbc.common.internal.JdbcInfo.validateConnectionPool(JdbcInfo.java:127)
at weblogic.jdbc.common.internal.JdbcInfo.startDataSource(JdbcInfo.java:189)
at weblogic.jdbc.common.internal.JDBCService.addDeploymentx(JDBCService.java:293)
at weblogic.jdbc.common.internal.JDBCService.addDeployment(JDBCService.java:270)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:375)
Thanks Joe
Hoang Nguyen wrote:
Joseph,
The driver that I use comes from informix.
I've tried with JBuilder and no problem. JBuilder can connect to informixand
I can see the tables from JBuilder.
There's something wrong in the configuration with Weblogic.
Many thanks for your help.I understand that there's something wrong with the configuration with
weblogic,
but the problem is due to a mistake in the input you gave to the pool
definition,
and I want to solve that. Please show me the URL, driver name and properties
you give to JBuilder to make Informix connections. Also, show me the
first few lines
that get printend out when you run the weblogic start script. I want
to see the
line that prints out the classpath used in the script for starting the
server.
thanks,
Joe
Joseph Weinstein <[email protected]> wrote:
Ok, I would like you to download Informix's driver from them, and
run one of their example programs, just to prove you can connect to
informix, using their driver, with no weblogic in the picture. We
have
to establish that, because that's all weblogic will be doing anyway.
Once
we know how to connect to informix via JDBC, we can do weblogic stuff.
Joe
Hoang Nguyen wrote:
Hi,
I forgot to mention that I'm working with Weblogic server 7 and
Informix 2000 9.20.
For the configuration, I followed the example given by Weblogic
http://edocs.bea.com/wls/docs70/jdbc/thirdparty.html#thirdparty001,
table 5.2
Here is the example given by weblogic :
user=username
url=jdbc:informix-sqli://dbserver_name_or_ip:port_num/dbname:informixserver=dbserver_name_or_ip
password=password
portNumber =port_num;
databaseName=dbname
serverName=dbserver_name
ifxIFXHOST=dbserver_name_or_ip
If you take a look at the link, you'll see a note :
"In the Properties string, there is a space between portNumber and=". I've tried
that but it seems that this bug had been resolved. When I put the
space,
I've
an number exception.
Thanks for your help.
Hoang
Joseph Weinstein <[email protected]> wrote:
Nguyen Hoang wrote:
Hi all,
could you please help me to create a connection pool for informix?
I use a com.informix.jdbcx.IfxXADataSource driver and here are
the
properties
user=informix
password=informix
url=jdbc:informix-sqli://TW010766:1526/vka:informixserver=TW010766
dataSourceName=TestEntityPool2
portNumber=1526
databaseName=vka
ifxIFXHOST=TW010766
serverName=vka
Here is the error message :
Error during Data Source creation: weblogic.common.ResourceException:DataSource(TestEntity)
can't be created with non-existent Pool (connection or multi)
(TestEntityPool2)
This means the pool was unable to make an informix connection withthe
properties
you gave. Please show me the few lines from an informix driver
example
program
that makes a successful JDBC connection to the DBMS you want, andI will
show
you how to define a pool for weblogic to do the same.
Joe
at weblogic.jdbc.common.internal.JdbcInfo.validateConnectionPool(JdbcInfo.java:127)
at weblogic.jdbc.common.internal.JdbcInfo.startDataSource(JdbcInfo.java:189)
at weblogic.jdbc.common.internal.JDBCService.addDeploymentx(JDBCService.java:293)
at weblogic.jdbc.common.internal.JDBCService.addDeployment(JDBCService.java:270)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:375)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(DeploymentTarget.java:303)
at weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeployments(DeploymentTarget.java:256)
at weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(DeploymentTarget.java:207)
Could you please tell me what's wrong with the configuration?
Many thanks in advance.
Hoang -
Problem in jdbc connection to sql server
I hv some problem in connection. i am not sure hv to use this line of code. My server name is YC\YC and i m using window autentic usr name and passwd. How to i solve the problem? Thanks!
Connection connection = DriverManager.getConnection(
"jdbc:microsoft:sqlserver://<Host>:1433",<"UID>","<PWD>");Is it means that add a new user?
Now i add a new user name "boon" passwd "abc123"
SQL service manager there state my server running is YC\YC, is it that one my server name and instance?
Connection connection = DriverManager.getConnection(
"jdbc:microsoft:sqlserver://YC\\YC:1433", "boon", "abc123"); -
Problem when changing connection to SQL Anywhere during runtime
I designed a report in the Crystal Reports 2008 designer using a JDBC connection
to a SQL Anywhere 11.0.1 database.
Everything works fine, I´m able to preview the report in the designer.
But when loading and running the same report in a Eclipse-based java-application I receive
an error.
When I set the db connection parameters I receive an "unexpected database-connector-error".
When starting the report without changing the connection parameters set in the CR2008-designer
the same error appears.
When using a report based on a MySQL-database everything works fine.
I´m able to preview the report in the designer and I´m able to load the report
and change the datasource to another MySQL-database at runtime.
What do I have to do to change a SQL Anywhere connection at runtime?Your workflow and the specific method being invoked where you're getting the exception is unclear.
Sincerely,
Ted Ueda -
MARS connection to SQL Server in JAVA via ODBC
Hello.
I've got this problem.
I'm managing an application JAVA/JSP, based on a 3-tier architecture.
The connection to the database is performed via JDBC/ODBC, in order to work with different DRMS.
Everything is ok when connecting to Oracle or MySql via JDBC, but when we connect to SQL Server via ODBC we get this error: "ODBC SQL SERVER - Connection is busy with result for another stmt".
That's why the application executes more than one SQL statement, opening a ResultSet object, under the same connection.
This is the way the application is performing, and we can't change it.
I've read that on SQL Server 2005 is available a new connection parameter called MARS (Multiple Active Result Sets), that should resolve this problem.
But I was not able to find any way to invoke this type of connection in JAVA for an ODBC connection! (I've found only tips for .NET...).
Many thanks if somebody can suggest me how to resolve this problem.
It's urgent!Use JDBC. Get a SQL server JDBC driver. Unfortunately I don't know of any free ones, but one I have used in the past is from http://www.jnetdirect.com/
Maybe you can search in the JDBC forum for the answer - Its a common enough question I know. -
Opening connection to SQL Server take about 20 seconds
Hello!
When I connecting to SQL Server 2000 throwgh JDBC, method getConnection() work about 20 seconds. What the reason of this behavior may be? I use JDBC driver from Microsoft.
Sorry for my English.
Thank you.I cleared up the reason of such effect myself. May be it will be interesting somebody. The cause was in absence of server name on DNS server!
-
Null connection when trying to connect to SQL Server 2000 in Tomcat4.1.29
Hi All,
I am still struggling with null connection when trying to connect to sql server 2000 with tomcat using sun.jdbc.odbc.JdbcOdbcDriver
Here is my server.xml
<Server port="8005" shutdown="SHUTDOWN" debug="0">
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
debug="0"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
debug="0"/>
<GlobalNamingResources>
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved">
</Resource>
<ResourceParams name="UserDatabase">
<parameter>
<name>factory</name>
<value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
</parameter>
<parameter>
<name>pathname</name>
<value>conf/tomcat-users.xml</value>
</parameter>
</ResourceParams>
<Resource auth="Container" description="Users and Groups
Database" name="UserDatabase"
scope="Shareable"
type="org.apache.catalina.UserDatabase"/>
<Resource name="jdbc/DefaultDS" scope="Shareable"
type="javax.sql.DataSource"/>
<ResourceParams name="UserDatabase">
<parameter>
<name>factory</name>
<value>org.apache.catalina.users.
MemoryUserDatabaseFactory</value>
</parameter>
<parameter>
<name>pathname</name>
<value>conf/tomcat-users.xml</value>
</parameter>
</ResourceParams>
<ResourceParams name="jdbc/DefaultDS">
<parameter>
<name>validationQuery</name>
<value></value>
</parameter>
<parameter>
<name>user</name>
<value>sa</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>5000</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>4</value>
</parameter>
<parameter>
<name>password</name>
<value>sa</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:odbc:JBoss-SQL://localhost:1433;databaseName=Development;selectMethod=cursor;</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>sun.jdbc.odbc.JdbcOdbcDriver</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>2</value>
</parameter>
</ResourceParams>
</GlobalNamingResources>
<!-- Define the Tomcat Stand-Alone Service -->
<Service name="Tomcat-Standalone">
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8080" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="100" debug="0" connectionTimeout="20000"
useURIValidationHack="false" disableUploadTimeout="true" />
<!-- Note : To disable connection timeouts, set connectionTimeout value
to -1 -->
<!-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -->
<!--
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8443" minProcessors="5" maxProcessors="75"
enableLookups="true"
acceptCount="100" debug="0" scheme="https" secure="true"
useURIValidationHack="false" disableUploadTimeout="true">
<Factory className="org.apache.coyote.tomcat4.CoyoteServerSocketFactory"
clientAuth="false" protocol="TLS" />
</Connector>
-->
<!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8009" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="10" debug="0" connectionTimeout="0"
useURIValidationHack="false"
protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/>
<!-- Define an AJP 1.3 Connector on port 8009 --><Logger className="org.apache.catalina.logger.FileLogger"
prefix="catalina_log." suffix=".txt"
timestamp="true"/>
<!-- Define the default virtual host -->
<Host name="localhost" debug="0" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="localhost_log." suffix=".txt"
timestamp="true"/>
<Environment name="maxExemptions" type="java.lang.Integer"
value="15"/>
<Parameter name="context.param.name" value="context.param.value"
override="false"/>
<Resource name="jdbc/DefaultDS" auth="container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/DefaultDS">
<!-- Maximum number of dB connections in pool.
Set to 0 for no limit.
-->
<parameter>
<name>maxActive</name>
<value>8</value>
</parameter>
<!-- Maximum number of idle dB connections to retain in pool.
Set to 0 for no limit.
-->
<parameter>
<name>maxIdle</name>
<value>4</value>
</parameter>
<!-- Maximum time to wait for a dB connection to become available
in ms, in this example 10 seconds. An Exception is thrown if
this timeout is exceeded. Set to -1 to wait indefinitely.
-->
<parameter>
<name>maxWait</name>
<value>5000</value>
</parameter>
<!-- MS Sql Server dB username and password for dB connections
-->
<parameter>
<name>user</name>
<value>sa</value>
</parameter>
<parameter>
<name>password</name>
<value>sa</value>
</parameter>
<!-- Class name for MS Sql Server JDBC driver
-->
<parameter>
<name>driverClassName</name>
<value>sun.jdbc.odbc.JdbcOdbcDriver</value>
</parameter>
<!-- The JDBC connection url for connecting to MS Sql Server dB.
-->
<parameter>
<name>url</name>
<value>jdbc:odbc:JBoss-SQL://localhost:1433;databaseName=Development;selectMethod=cursor;</value>
</parameter>
<!-- This Databae Connection Pool Description.
-->
<parameter>
<name>description</name>
<value>JDBC Driver: sun.jdbc.odbc.JdbcOdbcDriver</value>
</parameter>
</ResourceParams>
<Resource name="mail/Session" auth="Container"
type="javax.mail.Session"/>
<ResourceParams name="mail/Session">
<parameter>
<name>mail.smtp.host</name>
<value>localhost</value>
</parameter>
</ResourceParams>
<ResourceLink name="linkToGlobalResource"
global="simpleValue"
type="java.lang.Integer"/>
</Host>
</Engine>
</Service>
</Server>
and my web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<!-- Standard Action Servlet Mapping -->
<web-app>
<resource-ref>
<res-ref-name>jdbc/DefaultDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>
and JBoss-SQL is data source I created from control panel settings and here is way I am retrieving connetion
InitialContext initCtx = new InitialContext();
DataSource ds = (DataSource) initCtx.lookup("java:comp/env/jdbc/DefaultDS");
Connection con = ds.getConnection();
return con;
I tried connecting as mentioned in this website
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html#Common%20Problems.But didn't help
Please help urgent
Sorry for long file. Can any one please help me in solving this problem.
Thanks in advnace
KurakulaI'd recommend that you not use the JDBC-ODBC bridge driver to connect to SQL Server. M$ and jTDS are two free type IV JDBC drivers that you should use instead. Put those JARs in the WEB-INF/lib directory.
The database URL you're using is not correct if you change drivers. Consult the docs to find out what the proper syntax is.
MOD -
Unable to establishing a connection to SQL Server created via SqlManagementClient
Goal:
create an Azure SQL Server via .NET (Microsoft.WindowsAzure.Management.Sql.Modules.SqlManagementClient) and add a database to it.
Problem:
I am NOT able to access the newly created server from .Net code.
Description:
Using SqlManagementClient I SUCCESFULLY create a new Azure SQL Server (see code below).
After creating the server, I am able to access the new server from Azure Portal.
* firewall rule show valid client machine
* "Windows Azure Services" is set to "Yes"
An error occures when I try connecting to the database using the same user and pwd used to create it.
/* the following code results in a connection failure */
//string server = <name of newly created sql server>
//string db = <name of new database to create, inside of the server>
public void CreateDatabase(string server, string db)
using (ReliableSqlConnection conn = new ReliableSqlConnection(
Configuration.GetConnectionString(server, "Master"),
SqlRetryPolicy,
SqlRetryPolicy))
conn.Open(); //// throws System.Data.SqlClient.SqlException
//// A network-related or instance-specific error occurred while establishing a connection to SQL Server.
SqlCommand cmd = conn.CreateCommand();
/* the following code creates a sql server and firewall rules */
ServerCreateResponse response;
SubscriptionCloudCredentials creds;
X509Certificate2 cert;
//// Gets the certificate
cert = CredentialUtil.GetCertificate(certificateStoreName, certificateStoreLocation, certificateThumbprint);
//// Using the certificate and the subscription build credential
creds = new CertificateCloudCredentials(azureSubscriptionId, cert);
//// using creditials create server and set firewall rules
using (SqlManagementClient client = new SqlManagementClient(creds))
response = client.Servers.Create(new ServerCreateParameters()
AdministratorPassword = sqlPwd,
AdministratorUserName = sqlUser,
Location = location
if (response.StatusCode == HttpStatusCode.Created)
//// 0.0.0.0 is added to enable "Windows Azure Services" on the "Configure" tab.
//// <MyInternetIp> would be my actual IP address.
//// - (which works for other servers that i have manualy registered
validIPs = new List<string>() {"0.0.0.0", "<MyInternetIp>"};
CreateFireWallRule(client, response.ServerName, validIPs);
//// Adds IP to Azure firewall.
private static void CreateFireWallRule(SqlManagementClient client, string azureServerName, IEnumerable<string> validIPs)
foreach (string ip in validIPs)
FirewallRuleCreateParameters rule = new FirewallRuleCreateParameters() { Name = string.Format("Allow {0} - {1}", Environment.MachineName, ip), StartIPAddress
= ip, EndIPAddress = ip };
client.FirewallRules.Create(azureServerName, rule);
/// Error
System.Data.SqlClient.SqlException was unhandled
HResult=-2146232060
Message=A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.
(provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
Source=.Net SqlClient Data Provider
ErrorCode=-2146232060
Class=20
LineNumber=0
Number=53
Server=""
State=0Using SqlManagementClient I SUCCESFULLY create a new Azure SQL Server.
ServerCreateResponse response;
SubscriptionCloudCredentials creds;
X509Certificate2 cert;
cert = CredentialUtil.GetCertificate(parameters.CertificateStoreName, parameters.CertificateStoreLocation, parameters.CertificateThumbprint);
creds = new CertificateCloudCredentials(parameters.AzureSubscriptionId, cert);
using (SqlManagementClient client = new SqlManagementClient(creds))
response = client.Servers.Create(new ServerCreateParameters()
AdministratorPassword = parameters.SqlPwd,
AdministratorUserName = parameters.SqlUser,
Location = parameters.Location
if (response.StatusCode == HttpStatusCode.Created)
CreateFireWallRule(client, response.ServerName, parameters.ValidIPs); -
Problem with Connection to SQL Server via Servlet (in iPlanet 6 App Server)
Hi ,
I am using the iPlanet ApplicationServer 6.0 SP2 for development & testing of an internet application.
I am facing a problem when I am trying to connect to MS SQL SERVER via the native jdbcodbc driver (obdc32.dll). The error is something like this :
[26/Jul/2001 11:50:35:7] warning: DriverConnect: (28000): [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user '\'.(DB Error: 18456)
[26/Jul/2001 11:50:35:7] warning: ODBC-027: CreateConn: failed to create connection [new connection]: DSN=fadd,DB=cashbook,USER=test,PASS=xxxxxxxxx
[26/Jul/2001 11:50:35:7] error: DATA-108: failed to create a data connection wit
h any of specified drivers
Error in connecting to the Database for cirrus :java.sql.SQLException: failed to
create a data connection with any of specified drivers
java.sql.SQLException: failed to create a data connection with any of specified
drivers
at com.netscape.server.jdbc.Driver.afterVerify(Unknown Source)
at com.netscape.server.jdbc.Driver.connect(Unknown Source)
at com.netscape.server.jdbc.DataSourceImpl.getConnection(Unknown Source)
at gefa.util.DBConnection.jdbcConnectionOpen(DBConnection.java:65)
at gefa.servlet.ServUpload.doPost(ServUpload.java:45)
at gefa.servlet.ServUpload.doGet(ServUpload.java:29)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
at com.netscape.server.servlet.servletrunner.ServletInfo.service(Unknown
Source)
at com.netscape.server.servlet.servletrunner.ServletRunner.execute(Unkno
wn Source)
at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
at com.kivasoft.thread.ThreadBasic.run(Native Method)
at java.lang.Thread.run(Thread.java:479)
I have configured a DSN with the name "fadd" on the machine with the application server and it used NT authentication. I have supplied an NT userid and password that has appropriate rights on the database "cashbook".
When I write a java standalone program, it does connect but via a servlet it does not connect.
Can some guide me with this problem please ?
Anything one might have observed in the past ? (may be specific to iPlanet ?)
Thanks a lot in advance
~SunilI'm using iPlanet App server as well and experiencing similar problem. I load my SQL Server driver by Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver"), then use DriverManager.getDriver() to obtain the Driver.
However, the Driver returned is not the SQLServerDriver as expected. The Driver returned is com.netscape.server.jdbc.Driver! And then when I do Driver.getConnection("jdbc:microsoft:sqlserver://MyServer"), it throws an SQLException saying that it doesn't accept a jdbc:microsoft:sqlserver subprotocol. Well, of course it doesn't, it's not a microsoft Driver at all.
I suspect the problem is that the netscape Driver's acceptsURL() method ALWAYS returns true in iPlanet app server, thus when you getDriver(), the netscape Driver is always returned (and always returned as the first one since it's default?). Thus even though the same piece of code works fine as a standalone application, it just doesn't work on iPlanet app server.
My work around is:
Class.forName("my.Driver");
Enumeration enu = DriverManager.getDrivers();
Driver useThis = null;
while (enu.hasMoreElements()) {
Driver d = (Driver)enu.nextElement();
if (d.getClass().toString().indexOf("my.Driver") > -1) {
useThis = d;
Mind that my above code does not have an performance issue. If you look into the source code of how DriverManager get a Driver for a particular URL, it also loads the whole set of available Drivers, then call acceptsURL() method on each of them to find the first "suitable" one. Thus time complexity is the same.
I know this is not a very elegant solution and it defeats the purpose of having a DriverManager. Does any one else has a better way to solve this problem, like a way to specify the priority of each Driver so that SQLServerDriver is returned before the netscape Driver?
Thanks a lot.
Maybe you are looking for
-
I had hooked my new iphone 4s up to itunes. I did not read what they were asking correctly, which was to "set up as a new iphone": or "restore backup." i choose restore backup, and now it looks like my iphone 3g. I lost all my photos from my iphone 4
-
Flash Player Installs but doesn't work WIN 7
It doesn't ever appear to be loaded when I look for it. Why in the world would it say that it has loaded and installed when it doesn't?? Look folks, I'm literally losing my mind here. I'm IRATE. If you think you've seen this problem before, GUESS AGA
-
Opening values for SFG and FG....Material master or MR21?
hi Experts, when we upload the opening material values, from where will it pick the values for SFG and FG.....is it from Material Master or from MR21. I want to run Costing run and save the prices after uploading the opening balances and not before.
-
How do I create a proxyserver?
I have a program that has a http server that produces a webpage and a login server and a client program (applet). When a client tries to log in the username and password is sent to the loginserver. The login server then sends the user information to
-
Hi, http://rapidshare.com/files/401755613/Kishore.jpg.html please download the file by using link. that is the snapshot of my requirement. I wand to display the rank based on the value seleted on the column selector The Rank should be applied based o