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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to