How to connect Sql Server 2000 using JDBC ODBC Driver
How to connect Sql Server 2000 using JDBC ODBC Driver ?
plz Send Syntax.
thanks
In SQL Server 2000 the driver class is com.microsoft.jdbc.sqlserver.SQLServerDriver
The connection URL for the default SQL Server 2000 database is jdbc:sqlserver://localhost:1433
Class.forName(
"com.microsoft.sqlserver.jdbc.
SQLServerDriver");
String url =
"jdbc:sqlserver://localhost:1433";
Connection conn = DriverManager.
getConnection(
url, "sa", "sqlserver");
Similar Messages
-
Connect SQL Server 2000 using JDBC
Hi all,
We have installed the microsoft sql server 2000 into 3 different pcs which is not the server. we have installed the jdbc driver into the server and wish to connect the database from the 3 pcs using that jdbc driver from the server. may i know is it possible to connect the database and if it is possible, the database url is it something like jdbc:sqlserver://<host_name>:<port>;DatabaseName=<db_name>?
Also may i know what is actually the host name? like is it the host name of j2ee engine or the ip address where the database resides in. also for the port is it 1433 for microsoft sql server 2000 and if it is fix meaning that only 1433 is the port for sql server 2000?
ThanksHi,
see <a href="https://www.sdn.sap.com/irj/sdn/thread?threadID=48126">this Thread</a>
HTH,
Carsten
The hostname is the name (or IP-Adress) of your PCs. The Port of SQL Server may vary, but by default it is 1433. -
How to insert chinese data into MS SQL Server 2000 through JDBC
I am trying to insert chinese data into MS SQL server 2000 using JDBC. how to do this?
can anybody help me.
thanx.I am trying to insert chinese data into MS SQL server 2000 using JDBC. how to do this?
can anybody help me.
thanx. -
Access denial on connecting SQL server 2000 with Microsoft JDBC driver
Hi guys,
I am developping a BMP invoking procedures stored in a SQL server 2000 instance on the Sun RI platform. I am using the Microsoft type 4 JDBC driver.
the connection pattern is something like
jdbc:microsoft:sqlserver://ambassador:1433;User=sa;Password;DataBase=Forethought;SelectMethod=cursor
An type-like "access denied" exception is raised when trying to get the connection from the DataSource object with some code similar to :
DataSource objDS = (DataSource)objCtx.lookup("jdbc/Forethought");
Connection objConn = ds.getConnection();
I have realised a CMP to access the database and everything works fine.
It seems that the SunRI tries to get the db connection with an "impersonated " user even if i have specified the user name and password in the connection string.
Does anyone have an idea how to force the connection with SQL Server user name and password ??I come accorss the same problem too,
my URL jdbc:microsoft:sqlserver://ambassador:1433;User=sa;Password=123;DatabaseName=pubs
and the password is right.I can establish connection to SQL server 2000 by JDBC Driver Manager,the code as follow:
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
Connection conn = DriverManager.getConnection
("jdbc:microsoft:sqlserver://localhost:1433;User=sa;Password=123"); -
How to connect sql server using oracle Client
Hi,
I am working in oracle9i and windows os 32 bit.
I need to connect SQL server 2000 from my oracle client..
I heard about heterogeneous connectivity ...
Please expalin me the steps what to add and how to connect the sql server...
Regs....Are you trying to connect to SQL Server from your Oracle database (i.e. create a database link in Oracle to SQL Server)? Or are you trying to connect to SQL Server using your Oracle client software (i.e. SQL*Plus)?
The former just requires Heterogeneous Services with Generic Connectivity. The latter is functionality that has been depricated and probably no longer works in your environment.
Justin -
Trouble connecting to the Microsoft SQL Server 2005 using JDBC Connection
Hi,
I am unable to connect to the Microsoft SQL Server 2005 using JDBC Connection. Kindly tell me steps to connect to the SQL Server using JDBC. The error message that I am getting while creating a data source is :
java.rmi.RemoteException: com.sap.engine.services.dbpool.exceptions.BaseRemoteException: Error during start of application "sap.com/JDBCConnector_KedDS.xml". [id = StartupError]
at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.startApplication(DataSourceManagerImpl.java:608)
at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.deploy(DataSourceManagerImpl.java:285)
at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.createDataSource(DataSourceManagerImpl.java:342)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sap.pj.jmx.introspect.DefaultMBeanInvoker.invoke(DefaultMBeanInvoker.java:58)
at com.sap.pj.jmx.mbeaninfo.AdditionalInfoProviderMBean.invoke(AdditionalInfoProviderMBean.java:289)
at com.sap.pj.jmx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:944)
at com.sap.pj.jmx.server.interceptor.MBeanServerWrapperInterceptor.invoke(MBeanServerWrapperInterceptor.java:288)
at com.sap.engine.services.jmx.CompletionInterceptor.invoke(CompletionInterceptor.java:409)
at com.sap.pj.jmx.server.interceptor.BasicMBeanServerInterceptor.invoke(BasicMBeanServerInterceptor.java:277)
at com.sap.jmx.provider.ProviderInterceptor.invoke(ProviderInterceptor.java:258)
at com.sap.engine.services.jmx.RedirectInterceptor.invoke(RedirectInterceptor.java:340)
at com.sap.pj.jmx.server.interceptor.MBeanServerInterceptorChain.invoke(MBeanServerInterceptorChain.java:330)
at com.sap.engine.services.jmx.MBeanServerSecurityWrapper.invoke(MBeanServerSecurityWrapper.java:287)
at com.sap.engine.services.jmx.MBeanServerInvoker.invokeMbs(MBeanServerInvoker.java:131)
at com.sap.engine.services.jmx.ClusterInterceptor.invokeMbs(ClusterInterceptor.java:212)
at com.sap.engine.services.jmx.ClusterInterceptor.invoke(ClusterInterceptor.java:766)
at com.sap.engine.services.jmx.MBeanServerInterceptorInvoker.invokeMbs(MBeanServerInterceptorInvoker.java:102)
at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImpl.invokeMbs(P4ConnectorServerImpl.java:61)
at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImplp4_Skel.dispatch(P4ConnectorServerImplp4_Skel.java:64)
at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Caused by: java.rmi.RemoteException: Error occurred while starting application in whole cluster and wait.; nested exception is:
com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Clusterwide exception: server ID 13169050:com.sap.engine.services.dbpool.exceptions.BaseDeploymentException: Cannot create DataSource "KedDS".
at com.sap.engine.services.dbpool.deploy.ContainerImpl.startDataSources(ContainerImpl.java:1843)
at com.sap.engine.services.dbpool.deploy.ContainerImpl.prepareStart(ContainerImpl.java:489)
at com.sap.engine.services.deploy.server.application.StartTransaction.prepareCommon(StartTransaction.java:223)
at com.sap.engine.services.deploy.server.application.StartTransaction.prepare(StartTransaction.java:171)
at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:301)
at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesImpl(ParallelAdapter.java:342)
at com.sap.engine.services.deploy.server.application.ParallelAdapter.runInTheSameThread(ParallelAdapter.java:126)
at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesAndWait(ParallelAdapter.java:245)
at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:4761)
at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:661)
at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:645)
at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.startApplication(DataSourceManagerImpl.java:606)
at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.deploy(DataSourceManagerImpl.java:285)
at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.createDataSource(DataSourceManagerImpl.java:342)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sap.pj.jmx.introspect.DefaultMBeanInvoker.invoke(DefaultMBeanInvoker.java:58)
at com.sap.pj.jmx.mbeaninfo.AdditionalInfoProviderMBean.invoke(AdditionalInfoProviderMBean.java:289)
at com.sap.pj.jmx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:944)
at com.sap.pj.jmx.server.interceptor.MBeanServerWrapperInterceptor.invoke(MBeanServerWrapperInterceptor.java:288)
at com.sap.engine.services.jmx.CompletionInterceptor.invoke(CompletionInterceptor.java:409)
at com.sap.pj.jmx.server.interceptor.BasicMBeanServerInterceptor.invoke(BasicMBeanServerInterceptor.java:277)
at com.sap.jmx.provider.ProviderInterceptor.invoke(ProviderInterceptor.java:258)
at com.sap.engine.services.jmx.RedirectInterceptor.invoke(RedirectInterceptor.java:340)
at com.sap.pj.jmx.server.interceptor.MBeanServerInterceptorChain.invoke(MBeanServerInterceptorChain.java:330)
at com.sap.engine.services.jmx.MBeanServerSecurityWrapper.invoke(MBeanServerSecurityWrapper.java:287)
at com.sap.engine.services.jmx.MBeanServerInvoker.invokeMbs(MBeanServerInvoker.java:131)
at com.sap.engine.services.jmx.ClusterInterceptor.invokeMbs(ClusterInterceptor.java:212)
at com.sap.engine.services.jmx.ClusterInterceptor.invoke(ClusterInterceptor.java:766)
at com.sap.engine.services.jmx.MBeanServerInterceptorInvoker.invokeMbs(MBeanServerInterceptorInvoker.java:102)
at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImpl.invokeMbs(P4ConnectorServerImpl.java:61)
at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImplp4_Skel.dispatch(P4ConnectorServerImplp4_Skel.java:64)
at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Caused by: com.sap.engine.services.dbpool.exceptions.BaseInstantiationException: Cannot create instance ManagedConnectionFactoryImpl.
at com.sap.engine.services.dbpool.spi.ManagedConnectionFactoryImpl.<init>(ManagedConnectionFactoryImpl.java:78)
at com.sap.engine.services.dbpool.deploy.ContainerImpl.startDataSources(ContainerImpl.java:1779)
... 42 more
Caused by: java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
Found in negative cache
------------------------- Loader Info -------------------------
ClassLoader name: [library:KedDriver]
Parent loader name: [Frame ClassLoader]
No references !
Resources:
E:\usr\sap\J2E\JC01\j2ee\cluster\server0\bin\ext\KedDriver\sqljdbc.jar
E:\usr\sap\J2E\JC01\j2ee\cluster\server0\bin\core_lib\opensqlport.jar
Loading model: {parent,local,references}
at com.sap.engine.frame.core.load.ReferencedLoader.loadClass(ReferencedLoader.java:360)
at com.sap.engine.services.dbpool.spi.ManagedConnectionFactoryImpl.<init>(ManagedConnectionFactoryImpl.java:74)
... 43 more
at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:663)
at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:645)
at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.startApplication(DataSourceManagerImpl.java:606)
... 31 more
Caused by: com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Clusterwide exception: server ID 13169050:com.sap.engine.services.dbpool.exceptions.BaseDeploymentException: Cannot create DataSource "KedDS".
at com.sap.engine.services.dbpool.deploy.ContainerImpl.startDataSources(ContainerImpl.java:1843)
at com.sap.engine.services.dbpool.deploy.ContainerImpl.prepareStart(ContainerImpl.java:489)
at com.sap.engine.services.deploy.server.application.StartTransaction.prepareCommon(StartTransaction.java:223)
at com.sap.engine.services.deploy.server.application.StartTransaction.prepare(StartTransaction.java:171)
at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:301)
at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesImpl(ParallelAdapter.java:342)
at com.sap.engine.services.deploy.server.application.ParallelAdapter.runInTheSameThread(ParallelAdapter.java:126)
at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesAndWait(ParallelAdapter.java:245)
at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:4761)
at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:661)
at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:645)
at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.startApplication(DataSourceManagerImpl.java:606)
at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.deploy(DataSourceManagerImpl.java:285)
at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.createDataSource(DataSourceManagerImpl.java:342)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sap.pj.jmx.introspect.DefaultMBeanInvoker.invoke(DefaultMBeanInvoker.java:58)
at com.sap.pj.jmx.mbeaninfo.AdditionalInfoProviderMBean.invoke(AdditionalInfoProviderMBean.java:289)
at com.sap.pj.jmx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:944)
at com.sap.pj.jmx.server.interceptor.MBeanServerWrapperInterceptor.invoke(MBeanServerWrapperInterceptor.java:288)
at com.sap.engine.services.jmx.CompletionInterceptor.invoke(CompletionInterceptor.java:409)
at com.sap.pj.jmx.server.interceptor.BasicMBeanServerInterceptor.invoke(BasicMBeanServerInterceptor.java:277)
at com.sap.jmx.provider.ProviderInterceptor.invoke(ProviderInterceptor.java:258)
at com.sap.engine.services.jmx.RedirectInterceptor.invoke(RedirectInterceptor.java:340)
at com.sap.pj.jmx.server.interceptor.MBeanServerInterceptorChain.invoke(MBeanServerInterceptorChain.java:330)
at com.sap.engine.services.jmx.MBeanServerSecurityWrapper.invoke(MBeanServerSecurityWrapper.java:287)
at com.sap.engine.services.jmx.MBeanServerInvoker.invokeMbs(MBeanServerInvoker.java:131)
at com.sap.engine.services.jmx.ClusterInterceptor.invokeMbs(ClusterInterceptor.java:212)
at com.sap.engine.services.jmx.ClusterInterceptor.invoke(ClusterInterceptor.java:766)
at com.sap.engine.services.jmx.MBeanServerInterceptorInvoker.invokeMbs(MBeanServerInterceptorInvoker.java:102)
at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImpl.invokeMbs(P4ConnectorServerImpl.java:61)
at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImplp4_Skel.dispatch(P4ConnectorServerImplp4_Skel.java:64)
at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Caused by: com.sap.engine.services.dbpool.exceptions.BaseInstantiationException: Cannot create instance ManagedConnectionFactoryImpl.
at com.sap.engine.services.dbpool.spi.ManagedConnectionFactoryImpl.<init>(ManagedConnectionFactoryImpl.java:78)
at com.sap.engine.services.dbpool.deploy.ContainerImpl.startDataSources(ContainerImpl.java:1779)
... 42 more
Caused by: java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
Found in negative cache
------------------------- Loader Info -------------------------
ClassLoader name: [library:KedDriver]
Parent loader name: [Frame ClassLoader]
No references !
Resources:
E:\usr\sap\J2E\JC01\j2ee\cluster\server0\bin\ext\KedDriver\sqljdbc.jar
E:\usr\sap\J2E\JC01\j2ee\cluster\server0\bin\core_lib\opensqlport.jar
Loading model: {parent,local,references}
at com.sap.engine.frame.core.load.ReferencedLoader.loadClass(ReferencedLoader.java:360)
at com.sap.engine.services.dbpool.spi.ManagedConnectionFactoryImpl.<init>(ManagedConnectionFactoryImpl.java:74)
... 43 more
at com.sap.engine.services.deploy.server.application.ParallelAdapter.sleepClientThread(ParallelAdapter.java:270)
at com.sap.engine.services.deploy.server.application.ParallelAdapter.runInTheSameThread(ParallelAdapter.java:127)
at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesAndWait(ParallelAdapter.java:245)
at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:4761)
at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:661)
... 33 more
at com.sap.engine.services.dbpool.exceptions.BaseRemoteException.writeReplace(BaseRemoteException.java:178)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at java.io.ObjectStreamClass.invokeWriteReplace(ObjectStreamClass.java:896)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1011)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:367)
at javax.management.MBeanException.writeObject(MBeanException.java:126)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:809)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1296)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:367)
at com.sap.exception.BaseExceptionInfo.writeObject(BaseExceptionInfo.java:964)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:809)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1296)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
at com.sap.engine.services.jmx.ResponseMessage.writeBody(ResponseMessage.java:177)
at com.sap.engine.services.jmx.Message.writeMsg(Message.java:257)
at com.sap.engine.services.jmx.Message.getMsg(Message.java:453)
at com.sap.engine.services.jmx.Message.writeExternal(Message.java:505)
at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1267)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1245)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImplp4_Skel.dispatch(P4ConnectorServerImplp4_Skel.java:66)
at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)i'm using jcreator pro
jdk i.6
mssql server 2005
and downloaded the jdbc driver( i noticed that the msutil.jar and msbase.jar are not in the folder avalable on microsoft site Microsoft SQL Server 2005 JDBC Driver so i installed
Microsoft SQL Server 2000 Driver for JDBC 1st and just changed the jqljdb.jar file with the one available in Microsoft SQL Server 2005 JDBC Driver )
and set the path of the CLASSPATH to a folder which name has no spaces
and tried Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
and Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
and tried compiling and running with command prompt
and still have the same exception which occurs at runtime
"An exception has occured: java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver"
i really need help -
Hi
I want to know how to connect SQL server using DNSless connection ?
/* 2003/02/06 eric.leung
* Source : HOME
import java.sql.*;
import java.lang.*;
public class ejdbcsel {
public static void main(String args[]) {
// eric_jsp is ODBC User DNS
// String url = "jdbc:odbc:eric_jsp";
// Using DSNless connection
String url = "";
url = "jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)}" +
";SERVER=127.0.0.1;DBQ=c:\\example\\ERIC_JSP.mdb";
Connection con;
String query;
query = "select * from pt_mstr";
Statement stmt;
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
} catch (ClassNotFoundException e) {
System.err.print("ClassNotFoundException " );
System.err.println(e.getMessage());
try {
con = DriverManager.getConnection (url,"","");
stmt = con.createStatement();
ResultSet rec = stmt.executeQuery(query);
// Scan the Database
while(rec.next()) {
System.out.println(rec.getString("pt_part") + "\t"
+ rec.getString("pt_desc"));
stmt.close();
con.close();
} catch (SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());
catch (Exception e) {
System.err.println("Error: " + e.toString() + " " + e.getMessage());Use a driver...
http://java.sun.com/products/jdbc/driverdesc.html
http://industry.java.sun.com/products/jdbc/drivers -
How to connect sql server at RunTime?
Hi,I have a question that when i want to use DBAdapter to connect sql server 2000 in oracle esb at RunTime.
At design Time ,it can work.but at RunTime ,it does't work.
At run time,
1)modify Oracle_Home/j2ee/home/config/application.xml
add follow elements,the path is right:
<library path="../applib/msbase.jar"/>
<library path="../applib/mssqlserver.jar"/>
<library path="../applib/msutil.jar"/>
2)Drop the JAR files into the following directories:
Oracle_Home/j2ee/home/applib
JAR files Include msbase.jar,mssqlserver.jar,msutil.jar
But it does't work!!!
Then i use DataDirect driver:
YMbase.jar,YMutil.jar,YMsqlserver.jar
it does't work either!!!
what should i do ??
Help.
when i use DataDirect driver ,Exception like this:
An unhandled exception has been thrown in the ESB system. The exception reported
is: "org.collaxa.thirdparty.apache.wsif.WSIFException:
esb:///ESB_Projects/PocApp_POCproject/MESInsert.wsdl [
MESInsert_ptt::insert(MtlMesCollection) ] - WSIF JCA Execute of operation
'insert' failed due to: Could not create/access the TopLink Session. This
session is used to connect to the datastore. ; nested exception is: ORABPEL-
11622 Could not create/access the TopLink Session. This session is used to
connect to the datastore. See root exception for the specific exception. You may
need to configure the connection settings in the deployment descriptor (i.e.
$J2EE_HOME/application-deployments/default/DbAdapter/oc4j-ra.xml) and restart
the server. Caused by Exception [TOPLINK-4003] (Oracle TopLink - 10g Release 3
(10.1.3.1.0) (Build 061004)): oracle.toplink.exceptions.DatabaseException
Exception Description: Configuration error. Class
[com.oracle.ias.jdbc.sqlserver.SQLServerDriver] not found.. at
oracle.tip.adapter.fw.wsif.jca.WSIFOperation_JCA.executeRequestResponseOperation
(WSIFOperation_JCA.java:623) at
oracle.tip.adapter.fw.wsif.jca.WSIFOperation_JCA.executeInputOnlyOperation(WSIFO
peration_JCA.java:726) at
oracle.tip.esb.server.common.wsif.WSIFInvoker.executeOperation(Unknown Source)
at oracle.tip.esb.server.common.wsif.WSIFInvoker.nextService(Unknown Source) at
oracle.tip.esb.server.common.wsif.WSIFInvoker.nextService(Unknown Source) at
oracle.tip.esb.server.service.impl.outadapter.OutboundAdapterService.nextService
(Unknown Source) at
oracle.tip.esb.server.service.impl.outadapter.OutboundAdapterService.processBusi
nessEvent(Unknown Source) at
oracle.tip.esb.server.dispatch.InitialEventDispatcher.dispatchNonRoutingService(
Unknown Source) at
oracle.tip.esb.server.dispatch.InitialEventDispatcher.dispatch(Unknown Source)
at oracle.tip.esb.server.dispatch.BusinessEvent.raise(Unknown Source) at
oracle.tip.esb.utils.EventUtils.raiseBusinessEvent(Unknown Source) at oracle.
when i use SQL SERVER JDBC DRIVER,Exception just like before,the different only is
Class [com.microsoft.jdbc.sqlserver.SQLServerDriver] not found ....Hi,
Were you able to configure these 3 jars file. If so can you share the process that we need to follow to configure the environment so that i can access SQLServer.
Thanks,
Amby. -
How to connect sql server 2008 r2 sp2 with vs2013 ultimate?
how to connect sql server 2008 r2 sp2 with visual studio 2013 ultimate?
Hi Shahzad,
>>how to connect sql server 2008 r2 sp2 with visual studio 2013 ultimate?
Based on your issue, if you wan to connect the sql server 2008 r2 sp2 from VS2013 IDE. I suggest you can try the Ammar and darnold924's suggestion to check your issue.
In addition, I suggest you can also refer the following steps to connect the sql server 2008 r2 sp2 with visual studio 2013 ultimate.
Step1: I suggest you can go to VIEW->SQL Server Object Explorer->Right click SQL Server->Add SQL Server.
Step2: After you connect the SQL Server 2008 r2 sp2 fine, I suggest you can go to VIEW->Server Explorer-> right click the Data Connection->Add Connection.
And then you can create the connect string in the Add Connection dialog box.
Hope it help you!
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Problem when connecting sql server 2005 using SQL developer
Hi,
I installed Sql developer and I am trying to connect sql server 2005 using windows authentication. I had previously the SSO folder problem saying the path is missing in java.library.path. I copied the SSO folder into Sqldeveloper directory. I changed the settings under computer management->services and applications->sql server configuration manager->sql server 2005 network configuration ->protocols for sqlexpress->I enabled TCP/IP.
Now I am getting an error saying "Failure-can not open user default database.Login Failed. Login failed for user ...".
I am able to connect thru ODBC driver using windows authentication.
Any help on this is highly appreciated.
Thanks in advance,
LakshmiHi Martin,
Your solution has solved my problem too. Thanks for posting these workaround fixes :-)
However, there seem to be a problem with datetime fields. The query:
select getdate()
returns something like: oracle.datetimestamp.@1aed4
Is there a way to get around with this? Otherwise, using SQL Developer as a client for SQL Server doesn't serve the right purpose when we cannot access simple date fields :-) -
MS SQL Server 7 thru JDBC:ODBC bridge
Hi,
I am trying to access MS SQL server 7 thru JDBC ODBC bridge. I am finding my varchar data is being truncated to 255 characters. Any help on this would be appreciated.Any body know of a good type 4 jdbc driver for SQL
Server 7. There is one for SQL server 2000
downloadable from micrsoft site, but does it work for
sql server 7 too ?Older betas of this driver suported SQL Server 7, but I believe the plan is to specifically remove that capability in its final release.
My biased opinion would be to try the driver from DataDirect. http://www.ddtek.com Its their driver (an older version) that Microsoft has licensed for MS SQl 2000.
Getting it from DataDirect has a couple obvious advantages:
1. Its a later, more stable, better performing version
2. It will continue to Support MS SQL 7
3. It's suported by 24/7 phone,email and web tech support.
4. And, early this week, you should be able to get the latest 3.0 release which promises to be even more robust, in addition to conforming to the new specs.
5. its not free, but then again- you get what you pay for... -
Error while connecting to SQL Server 2000 using Heteregenous Services 11g
Hope this is the right thread to post on! We have been given the challenge of connecting to and reading data from a SQL Server 2000 database.
Our Infrastructure guys have set up the network access.
The SQL Server DB is set to windows NT Authentication only (N.B. NOT Mixed Mode) as there is an application running against the DB locally that will not run under Mixed Mode.
Our Oracle partner has download and installed the 11g Heteregenous Services. all works fine until the point we try to create the DBLink and then connect to the SQL Server DB when we get:
SQL> CREATE DATABASE LINK infoteam1.sco.infoteam.co.uk CONNECT TO "sco.infoteam.co.uk/infoteam" IDENTIFIED BY "########" USING 'dg4msql';
Database link created.
SQL> select * from "systables"@infoteam1.sco.infoteam.co.uk;
select * from "systables"@infoteam1.sco.infoteam.co.uk
ERROR at line 1:
ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
[Oracle][ODBC SQL Server Driver][SQL Server]Login failed for user
'sco.infoteam.co.uk/infoteam'. Reason: Not associated with a trusted SQL Server
connection.[Oracle][ODBC SQL Server Driver]Invalid connection string attribute
ORA-02063: preceding 2 lines from INFOTEAM1.SCO.INFOTEAM.CO.UK
The question is can we (and if so how)?) connect to the SQL Server using an NT Windows Authorised account?
JeremyHi,
Please look at MOS note
ORA-28500: Generic connectivity using ODBC DSN over mapped drive fails [ID 105210.1]
Ora-28500 with Ms Sqlserver - Not associated with a trusted SQL Server connection [ID 333775.1]
Regards,
Edited by: gjilevski1 on Aug 31, 2010 8:23 AM -
How to connect SQL server using JRun
I am relatively dumb into Java. I am running JRun server in Unix box, and I need to connect to the SQL server (full marks for guesssing that SQL server is on the Win2K box).
Now I want to connect to the SQL server from Jrun using JSPs.
Question:
1. Is JDBC:ODBC only way to connect to the SQL server, if yes -
2. Do I have to create a DSN on the server for the JDBC:ODBC bridge to work
3. Can I write my own database connection package,
Appreciate if any body can help me with this problem, and if you have written a package to connect to the database, then would be nice if you would let me try the same.
If you have any responses, please email me at [email protected]
Thanks in Advance for the anticipated help.
Viviar PrasadHi Prasad,
There is two ways(what I have done) to connect to sql server in jRun..
1) using your jdbc - odbc connectivity using your type one jdbc driver..
2) using type 4 driver.. (type 2 and 3 are not available right now for sql server)
in 1 you have to create an dsn and use it directly in program bypassing jrun management console(I mean u don't have to configure for that)
in 2 case you need to use jrun proprietery driver for the jdbc... there is a problem here..
this driver is available in Jrun 3.0 enterprise edition only and still has got some problem so you need to apply service pack-2 to your Jrun installation and need to download the driver.. jdbc driver from following link
ftp://ftp.allaire.com/kbftp/jrun/all/jrun_drivers.jar.zip
this will suply a html doc along with the driver . which will explain you how to apply..
you can download jdbc driver specilly for sql server from this link http://www.j-netdirect.com/jsqlconnect2_26.zip
but it will expire in a month..
any way once you have obtain any of the above driver, follow these step to configure jdbc in jrun.. you need to put the driver in the classpath..
1 - open your management console
2- select the webapplication for which you want to configure from left frame of mc(management console)
3- select jdbc data source click the add button and follow the wizard..
for more info ref to jrun quick start configuring jdbc settings that came with your JRun..
or you can directly click the link there and type
the name of the
first
datasource(you have supply any name you will be using that to access db in your java prog)
second name of the the jdbc driver
for Jrun it's
allire.jrun.jdbc.JRunDriver
for net direct
com.jnetdirect.jsql.JSQLDriver
third
url for jrun driver
jdbc:jrun:sqlserver://hostname:portno/databasename = dbname; USER = uname; Password = password
where dbname is your database name
uname is your sql server user name e.g sa
password is your password for the corresponding user name
where hostname is the name of the computer where your sqlserver is running it could be an ip e.g 10.0.0.32:1433
1433 is the default port no for the sqlserver if you are using tcp protocol to connect to the sql server
url for net direct
jdbc:JSQLConnect//hostname:port/databasename=dbname; USER =uname; Password = password
for any more information on this you can mail me in this id
[email protected]
All the best..
regards
Bishwa -
Store&read chinese characters in MS SQL server 2000 using Java
Hi,
I have a problem to store Chinese characters in MS SQL Server 2000, storing question marks(??????) instead of Chinese characters
I am using JSF framework, SUN APPLICATION Server 9.1 , MS SQL Server 2000 server and Microsoft data source driver class (com.microsoft.sqlserver.jdbc.SQLServerDataSource) to connect db.
I have one solution:
IN JSP:
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
and
In database column type should nvarchar in place of varchar
while inserting or updating the same need to add N prefix with the value like insert into client(Name, Id .) values (N+)
the above is working fine but the problem is here i have already defined database with 100s of tables I cant change database tables as well as queries
Thanks,
SathiI don't know any betterer option, than to copy the database tabels redefining the Chinese data fields as nvarchar.
To be frank I had also problems writing to a html file Chinese text stored in MS SQLServer 2000 nvarchar fields.
The following worked:'
public String getEncodedData(ResultSet resultSet, int columnIndex, String charset)
throws SQLException
//final String methodName = "getEncodedData";
InputStream binaryStream =resultSet.getBinaryStream(columnIndex);
String readStringFromStream=readStringFromStream(binaryStream, charset);//UTF_16LE);
return readStringFromStream;
public String readStringFromStream(InputStream inputStream, String charset) {
final String methodName = "readStringFromStream";
StringBuffer buffer = new StringBuffer();
try {
int ch;
InputStreamReader isr = new InputStreamReader(inputStream, charset);
Reader in = new BufferedReader(isr);
while ((ch = in.read()) > -1) {
buffer.append((char)ch);
in.close();
return buffer.toString();
} catch (IOException exception) {
Log.printError(this,methodName, exception);
return null;
}And writing it to file:
public void writeEncodedStringToFile(String text, String filePath, String charset, boolean append){
final String methodName = "writeEncodedStringToFile";
OutputStreamWriter writer= null;
try {
FileOutputStream fileOutputStream = new FileOutputStream(filePath, append);
writer = new OutputStreamWriter(fileOutputStream, charset);
writer.write(text);
} catch (IOException exception) {
Log.printError(this,methodName, exception);
}finally{
try {
writer.close();
} catch (IOException exception) {
Log.printError(this,methodName, exception);
}Edited by: astlanda on Feb 10, 2009 11:13 PM
Edited by: astlanda on Feb 10, 2009 11:21 PM -
How to Connect SQL Server enterprises Manager Version 8.0 with Form 6i
Dear experts
I want to know that How can I connect SQL server Enterprise Manager Version 8.0 with Forms/reprots 6i.
currently I have oracle 9i database at server windows 2003 and I also connected with client (my PC) I work on server.
I also have SQL server in that server 2003 machine and this SQL Server also work with other clients that have VB program.
I want to know that can I connect with this SQL server with Form 6i?You can't. The closest thing would be to create links in an oracle database to the SQL Server database using Heteregeneous Services and connect forms to the that.
This forum is for the SQLDeveloper tool. You will get more complete answers in the "Database General", or "Heterogeneous Services" forums
Maybe you are looking for
-
Why do I get general access denied trying to update my own field in Active Directory?
I am trying to update a field pertaining to my own user object in Active Directory using ADSI and C++ app. The operating system is Windows Server 2012 Standard. I am able to read, I am able to call Put without problems, but when I call SetInfo, it re
-
CreateWebInventoryWebReports.xml failed to complete
upgraded to ZAM 7.5 and now my Web access is giving me this error.
-
if i have an audiobook on my computer already, how do i get itunes to recognize it as an audiobook? someone told me to convert the files to mp4 format, but i don't know how to do this.
-
Dv9ooo series dv9925nr notebook no audio, disk drive no longer works
so i purchased this notebook brand new some years ago from best buy but right after my warrenty went out the audio would not work, then it could not even find the audio hardware installed, shortly after the disk drive no longer worked, so i stopped u
-
How can I make two Canvas in one Window ?
I want in the main window ( that is only window in the module ) press button to appear another canvas. but that I can't make it , I just made two window until the another window appear. that's all I tried with :- show_view('canvas_name'); but didn't