Results 1 to 1 of 1
Thread: Problem regarding the DBRoutines
- 01-17-2009, 10:24 PM #1
Member
- Join Date
- Jan 2009
- Posts
- 1
- Rep Power
- 0
Problem regarding the DBRoutines
I have imported the DB.DBRoutine, but the netbeans still doesnt recognize it.
The following code:
import org.jdesktop.application.Action;
import org.jdesktop.application.ResourceMap;
import org.jdesktop.application.SingleFrameApplication;
import org.jdesktop.application.FrameView;
import org.jdesktop.application.TaskMonitor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.Timer;
import javax.swing.Icon;
import javax.swing.JDialog;
import javax.swing.JFrame;
import com.mysql.jdbc.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import DB.DBRoutines;
import com.*;
/*
* The application's main frame.
*/
public class JavaAssignment3View extends FrameView {
DBRoutines db = new DBRoutines("localhost", "3306", "root", "", "Project");
//the instance can't find symbol class: DBRoutines
//can't find symbol class: constructor DBRoutines(.....);
public JavaAssignment3View(SingleFrameApplication app) {
initComponents();
mainPanel.setVisible(false);
if (db.connect()){
// an error here since the db is not recognized
try {
PreparedStatement ps = db.com.PrepareStatement("SELECT id from students;");
ResultSet idResult = ps.executeQuery();
while (idResult.next())
{
cmbStudId.addItem(idResult.getInt("id"));
}
}
catch (SQLException sqle)
{
}
}
}


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks