RE: Problem with "load data infile..." on 3.23.52 for Windows 2000

RE: Problem with "load data infile..." on 3.23.52 for Windows 2000

am 23.04.2003 19:15:31 von Franklin Phan

The Microsoft Windows version is 2000.

-----Original Message-----
From: Franklin Phan [mailto:franklin.phan@mindspring.com]
Sent: Wednesday, April 23, 2003 10:12 AM
To: 'bugs@lists.mysql.com'
Subject: Problem with "load data infile..." on 3.23.52 for Windows

Version: 3.23.52 for Windows

I've found that query results via Java programs are missing the first column
in cases where the data has been put into the table using "load data infile
'xxx.txt' into table xxx;" in Windows command prompt, but this problem does
not appear in cases where data was manually input row-by-row using MySQLCC.
Why is that?

My data file consists of 4 columns and 3 rows and is tab-delimited. The
columns are: PID, LAST, MIDDLE, and FIRST; PID is unique number key, and the
others are varchar.

My Java code is:

import java.sql.*;

public class Connect {

public static void main(String[] args) {
String pid;
String last;
String middle, first;

try {
Class.forName("com.mysql.jdbc.Driver");
} catch (LinkageError e_linkage) {
System.out.println(e_linkage);
} catch (ClassNotFoundException e_classNotFound) {
System.out.println(e_classNotFound);
}

try {
Connection conn =
DriverManager.getConnection("jdbc:mysql://pc1:3306/schedule? user=root");
PreparedStatement ps = conn.prepareStatement("select pid, last,
middle, first from junk2");
ResultSet rs = ps.executeQuery();
while (rs.next()) {
pid = rs.getString(1);
last = rs.getString(2);
middle = rs.getString(3);
first = rs.getString(4);
System.out.println(pid + " " + last + " " + middle + "
" + first + " ");
}
rs.close();
} catch (SQLException e_sql) {
System.out.println (e_sql);
}
}
}

In execution, the PID column does not appear in the resulting query unless
the following line is used instead:
System.out.println(" " + pid + " " + last + " " + middle + " " +
first + " "); //Notice the 3 blanks I must insert in the very front.



--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org