java


connect MYSQL with netbeans 7.4


Iam new on using NetBeans 7.4 , i want to connect my java application to MYSQL , the application is desktop application .
i have already install MYSQL workbench 5.2 and create database with one table .
from NetBeans services on Databases i register MYSQL server , i enter these values :
localhost : 127.0.0.1 , user : root and password : root.
NetBeans ask me to set MYSQL command Path (Path to start command) i insert this path :
C:\Program Files\MySQL\Connector ODBC 5.1\myodbc-installer.exe
from main class in java i saw from net how to set connection :
Connection conn = null;
try {
conn = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/sameer", "root","root");
System.out.println("Connected database successfully...");
} catch (Exception e) {
System.out.println(e);
}
but all time the exception will execute :
java.sql.SQLException: No suitable driver found for jdbc:mysql://127.0.0.1:3306/sameer
You need to include the mysql connector jar in your project.
If you haven't downloaded it yet you can find it here http://dev.mysql.com/downloads/connector/j/
Once you have downloaded it:
right click on the project
select Properties
select Libraries -> Add JAR/Folder
navigate your file system to select the jar you previously downloaded
save and it will run correctly

Related Links

How to schedule Callable within itself in Executor
Java: how to access a variable which was declared inside a switch statement
Neo4j Lucene index - perform fuzzy search with wildcards
Look & Feel troubles on Ubuntu
openshift mysql connection NumberFormatException with Tomcat 7 (JBoss EWS 2.0)
Class won't calculate what it should, also: sorting arrays of objects?
Stencil Buffer Not Working on Opengl 4.4 / LWJGL
Console pane in JavaFX
Threadsafe within a thread?
Java compiling error in NetBeans
Flexible log parser library in Java [closed]
Koblitz method in Java
instanceof doesn't seem to work - what's wrong with my code?
java.lang.IllegalArgumentException: 'dataSource' or 'jdbcTemplate' is required when starting tomcat
constructors in abstract methods and extends methods [closed]
Collections subtle differences in Java

Categories

HOME
mockito
plot
react-virtualized
session
adb
rsync
rdf
disassembler
azure-media-services
fancybox-3
modx-revolution
phaser
uitypeeditor
normalizr
crystal-reports-2008
viewport
swingx
kryo
riot.js
clickonce
tar
ehcache
php-openssl
hammerspoon
blazemeter
dxf
java-7
django-storage
strncpy
bosh
galsim
preg-match-all
column-family
pim
framemaker
google-api-nodejs-client
bitbucket-pipelines
swift3.0.2
gesture
unspecified
jna
grid.mvc
core-plot
midl
unixodbc
checkboxlist
jsch
komodoedit
jquery-nestable
git-diff
mplayer
recursive-datastructures
linode
mcafee
google-cdn
objective-c-swift-bridge
httplistener
android-textview
multi-level
py2app
paypal-express
multiple-regression
ipconfig
browser-link
uid
xna-4.0
intellij-14
mutation-observers
simple-framework
rgeo
remobjects
skos
operator-precedence
network-interface
winddk
mdt
fluentautomation
.aspxauth
buster.js
sabredav
selected
simba
parametric-equations
mod-auth
hamachi
xfbml
lpeg
visitor-statistic
w3wp.exe
cxxtest
asp.net-mvc-areas
modelstate
routedevent
virtual-functions
boost-smart-ptr
thread-local-storage
ubuntu-9.04
rtml

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile