Hello, this are my imports:
import java.util.ArrayList; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import com.mysql.jdbc.Connection; import com.mysql.jdbc.Driver; import com.mysql.jdbc.Statement; and i have made sure i have this jar "mysql-connector-java-5.1.6-bin.jar" to my buid path... but the problem goes on... On Tue, May 20, 2008 at 3:48 AM, Michael Mehrle <[EMAIL PROTECTED]> wrote: > You need to download the MYSQL JDBC driver and put it in your classpath. > That'll fix it. > > The code is trying to load the JDBC driver 'by name' - since it's not > there it can't find it. > > Michael > > -----Original Message----- > From: Mihai Bogdan Eugen [mailto:[EMAIL PROTECTED] > Sent: Monday, May 19, 2008 5:46 PM > To: [email protected] > Subject: Problem with Wicket and MySQL > > > Hello, > > First of all, I am kind of new with this Wicket, actually, I am using > it for only a couple of days. > Secondly, I don't even know if I post this in the right place, so I > appologize if I had made such a mistake. > > Now, the problem that made write this post: > > I am working on a small JAVA + MySQL project, and by chance, when > browsing through Apache Software, I have discovered Wicket. I kind of > got the feeling with it thanks to the tutorials, but now I try to > integrate something related to MySQL in it: > > I have a class Catalog, : > > public class Catalog > { > private ArrayList<Product> products; > > public Catalog() > { > this.products = new ArrayList<Product>(); > this.populateCatalog(); > } > private void populateCatalog() > { > Connection connection = null; > Statement statement = null; > ResultSet result_set = null; > > String url = "jdbc:mysql://localhost:3306/proiect"; > String user = "root"; > String password = ""; > > try > { > Class.forName("com.mysql.jdbc.Driver"); > > connection = (Connection) > DriverManager.getConnection(url, > user, password); > statement = (Statement) > connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, > ResultSet.CONCUR_READ_ONLY); > result_set = statement.executeQuery("SELECT * from > produse > ORDER BY id_produs"); > > while(result_set.next()) > { > this.products.add(new Product( > result_set.getInt("id_produs"), result_set.getString("nume_poza") )); > } > > releaseResources(connection, statement, result_set); > } > catch (SQLException exception) > { > System.out.println("Eroare > =>"+exception.getLocalizedMessage()); > } > catch (ClassNotFoundException exception) > { > exception.printStackTrace(); > } > } > > private static void releaseResources(Connection connection, > Statement > statement, ResultSet result_set) throws SQLException > { > result_set.close(); > statement.close(); > connection.close(); > > } > } > > When I "run" the site, i get an error at line > "Class.forName("com.mysql.jdbc.Driver");" from the file up above. I > don;t know how to copy-paste the output on the Tomcat Servlet Engine > (oh, yes, I am running it on Tomcat), it is embedded into a JAVA > window... Anywya, the next line in the stack trace, besides > ClassNotFoundException: com.mysql.jdbc.Driver > is "at > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader > .java); > > Any help it is highly apreciated, and thanks for your understanding. > -- > View this message in context: > http://www.nabble.com/Problem-with-Wicket-and-MySQL-tp17331074p17331074. > html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Mihai Bogdan Eugen --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
