Jan Cumps wrote:
(note to self: on the other hand, when your jdbc driver is not on the runtime classpath, would that not have gotten this error: ClassNotFoundException ? )
Yes. I thought from your original post that you were running it from JDeveloper.
Given that "C:\Documents and Settings\zanders\My Documents\Project Program\driver\mysql-connector-java-5.1.7\mysql-connector-java-5.1.7-bin.jar" is part of that, it looks to me like it's in the runpath as well. Am I interpreting that correctly?
Zachary Anderson wrote:Jan Cumps,
I am indeed running it from JDeveloper. The first line in the "log window" (same place I get the results of my dummyprint statements) looks to be the call that JDeveloper makes to javaw.
I have switched out the previous getConnection statement with
and am getting
SQLException: No suitable driver found for jdbc:mysql://hostcomputer.workplace.here:3306/database?user=id&password=password
Am absolutely sure of hostcomputer.workplace.here, have compared it with the (successful) login with SQLYog.
As a bit of a head-check ( ) after reading up on DriverManager, I decided to see what Drivers were actually in the list.
I tried the code at http://java.sun.com/j2se/1.4.2/docs/api/java/util/Enumeration.html , but it looks like they have a bit of a mistake; since e is instantiated inside the start condition, it's not recognized in the body of the loop. Although that might be a JDeveloper mistake.
gives me just
Does this mean I'm missing the driver I loaded, or is that a different name for it, or does the for-loop code miss the first item in the Enumeration?
Zachary Anderson wrote:Would anyone be willing to suggest how to test this code? I'm not really sure for what DriverManager is looking.
Running JDeveloper, have included mysql-connector-java-5.1.7-bin.jar in the "libraries and classpath" window.
SQLException: No suitable driver found for jdbc:mysql://host/database
The fact that I'm no longer getting a "Class strife" message gives me the impression that it has successfully found the Driver. I am able to connect to the database with SQLYog, so I think the database has no problems.
I'm planning on putting this on several computers, so putting it into .lib folders might be possible, but not ideal.
Remember to always leap before you look. But always take the time to smell the tiny ads:
Devious Experiments for a Truly Passive Greenhouse!https://www.kickstarter.com/projects/paulwheaton/greenhouse-1