You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Cui Xiaojing-a13339 <a1...@motorola.com> on 2003/12/19 16:36:00 UTC

A weird issue

Hello All,

Now my software platform as below:

Windows 2000
JDK1.4.1_02
Tomcat 4.1.24
Sql Server 2000

I have a piece of code as below:

	private String jdbcDriverClass="sun.jdbc.odbc.JdbcOdbcDriver";
  	private String jdbcURL="jdbc:odbc:cfdata";
  	private String jdbcUserName="sss";
  	private String jdbcPassword="sss";
	try {
		Class.forName(jdbcDriverClass);
   		con=DriverManager.getConnection(jdbcURL, jdbcUserName, jdbcPassword);
		stmt=con.createStatement();
	} catch (SQLException se) {
      		throw new RuntimeException("A database error occured. " + se.getMessage());
	
	try{
		String sqls="select CID from CF_GDW_Load";
		rs=stmt.executeQuery(sqls);
	}

This piece of code is run in tomcat. It will extract data from table in Sql Server 2000. In Sql Server 2000, the table is named as CF_GDW_LOAD, but in the code I write it as CF_GDW_Load. I know that itis not case sensitive in Sql Server, but when I run this piece code in Tomcat, an exception occurs. it says that [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'CF_GDW_Load'. If I change CF_GDW_Load to CF_GDW_LOAD in the code, no exception occurs. So in here it is case sensitive. But making me surprised is that on the same software platform, I run another piece of code in Tomcat, it extract data from a table in another database in Sql Server 2000, it is not case sensitive. Do you have any idea about the weird issue? Thanks.

Regards,
Xiaojing


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


Re: A weird issue

Posted by Tim Funk <fu...@joedog.org>.
Try again with a type 4 jdbc driver to SQL server and NEVER use Sun's odbc
bridge.

http://jakarta.apache.org/tomcat/faq/database.html

-Tim

Cui Xiaojing-a13339 wrote:

> Hello All,
> 
> Now my software platform as below:
> 
> Windows 2000
> JDK1.4.1_02
> Tomcat 4.1.24
> Sql Server 2000
> 
> I have a piece of code as below:
> 
> 	private String jdbcDriverClass="sun.jdbc.odbc.JdbcOdbcDriver";
>   	private String jdbcURL="jdbc:odbc:cfdata";
>   	private String jdbcUserName="sss";
>   	private String jdbcPassword="sss";
> 	try {
> 		Class.forName(jdbcDriverClass);
>    		con=DriverManager.getConnection(jdbcURL, jdbcUserName, jdbcPassword);
> 		stmt=con.createStatement();
> 	} catch (SQLException se) {
>       		throw new RuntimeException("A database error occured. " + se.getMessage());
> 	
> 	try{
> 		String sqls="select CID from CF_GDW_Load";
> 		rs=stmt.executeQuery(sqls);
> 	}
> 
> This piece of code is run in tomcat. It will extract data from table in Sql Server 2000. In Sql Server 2000, the table is named as CF_GDW_LOAD, but in the code I write it as CF_GDW_Load. I know that itis not case sensitive in Sql Server, but when I run this piece code in Tomcat, an exception occurs. it says that [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'CF_GDW_Load'. If I change CF_GDW_Load to CF_GDW_LOAD in the code, no exception occurs. So in here it is case sensitive. But making me surprised is that on the same software platform, I run another piece of code in Tomcat, it extract data from a table in another database in Sql Server 2000, it is not case sensitive. Do you have any idea about the weird issue? Thanks.
> 
> 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


RE: A weird issue

Posted by George Sexton <gs...@mhsoftware.com>.
Download the MS JDBC driver, and never use ODBJ-JDBC bridge.

-----Original Message-----
From: Cui Xiaojing-a13339 [mailto:a13339@motorola.com] 
Sent: Friday, December 19, 2003 8:36 AM
To: Tomcat Users List
Subject: A weird issue


Hello All,

Now my software platform as below:

Windows 2000
JDK1.4.1_02
Tomcat 4.1.24
Sql Server 2000

I have a piece of code as below:

	private String jdbcDriverClass="sun.jdbc.odbc.JdbcOdbcDriver";
  	private String jdbcURL="jdbc:odbc:cfdata";
  	private String jdbcUserName="sss";
  	private String jdbcPassword="sss";
	try {
		Class.forName(jdbcDriverClass);
   		con=DriverManager.getConnection(jdbcURL, jdbcUserName,
jdbcPassword);
		stmt=con.createStatement();
	} catch (SQLException se) {
      		throw new RuntimeException("A database error occured. "
+ se.getMessage());
	
	try{
		String sqls="select CID from CF_GDW_Load";
		rs=stmt.executeQuery(sqls);
	}

This piece of code is run in tomcat. It will extract data from table in
Sql Server 2000. In Sql Server 2000, the table is named as CF_GDW_LOAD,
but in the code I write it as CF_GDW_Load. I know that itis not case
sensitive in Sql Server, but when I run this piece code in Tomcat, an
exception occurs. it says that [Microsoft][ODBC SQL Server Driver][SQL
Server]Invalid object name 'CF_GDW_Load'. If I change CF_GDW_Load to
CF_GDW_LOAD in the code, no exception occurs. So in here it is case
sensitive. But making me surprised is that on the same software
platform, I run another piece of code in Tomcat, it extract data from a
table in another database in Sql Server 2000, it is not case sensitive.
Do you have any idea about the weird issue? Thanks.

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