hi,
i have this wholesaler deployment that im doing.In the beanservice i connect to the database and store the order there.But everytime i get this exception:No suitable driver found.The database access in the other files work perfectly except beanservice.
This is my code:
public class ProjectBeanService1
{
public
String processProject1(Order order) throws Exception
{
String insertQuery = new String();
ResultSet rsb = null;
Statement stmtb = null;
Connection conb=null;
Connect ctb = new Connect();
try
{
conb= ctb.getConnection();
}
catch(Exception e)
{
System.out.println("connection exception");
}
try
{
insertQuery = "insert into samsung values('";
insertQuery = insertQuery + order.getItemName() + "',";
insertQuery = insertQuery+ order.getQuantity()+")";
System.out.println("insertquery" +insertQuery);
stmtb = conb.createStatement();
stmtb.executeUpdate(insertQuery);
System.out.println("Inserted");
}
catch(Exception e)
{
System.out.println("Sorry !!! Unable to insert");
System.out.println(e.getMessage());
}
int bool=0;
int repint=0;
String rep=new String();
String sep = System.getProperty("line.separator");
String response = "\n\nHi, " + "!" + sep;
String dealerName = new String();
int quant = 0;
response += sep + "From Samsung wholesaler" + sep+"\t\t******";
response += sep +" : We are processing your order of "+order.getQuantity();
response += " items of " + order.getItemName();
System.out.println("beanservice1 : "+response);
System.out.println("service 111 : "+response);
stmtb.close();
rsb.close();
return response;
}
}
Is there something im supposed to do if i have to access the database here?