Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search Coderanch
Advance search
Google search
Register / Login
ramesh suresh
Greenhorn
+ Follow
1
Posts
1
Threads
0
Cows
since Jul 11, 2016
Merit badge:
grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
Ranch Hand Scavenger Hunt
Number Posts (1/100)
Number Threads Started (1/100)
Number Cows Received (0/5)
Number Likes Received (0/10)
Number Likes Granted (0/20)
Set bumper stickers in profile (0/3)
Report a post to the moderators (0/1)
Edit a wiki page (0/1)
Create a post with an image (0/2)
Greenhorn Scavenger Hunt
First Post
Number Posts (1/10)
Number Threads Started (1/10)
Number Likes Received (0/3)
Number Likes Granted (0/3)
Set bumper stickers in profile (0/1)
Set signature in profile
Search for a post/thread (0/3)
Set a watch on a thread
Save thread as a bookmark
Create a post with an image (0/1)
Recent posts by ramesh suresh
error in executing mysql statement
public void actionPerformed(ActionEvent e) { String number = t.getText(); String accNo= ""+accountNumber; try{ Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/bank?useSSL=false","root", "mysql"); Statement st = con.createStatement(); ResultSet rs = st.executeQuery("select * from transaction where acc_number = '"+accNo+"' order by entryDate desc limit '"+number+"' "); while(rs.next()){ System.out.println("Account : "+rs.getString(1)+", " +rs.getString(2)+", "+rs.getString(3)+", "+ rs.getString(4)+"\t\t"+rs.getString(5)); } con.close(); }catch(Exception ec){ System.out.println(ec.getMessage()); }
error is :
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''4'' at line 1
\\i entered 4 in text box...
thanks in advance
show more
7 years ago
Java in General