Hi,
I have developed the attached JAVA programs (*.java) and encountered compilation error (*.txt), it would be very much appreciated if you can help.
Thanks,
Victor
Hi,
I have developed the attached JAVA programs (*.java) and encountered compilation error (*.txt), it would be very much appreciated if you can help.
Thanks,
Victor
C:\MARKSIX_new>javac readFileSelect.java
C:\MARKSIX_new>javac Mk649.java
Mk649.java:28: cannot resolve symbol
symbol : method readFileSelect (java.lang.String,java.lang.String)
location: class Mk649
mk6DataSelect = readFileSelect(args[0], args[1]);
^
1 error
C:\MARKSIX_new>
import java.sql.Connection;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.DriverManager;
import java.io.*;
import java.util.*;
import java.lang.*;
//import java.util.Date;
public class Mk649 {
static void dispRec(String a[]) {
for(int i=0; i<a.length; i++) System.out.println(a[i]);
System.out.println();
}
//////////////////
// Main Program //
//////////////////
public static void main(String args[]) throws Exception {
String[] mk6DataSelect;
mk6DataSelect = readFileSelect(args[0], args[1]);
// String[] mk6DataAll;
// mk6DataAll = readFileAll();
dispRec(mk6DataSelect);
// dispRec(mk6DataAll);
}
}
import java.sql.Connection;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.DriverManager;
import java.io.*;
import java.util.*;
//import java.util.Date;
public class readFileSelect {
static String[] readSelect(String a, String b) throws Exception {
Class.forName("com.mysql.jdbc.Driver");
String url = "jdbc:mysql://localhost:3306/MARKSIX";
Connection con = DriverManager.getConnection(url);
Statement stmt = con.createStatement();
int start = Integer.parseInt(a);
int end = Integer.parseInt(b);
String selectSQL = "select * from mk6_history49 " +
"where lottery >= " + a + " " +
"and lottery <= " + b + " " +
"order by lottery";
ResultSet res = stmt.executeQuery(selectSQL);
int row_count = 0;
while(res.next()) {
row_count = row_count + 1;
}
String mk6HistorySelect[] = new String[row_count];
for(int i = 0; i < row_count; i++) {
mk6HistorySelect[i] = "";
}
ResultSet res1 = stmt.executeQuery(selectSQL);
row_count = 0;
while(res1.next()) {
for(int i = 1;i <= res1.getMetaData().getColumnCount();i++) {
mk6HistorySelect[row_count] = mk6HistorySelect[row_count] + res1.getString(i) + " ";
}
row_count = row_count + 1;
}
res.close();
res1.close();
stmt.close();
con.close();
return mk6HistorySelect;
}
}
Don't expect people to open attachments.
Rather post the relevant sections of your code and the errors you get using the code and quote tags and explain why you can't make sense of those errors (in my experience they're usually a great help to figure out what you did wrong).
Hi everyone,
Post specific errors that you are getting plus snippets of your code where you think this error is occuring and explain what you are trying to do.
Richard West
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.