| |

VerySource

 Forgot password?
 Register
Search
Author: yiweilisa

Novice help: java can access the contents of the table when connected with jdbc in java, why is the result not displayed

[Copy link]

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-31 16:15:02
| Show all posts
The fourth type of pure java driver you use, the red part is not needed
Statement st = con.createStatement([color=#FF0000]ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE[/color]);
Besides, what is wrong with him holding you
Have you put the three jar files used to connect to the database in the lib directory?
Reply

Use magic Report

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-31 16:45:01
| Show all posts
You do not need to modify the table for this code, so it is better to remove the parameters and have a look!
(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-31 17:00:01
| Show all posts
Try to put your JDBC driver package in the lib under /WEB-INF of your released project
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-31 17:15:01
| Show all posts
[Quote=Quote from the reply oflarcomon the 2nd floor:]
Quoting the reply fromloveyanyanon the 1st floor:
ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE
This is wrong,
Change to ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY


It should be this problem!
[/Quote]

Same as above. . This sentence can be omitted.
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-31 17:30:01
| Show all posts
gosh. . . . Java connection to the database is not disconnected. . . . . Your connection is closed. . . How to get the data. . . .
I feel oh. . . Don't know if it's right. . . .
Reply

Use magic Report

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-31 17:45:01
| Show all posts
[Quote=Quote the reply ofshyshykyoon the 7th floor:]
gosh. . . . Java connection to the database is not disconnected. . . . . Your connection is closed. . . How to get the data. . . .
I feel oh. . . Don't know if it's right. . . .
[/Quote]
He took the data and then closed it!
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-31 18:00:01
| Show all posts
Statement st = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);

   The sentence in brackets can be omitted. ~

  out.print( "<TD> "+rs.getString(1)+" </TD> ");


    Also.. Didn't find your second <tr> tag.. So the webpage format will be wrong.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list