This week's book giveaway is in the OCP forum.
We're giving away four copies of OCP Java SE 8 Programmer II Exam Study Guide and have Kathy Sierra, Bert Bates, & Elizabeth Robson on-line!
See this thread for details.
Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!

Maximilian Xavier Stocker

Ranch Hand
+ Follow
since Sep 20, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Maximilian Xavier Stocker

Classpath variables are evil and as you can see have done you no good whatsoever.

The bottom line is that your runtime does not have the oracle libraries in it's classpath. You haven't identified how you are running this code.
But again there will be no shortcuts and if performance is an issue then I would suggest choosing a better (non-toy) database than MySQL. MySQL is a good example of you get what you pay for.
It will take the time it takes. Even the utility I listed does the same thing I suggested so there is no other way then creating CREATE TABLE and INSERT statements and executing them to restore.

You cannot just copy the files. This is a bad idea unless you are prepared to stop the database. Because otherwise you won't know if the files are in a cohesive state. Actually it's a bad idea anyway because the table files could be corrupted and then you'd just be backing up a corrupted file.

Best way is to create the insert statements. You can write this yourself or use the tools provided. You can always execute other programs through Runtime.exec
Why do you want to do this? Is this a school project? Because there lots of tools already for this type of thing.

The best way to backup and restore a MySQL database would be the following.

1) Make your program that can run SQL script files (files full of SQL statements).

To backup

2) Dump the table definitions (as CREATE TABLE statements) and data (INSERT statements) into files.

3) Possibly zip resultant SQL files.

To restore

4) Possibly unzip SQL files.

5) execute SQL file
I think a good next step would be to actually create some variables to hold the suit and value for each instance. The class variables you would initialize in your constructor.

It might be even a better idea to consider first what functionality this Card class will have. What information will it hold? What will it do? Once you have answered those questions then you'll know what your variables will be. Then easy as one two three you can code your constructor.
12 years ago
Yes.



Here are a couple of links for SQL state codes.

http://developer.mimer.se/documentation/Mimer_SQL_Reference_Manual/App_return_status2.html#1110406

http://dev.mysql.com/doc/refman/5.1/en/error-messages-server.html

As far as I know you have to pay money for the actual spec. Hence the links to various vendor implementations.

[comment on edit of edit: Well that was an unexpected "feature" ]
[ May 01, 2006: Message edited by: Maximilian Xavier Stocker ]
Are you trying to roll your own connection pool? Why would you desire to do this when there are so many out there already (and open source free ones as well) ?
Kind of depends how meaningful you mean by meaningful.

Generally the vendor code or better yet SQL state of the SQL exception will give you an idea of what generally happened. So you would be able to know for example that the query failed for a constraint/key violation and not because the connection dropped or something.

If that's enough for your needs you're rocking. If you need to know what constraint, what column, etc then it gets not so good.

My personal method for dealing with this is to use whatever error codes and map them to a properties file in a resource bundle. Then it's easy enough to plug in new messages as needs be.

Originally posted by raghu kolipakula:
As java technologies have many advantage over other technologies(atleast web technologies).

I wonder why javaranch choosen CGI for its development?



Because.

Porting over is a huge project.
12 years ago

Originally posted by Tiffny Yang:
Thanks for fixing the problem.

You're right, it only affected the SCJP forum. I had the problem on Sunday.
Now it's OK.

I'm using IE browser version 6.02.


Thanks.



If you want to turn this off permanently. I believe it is:

Tools -> Internet Options -> Advanced -> Browsing -> Disable script debugging (Check that box it's probably unchecked now)
12 years ago

Originally posted by Ernest Friedman-Hill:
Thanks for reporting this. I've fixed the problem. It only affected the SCJP forum.

Out of curiosity, what browser pops up an error dialog about this? Firefox just quietly ignores it.



Probably IE and depends on your configuration. I have this in my IE. For debugging purposes though it gets annoying... I think if you install Visual Studio this gets set up helpfully for you. Maybe interdev or something.
12 years ago

Originally posted by Mark Spritzler:
Max, I just finished reading the JDBC Driver thread. At least half of it. And I agree with Sun. The Specification, and many specs that are out there are a minimum set of requirements. What DD did, was go beyond that and include a special feature. Now if the user doesn't want that feature, then use a different driver. So DD did meet the minimum requirements for certification.



No they didn't. There are two important things in that thread and I admit it is hard to follow because of the heavy amounts of double speak and contracdictory statements but the two things of note are.

1) The compliance certification process is as follows. Vendors pay money for Sun. Sun gives vendor compliancy tests. Vendor runs test. Vendor reports success or failure on basis of tests and pronounces driver compliant (or not). Note that both the testing and the compliancy label are administered and applied by the vendor. Not Sun.

2) Extensions to a specification are fine BUT if you change a core component of how the driver works that is another issue. The bottom line is that DD altered the code for getting a usable connection for their driver.

This means one of the following:

- The driver is not compliant
- The vendor altered the tests to have the driver pass
- You are allowed to render many changes to driver codebases between passing the compliancy suite and shipping. (Even changes that would make the driver no longer pass the tests)

If it was as simple as an extension I wouldn't be complaining. But the driver cannot possibly pass the compliancy tests in it's current configuration because you need extra code to "unlock" the connection.
12 years ago

Originally posted by Mark Spritzler:
I got six, because this is a very old one, that I have seen over and over again for like at least 10 years. So I know to count the Fs in the OF(s)

Now, what do you read here

Paris in the
the Springtime

Mark



ParseException
12 years ago
You are trying to access columns of your result set that don't exist. That's what that error actually means.

I am not sure about your looping through the metadata part but this



Is certainly wrong. You only have one column in your result set.
Well you see...

The intializing of the DataSource depends on the DataSource
implementation. Hopefully though as in your case this is in just the one
place in the code. So it's not a huge hassle.

In some ways you could say "Isn't DriverManager getConnection more dynamic?
Because I can use URL with it".

Well yes in theory. But of course it didn't quite work out that smoothly. I
think while the original intent was that more or less you could just slap
in the correct protocol for your driver and bob's your uncle it's not
really that simple because the rest of the URL often needs modfification
depending on your database and driver.

At the end of the day the rest of JDBC you can get away with just
interfaces[1] configuring your DataSource or connection URL is the fugly
part that is not so generic.

But by using a DataSource like you are you are hiding the fugliness from
the rest of your app so that's good.

[1] - Oracle Blobs for example being an exception