Eclipse and MySQL -


how link eclipse , mysql? have added mysql-connector-java-5.1.38-bin.jar via project>(right-click)>properties>java build path>libraries.

however each time run application, still getting caused by: java.lang.classnotfoundexception: com.mysql.jdbc.driver error. hope can advise. thank you.

when add mysql-connector jar, available class compilations of project code. drivers loaded using reflection, i.e. through class.forname("driver_class_name_here"). happens during run-time , compiler need not bother class name being provided.

usually web-applications packaged war archives , deployed web-containers or servers. when server executes on these archives, expects referred class in classpath. classpath includes many locations , 1 among them web-inf\lib folder of archive.

when build web-archive through eclipse or using build tools ant or maven, need specify included inside archive. on eclipse, through deployment assembly tab on project properties.

for web-project following structure:

enter image description here

we add specific library archive through deployment assembly > add > java build path entries > next, select libraries , finish. specify mysql connector included archive as:

enter image description here


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -