• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

com.mysql.jdbc.exceptions.MySQLSyntaxErrorException

 
Greenhorn
Posts: 2
Netbeans IDE Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is Exception>>>>>>>>>

Apr 29, 2011 3:38:16 AM org.apache.catalina.core.StandardContext reload
INFO: Reloading this Context has started
Apr 29, 2011 3:38:21 AM org.apache.catalina.core.StandardContext reload
INFO: Reloading this Context has started
A4002
The user enterd password is A4002XYZ
Original password is A4002XYZ
user name is Sandeep Kumar Soni
Designation of employee is Junior Software Engineer
Area is Product Support
DeptSupport - REALServicing
mobile no. 9611604761
admin roles is working:Sandeep Kumar Soni
The user enterd password is A4002XYZ
Original password is A4002XYZ
Cannot connect to database server it reached connection pool limit
over
the status of connection is :::::::::com.mysql.jdbc.Connection@389922
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: User 'root' has exceeded the 'max_questions' resource (current value: 100)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3277)
at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1402)
at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1317)
at classes.ccb_bean.add(ccb_bean.java:135)
at org.apache.jsp.ccb_005fOne_jsp._jspService(ccb_005fOne_jsp.java:122)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
-------------------------------------------------------------------------------

Here are my ConnectionPoo. java file

package classes;


import java.sql.*;
import java.util.*;

public class ConnectionPool
{
static final int MAX_CONNECTIONS = 500;
static Vector connections = null;

static ConnectionPool instance = null;

public synchronized void removeAllConnections()
{
try{
if(connections == null)
return;
int sz = connections.size();
for(int i=0; i<sz; i++)
{
Connection c = (Connection)connections.elementAt(i);
c.close();
}
connections.removeAllElements();
connections = null;
}catch(SQLException sqlE){System.out.println(sqlE);}
}

public static synchronized ConnectionPool getInstance()
{
if(instance == null)
instance = new ConnectionPool();
return instance;
}

public synchronized void initialize()
{
if(connections == null)
{
try
{
String userName = "root";
String password = "root";
String url = "jdbc:mysql://172.18.41.55/ccb";
Class.forName ("com.mysql.jdbc.Driver").newInstance ();

connections = new Vector();
int count = 0;
while(count < MAX_CONNECTIONS)
{

//Connection c= Class.forName("com.mysql.jdbc.Driver").newInstance();

Connection c = DriverManager.getConnection (url, userName, password);
connections.addElement(c);
count++;
}

}catch (Exception e)
{
System.err.println ("Cannot connect to database server it reached connection pool limit");
}

System.out.println("over");
}
}

public synchronized Connection getConnection()
{
Connection c = null;
if(connections == null)
return null;
if(connections.size() > 0)
{
c = (Connection)connections.elementAt(0);
connections.removeElementAt(0);
}
return c;
}

public synchronized void putConnection(Connection c)
{
connections.addElement(c);
notifyAll();
}
}
______________________________________________________>>>>>>>>>>>>>>>>>

Here are my ccb_bean file where i am using Connection Pool.............>>>>>>>>

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package classes;

import java.util.*;
import java.sql.*;


/**
*
* @author sonisan
*/
public class ccb_bean {

ConnectionPool c;
int Sno;
String ccb_no;
String ccb_desc;
String file_dt;
String release_dt;
String comnts;

String userName="root";
String password="root";
String url="jdbc:mysql://172.18.41.55/ccb";
Connection connection;

public ccb_bean() {

ccb_no= new String();
ccb_desc=new String();
file_dt=new String();
release_dt= new String();
comnts=new String();



}

public ccb_bean(int Sno, String ccb_no, String ccb_desc, String file_dt, String release_dt, String comnts) {
this.Sno = Sno;
this.ccb_no = ccb_no;
this.ccb_desc = ccb_desc;
this.file_dt = file_dt;
this.release_dt = release_dt;
this.comnts = comnts;
}

public int getSno() {
return Sno;
}

public void setSno(int Sno) {
this.Sno = Sno;
}

public String getCcb_no() {
return ccb_no;
}

public void setCcb_no(String ccb_no) {
this.ccb_no = ccb_no;
}

public String getCcb_desc() {
return ccb_desc;
}

public void setCcb_desc(String ccb_desc) {
this.ccb_desc = ccb_desc;
}

public String getFile_dt() {
return file_dt;
}

public void setFile_dt(String file_dt) {
this.file_dt = file_dt;
}

public String getRelease_dt() {
return release_dt;
}

public void setRelease_dt(String release_dt) {
this.release_dt = release_dt;
}

public String getComnts() {
return comnts;
}

public void setComnts(String comnts) {
this.comnts = comnts;
}

public int add(){

int result=0;

try{




Connection conn=null;
if(c==null)
{
c=ConnectionPool.getInstance();
c.initialize();
}
conn=c.getConnection();

System.out.println("the status of connection is :::::::::"+conn);

Statement stmt=null;
stmt= conn.createStatement();





/* Class.forName("com.mysql.jdbc.Driver").newInstance();
connection= DriverManager.getConnection(url,userName,password);
System.out.println("ccb no: "+getCcb_no());
Statement stmt = connection.createStatement();

*/

String sql="Insert into ccb.ccb_tracker values (" + getSno()+",'"+ getCcb_no()+"','"+ getCcb_desc()+"','"+ getFile_dt()+"','"+ getRelease_dt()+"','"+ getComnts()+"')";

result=stmt.executeUpdate(sql);

System.out.println("the query is ::::::::::::::::::"+sql);
c.putConnection(conn);
//connection.close();
if(result==0)
return 1;

}

catch(Exception e){

e.printStackTrace();
}

return result;

}

public Vector Search(String ccb_n){

Vector rows3=new Vector();

try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
connection= DriverManager.getConnection(url,userName,password);
System.out.println("ccb no: "+getCcb_no());
Statement stmt = connection.createStatement();
String sql="select * from ccb.ccb_tracker where ccb_no like ('%"+ccb_n+"%')";

ResultSet rs=stmt.executeQuery(sql);
if (rs==null){
rows3.add("No Records found");
}
else
while (rs.next()){
Vector rows=new Vector();

rows.addElement(rs.getInt(1));
rows.addElement(rs.getString(2));
rows.addElement(rs.getString(3));
rows.addElement(rs.getString(4));
rows.addElement(rs.getString(5));
rows.addElement(rs.getString(6));

rows3.add(rows);
}


}

catch(Exception e){

e.printStackTrace();
}

return rows3;

}

public Vector getAllRecords(){

Vector rows2=new Vector();



try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
connection= DriverManager.getConnection(url,userName,password);
Statement stmt = connection.createStatement();
String sql="select * from ccb.ccb_tracker";
ResultSet rs=stmt.executeQuery(sql);

while (rs.next()){
Vector rows=new Vector();

rows.addElement(rs.getInt(1));
rows.addElement(rs.getString(2));
rows.addElement(rs.getString(3));
rows.addElement(rs.getString(4));
rows.addElement(rs.getString(5));
rows.addElement(rs.getString(6));
rows2.add(rows);
}




}


catch(Exception e){

e.printStackTrace();
}
return rows2;

}


public static void main(String args[]){
ccb_bean cb= new ccb_bean();

System.out.println(" CCB no is ::::::::::"+cb.getCcb_no());
}


}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


Please help me
 
My first bit of advice is that if you are going to be a mime, you shouldn't talk. Even the tiny ad is nodding:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic