List:Commits« Previous MessageNext Message »
From:mmatthews Date:December 20 2005 6:54pm
Subject:Connector/J commit: r4716 - branches/branch_5_0/connector-j/src/com/mysql/jdbc
View as plain text  
Modified:
   branches/branch_5_0/connector-j/src/com/mysql/jdbc/Field.java
Log:
Better diagnostics via .toString().

Modified: branches/branch_5_0/connector-j/src/com/mysql/jdbc/Field.java
===================================================================
--- branches/branch_5_0/connector-j/src/com/mysql/jdbc/Field.java	2005-12-20 18:54:35 UTC (rev 4715)
+++ branches/branch_5_0/connector-j/src/com/mysql/jdbc/Field.java	2005-12-20 18:54:40 UTC (rev 4716)
@@ -830,11 +830,28 @@
 	 */
 	public String toString() {
 		try {
-			return this.getDatabaseName()
-					+ " . " + this.getTableName() + "(" + this.getOriginalTableName() + ") . " + this.getName() + "(" + this.getOriginalName() + ")" + ", Mysql type: " + getMysqlType(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
+			StringBuffer asString = new StringBuffer();
+			asString.append(super.toString());
+			
+			asString.append("\n  catalog: ");
+			asString.append(this.getDatabaseName());
+					asString.append("\n  table name: ");
+					asString.append(this.getTableName());
+					asString.append("\n  original table name: ");
+					asString.append(this.getOriginalTableName());
+					asString.append("\n  column name: ");
+					asString.append(this.getName());
+					asString.append("\n  original column name: ");
+					asString.append(this.getOriginalName());
+					asString.append("\n  MySQL data type: ");
+					asString.append(getMysqlType());
+					asString.append("\n\nData as received from server:\n\n");
+					asString.append(StringUtils.dumpAsHex(this.buffer, this.buffer.length));
+					
+					return asString.toString();
 		} catch (SQLException sqlEx) {
 			return super.toString();
 		}
-
+	
 	}
 }

Thread
Connector/J commit: r4716 - branches/branch_5_0/connector-j/src/com/mysql/jdbcmmatthews20 Dec