| |

VerySource

 Forgot password?
 Register
Search
View: 689|Reply: 2

Help on database connection! !! !!

[Copy link]

2

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-11 11:00:02
| Show all posts |Read mode
class Database {
    try {
        Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
        Connection con = DriverManager.getConnection ("jdbc: odbc: student", "sa", "");
    }
     catch (ClassNotFoundException e)
     {
         
     }

}
There was an error in the try line! !!
Excuse me, what should I do? I usually use try like this, but this time I don't know what went wrong!
Reply

Use magic Report

0

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-15 23:45:01
| Show all posts
The code is written in the method
Reply

Use magic Report

0

Threads

10

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 Invalid IP Address

Post time: 2020-1-17 08:36:01
| Show all posts
1. Agree upstairs
2, Connection con = DriverManager.getConnection ("jdbc: odbc: student", "sa", "");
URL and port where the database is not specified
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