• 0

java DB connection?


Question

hi im trying to make a connection from java program to a mysql database .... how would I do this.... there are a few methods which i have brought up but im not sure which would be the best ?

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0
use spring JDBC. there are many tutorials out there and it's easy to use here's the official documentation http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/jdbc.html

could you give me a simply walk through on install this on linux xD ? I am doing as it says but when i tried to compile it gave me seval thousand errors all to do with the new package?

Link to comment
Share on other sites

  • 0

could you give me a simply walk through on install this on linux xD ? I am doing as it says but when i tried to compile it gave me seval thousand errors all to do with the new package?

You may want to look into using maven when having to pull in libraries like Spring with multiple dependencies. Here's the dependencies though (in the "This artifact depends on ..." section): http://mvnrepository.com/artifact/org.springframework/spring-jdbc/3.1.2.RELEASE

Even simpler if you don't want to pull in spring to your project is just get the connector/j jar and use Java's built-in JDBC stuff. Spring's straight JDBC stuff doesn't buy you a whole lot except providing some mapping stuff to turn a ResultSet into an object saving you some boilerplate code.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.