pa help naman kung ano problema dito sa mga batak sa java dyan input ko nalang po yung file sana may makatulong hehe
Attachments
-
You do not have permission to view the full content of this post. Log in or register now.
here poHello! Sure, I'd be happy to help you with any issues you're facing with your Java code. Please provide the file you're working on, along with a detailed description of the problem you're encountering.
Based on the code snippet you provided, it seems like you're trying to establish a connection to a database using thehere po
ang nakita ko dyan yungConnection conn =.getConnection();pero di ko alam saan yung kulang
getConnection()
method. However, there seems to be an error or missing information in the code.import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class Main {
public static void main(String[] args) {
String url = "jdbc:mysql://localhost:3306/database_name";
String username = "your_username";
String password = "your_password";
try {
Connection conn = DriverManager.getConnection(url, username, password);
// Use the connection object to perform database operations
// ...
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
localhost:3306
with the appropriate host and port of your MySQL database. Replace database_name
with the actual name of your database. Also, update your_username
and your_password
with your database login credentials.