Error Java .sql.sqlexception
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up SQL statement is not executed! java.sql.SQLException: General error up vote 1 down vote favorite So, my piece of code is giving "SQL statement is not executed! java.sql.SQLException: General error" .Probably it is due to this line-"ResultSet rs = st.executeQuery(sqlq);" in my code. What could be the possible reason to it and how can it be corrected ? please help ! //package searchbook; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.sql.*; import java.util.*; public class SearchBook extends HttpServlet { public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,IOException{ response.setContentType("text/html"); HttpSession session = request.getSession(true); List booklist=new ArrayList(); Connection con = null; String url = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=" + "C:\\users\\ppreeti\\executive_db.accdb"; String driver = "sun.jdbc.odbc.JdbcOdbcDriver"; String user = ""; String pass = ""; String category=""; category=request.getParameter("input"); String sqlqueary="select Index1.link_id " + "FROM Index1 " + " WHERE Index1.index_name LIKE '%"+category+"%' "; String sqlResult = null; try { Class.forName(driver); con = DriverManager.getConnection(url, user, pass); try{ Statement st = con.createStatement(); System.out.println("Connection created 1"); ResultSet rs = st.executeQuery(sqlqueary); while (rs.next()) { sqlResult = rs.getString(1); } System.out.println("Result retreived 1"); //System.out.println('"sqlqueary"'); } catch (SQLException s) { System.out.println("SQL statement is not executed! "+ s); } } catch (Exception e){ e.printStackTrace(); } System.out.println("************"); //String sqlq=""; if(sqlResult.equals("1")) { String sqlq="select Section.Section_Name , Report.Report_Name , Report.Link, Contact.Contact_Name, Metrics.Metric_Name " + "FROM Section , Report , Contact,Metrics " + "WHERE Report.Contact_ID=Contact.Contact_ID and Report.Section_ID=Section.Section_ID " + "and Report.Report_ID IN (SELECT Metrics.Report_ID FROM Metrics WHERE Metrics.Metric_Name = Report.Report_ID') and Metrics.Metri
This Site Careers Other all forums Forum: JDBC and Relational Databases java.sql.SQLException: General error yogi maheshnath http://stackoverflow.com/questions/22527908/sql-statement-is-not-executed-java-sql-sqlexception-general-error Ranch Hand Posts: 30 posted 8 years ago Hi, <% String email=request.getParameter("email"); String name=request.getParameter("ename"); String userName=request.getParameter("name"); String password=request.getParameter("pwd"); String phoneNo=request.getParameter("Phno"); String mobileNo=request.getParameter("Mobno"); String location=request.getParameter("Location"); https://coderanch.com/t/306736/JDBC/databases/java-sql-SQLException-General-error String highQual=request.getParameter("Qual"); String major=request.getParameter("Major"); String keySkills=request.getParameter("skills"); String totalExp=request.getParameter("Experience"); String app_no="011"+userName; ResultSet rs=null; Connection con=null; Statement st=null; String strComment=""; String lg_name=""; String Query="INSERT into app_reg VALUES('"+app_no+"','"+name+"','"+userName+"','"+password+"','"+email+"','"+phoneNo+"','"+mobileNo+"','"+location+"','"+highQual+"','"+major+"','"+totalExp+"','"+keySkills+"')"; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:Recruit"); st=con.createStatement(); st.executeQuery(Query); } catch(Exception e) { out.println("Exception occured"+e.getMessage()); e.printStackTrace(); } %> General error is coming .what is general Error here.Please Explain. java.sql.SQLException: General error at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6987) at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115) at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(JdbcOdbc.java:3111) at sun.jdbc.odbc.JdbcOdbcStatement.execute(JdbcOdbcStatement.java:338) at sun.jdbc.odbc.JdbcOdbcStatement.executeQuery(JdbcOdbcStatement.java:253) at org.apache.jsp.RegMsg_jsp._jspService(RegMsg_jsp.java:102) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.jasper.se
net.java.ao.sql Exception executing SQL update
Sign in Pricing Blog Support Search GitHub This repository Watch 158 Star 1,347 Fork 901 brianfrankcooper/YCSB Code Issues 92 Pull requests 35 Projects 0 Wiki Pulse Graphs New issue Error in database operation: java.sql.SQLException: No suitable driver found #229 Closed rsaiprashanth opened this Issue Apr 25, 2015 · 4 comments Projects None yet Labels None yet Milestone No milestone Assignees No one assigned 2 participants rsaiprashanth commented Apr 25, 2015 Hello, I am using mysql-connector-java-5.1.35 to use MySql with JDBC. I have placed mysql-connector-java-5.1.35-bin.jar in the jdbc/src/main/java/com/yahoo/ycsb/db directory of YCSB. I have changed db.properties file under conf as jdbc.driver=com.mysql.jdbc.Driver db.url=jdbc:mysql://localhost:3306/dbname db.user=root db.passwd= I have also placed mysql-connector-java-5.1.35-bin.jar in the CLASSPATH I have run the below command and I have Driver not found Error. Can anyone help me Command line: -db com.yahoo.ycsb.db.JdbcDBClient -threads 2 -p recordcount=500000 -P workloads/workloada -s -load Loading workload... Starting test. Adding shard node URL: Adding shard node URL: Error in database operation: java.sql.SQLException: No suitable driver found for com.yahoo.ycsb.DBException: java.sql.SQLException: No suitable driver found for at com.yahoo.ycsb.db.JdbcDBClient.init(JdbcDBClient.java:221) at com.yahoo.ycsb.DBWrapper.init(DBWrapper.java:63) at com.yahoo.ycsb.ClientThread.run(Client.java:197) Caused by: java.sql.SQLException: No suitable driver found for at java.sql.DriverManager.getConnection(DriverManager.java:596) at java.sql.DriverManager.getConnection(DriverManager.java:215) at com.yahoo.ycsb.db.JdbcDBClient.init(JdbcDBClient.java:201) ... 2 more com.yahoo.ycsb.DBException: java.sql.SQLException: No suitable driver found for at com.yahoo.ycsb.db.JdbcDBClient.init(JdbcDBClient.java:221) at com.yahoo.ycsb.DBWrapper.init(DBWrapper.java:63) at com.yahoo.ycsb.ClientThread.run(Client.java:197) Caused by: java.sql.SQLException: No suitable driver f