Test DB driver + DB connection in your servlet

try { Class.forName("com.mysql.jdbc.Driver"); } catch (ClassNotFoundException e) { out.println("cant load database Driver"); return; } Connection conn=null; try { conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/quoting","root","1234"); } catch (SQLException e) { // TODO Auto-generated catch block out.println("cant connect to db"); return; } out.println("connected to database : done"); try { conn.close(); } catch (SQLException e) { }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.