About 53 results
Open links in new tab
  1. How to connect to database connection in Java - Stack Overflow

    Jan 26, 2014 · I would like to know how to connect to database in which is hosted in Xampp MySQL. This is what I have so far in my java code to connect but I'm unsure what I'm doing. …

  2. mysqlconnector.jar - porque no puedo importar a …

    May 7, 2024 · estoy creando un sistema de ventas pero al querer importar a java.sql.connection no me aparece y ya agregue la libreria

  3. Connect Java to a MySQL database - Stack Overflow

    Using a Singleton Pattern and/or a static variable for the DB Connection is a bad practice. See among others Is it safe to use a static java.sql.Connection instance in a multithreaded system? …

  4. Best way to open and return a database connection in a Java …

    Dec 28, 2015 · I have come up with the following utility class: import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class MySqlConnection { private …

  5. sql - Java JDBC connection status - Stack Overflow

    UPDATE Oh, I just saw there is a new method available since 1.6: java.sql.Connection.isValid(int timeoutSeconds): Returns true if the connection has not been closed and is still valid. The …

  6. Closing database connections in Java - Stack Overflow

    I am getting a little confused. I was reading the below from Java Database Connectivity: Connection conn = DriverManager.getConnection( "jdbc:somejdbcvendor:other data …

  7. Creating a java.sql.Connection using JDBC and Spring Boot

    Oct 17, 2018 · I wanted to create two static functions: java.sql.Connection Connection.getConnection() and void Connection.closeConection() to obtain and terminate …

  8. How to get database url from java.sql.Connection? - Stack Overflow

    Apr 19, 2011 · For given Connection instance how do I find out url that the Connection uses to connect the database ? Is it somewhere in Properties returned by Connection.getClientInfo() …

  9. java - How can I use one database connection object in whole ...

    13 This question already has answers here: Is it safe to use a static java.sql.Connection instance in a multithreaded system? (2 answers)

  10. mysql - how to fix error java.lang ... - Stack Overflow

    Mar 26, 2022 · Closed 3 years ago. how to fix error java.lang.NullPointerException: Cannot invoke "java.sql.Connection.createStatement ()" because "con" is null