tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cui Xiaojing-a13339 <a13...@motorola.com>
Subject FW: Need your Direction
Date Tue, 23 Dec 2003 04:47:57 GMT
Hello All,

I got it. Thanks.

Regards,
Xiaojing

-----Original Message-----
From: Cui Xiaojing-a13339 [mailto:A13339@motorola.com]
Sent: 2003年12月23日 12:15
To: Tomcat Users List
Subject: Need your Direction


Hello All,

Now I am trying to access data in a table of a database of a instance of SQL Server 2000 throng
MS JDBC Driver. It is successful by using below code:
 		try {
			Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver"); 
			con = DriverManager.getConnection("jdbc:microsoft:sqlserver://MotServer\\InstEm;User=sss;Password=bbb");

	 		stmt=con.createStatement();
		} catch (Exception se) {}
		
		try{
			String sqls="select CID from PayrollData.dbo.CF_payroll_data";
			rs=stmt.executeQuery(sqls);
		}

In the code, PayrollData is a database in instance InstEm. Now I only want to write table
name in SQL statement, not with the database name, then how to write the connection statement?
That means if code write like below, then what is %%%? Thanks.

		try {
			Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver"); 
			con = DriverManager.getConnection("jdbc:microsoft:sqlserver://MotServer\\%%%;User=sss;Password=bbb");

	 		stmt=con.createStatement();
		} catch (Exception se) {}
		
		try{
			String sqls="select CID from CF_payroll_data";
			rs=stmt.executeQuery(sqls);
		}

Regards,
Xiaojing


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message