PDA

View Full Version : Java/Eclipse/Hibernate/MySQL




Petar
11-27-2007, 09:38 PM
delete

slantedview
11-27-2007, 10:08 PM
the work done so far looks very good.

what's the problem with the mysql database? i'm assuming you created the database (emailblast) along with whatever tables the application is expecting, and that you've also setup the admin account according to match the admin account settings in the applicationContext.properties file.

john_anderson_ii
11-27-2007, 10:15 PM
I was able to get it running relatively easily.

Petar
11-27-2007, 11:49 PM
delete

Korey Kaczynski
11-28-2007, 12:04 AM
I'm sorry, I don't actually know how to create the database, or the tables, and I don't know how to setup the admin account to match what's in applicationContext.properties, though I am able to find that file in the eclipse project browser. Any tips?

use phpmyadmin

voytechs
11-28-2007, 12:12 AM
I have a programmer a Ron Paul supporter/Computer programmer in Texas who is building it, but when I load the most recent update from SVN I cant get it running. Could someone try opening it and telling me what they think? Also, the latest update involved switching from Derby database to MySQL, if that helps. Please keep in mind that the project is till in a preliminary form and needs some things changed/added before it becomes what I've designed. Thanks.

http://svn.sharesource.org/svn/campaign/

I'll give it a whirl in the morning and let you know. Have to get some sleep now.

slantedview
11-28-2007, 12:34 AM
I'm sorry, I don't actually know how to create the database, or the tables, and I don't know how to setup the admin account to match what's in applicationContext.properties, though I am able to find that file in the eclipse project browser. Any tips?
I haven't installed mysql in a while, but depending on how you installed it, you probably setup the admin account during installation, or at least setup a default password for the root/admin account?

Anyways, you'll need some sort of software in order to administer your database stuff. If you're running a webserver that supports PHP, you can install phpMyAdmin. Otherwise, just use dbtools:

http://www.dbtools.com.br/EN/downloads/downloads_file.php?file_id=11

Db tools is easy enough. Make sure your mysql server is running, create a connection using the admin/root account. Then you can create other accounts if needed, create your database and tables.

Ask your developer if he can send you a SQL file that you can run to create the tables for you.

Petar
11-28-2007, 01:00 AM
I did set up a root account/password for MySQL at a point, and there is a file within the project called "createdb.sql" my programmer had told me that I needed to run the command "source createdb.sql;" within that directory, but then I get the error:

-bash: create: command not found
-bash: grant: command not found

So I guess that I'll keep trying to run phpmyadmin or dbtools unless someone has another suggestion that I could try on the "createdb.sql" file. Also, here is what appears within that file, in case that helps you understand its nature:

create database if not exists emailblast;
grant all privileges on emailblast.* to admin@localhost identified by "letmein";

By the way, I also forgot to add that I am on OS X, in case that is important to know.

Thanks everyone.

Petar
11-28-2007, 01:12 AM
well, I ended up downloading MySQL administrator for OS X, and it wants a server hostname, a username, and a password, any tips?

Petar
11-28-2007, 01:24 AM
yay, "localhost" "root" and "mypassword" worked, now to accomplish the other stuf...

Petar
11-28-2007, 01:42 AM
Well, Ive reached an options page that looks like it should help out my quest. My brain is shutting down at moment though. If anyone has a tip please provide. Here's a screen shot:

http://img150.imageshack.us/img150/4275/optionsrq1.th.png (http://img150.imageshack.us/my.php?image=optionsrq1.png)

john_anderson_ii
11-28-2007, 02:39 AM
Well, Ive reached an options page that looks like it should help out my quest. My brain is shutting down at moment though. If anyone has a tip please provide. Here's a screen shot:

http://img150.imageshack.us/img150/4275/optionsrq1.th.png (http://img150.imageshack.us/my.php?image=optionsrq1.png)

Please don't take this as condescending, but I think you may be trying to wear too many hats in this endeavor. I don't often talk about flow issues with guys who aren't software engineers or management, so bear with me. You clearly have a vision you would like to see implemented rapidly. The vision you are trying to implement has a steep learning curve that requires prerequisite knowledge of many technologies. Steep learning curves and rapid implementation do not coexist peacefully.

I am by no means saying that you are too dumb or impaired to learn these technologies, I'm saying that your learning curve doesn't fit within your deployment schedule. The breadth of knowledge required takes time. Learning new technologies like Spring, Hibernate, and especially relational data models is fairly quick when you have an expansive base knowledge of core technologies. Learning from scratch takes time, study, and practical application all from the ground up. It's like jumping into Biochem without knowing how to balance equations, you are going to have to go back to the beginning at some point.

What you should do is forget about how this application is put together, how it works, and what it takes to make it work. Then focus on what it is supposed to do. On this forum alone you have a very deep well of talent that would likely be more than happy to support you if you opened up the entire project, and just asked . Draw from this talent and start recruiting. Those that already have the knowledge required don't have a learning curve, so time to market is reduced.

As the man with the vision, you should be looking at hosting solutions, cost effectiveness, bandwidth considerations, domain registration, etc. You shouldn't be fretting about how something works, or who's going to make it work. You should be looking for people to make it work, while ensuring that the very basics of hardware, bandwidth, and name resolution are secured.

For instance, you have been working over a MySQL access problem for a couple days. All the while, I've been here playing HellGate London. I'm a MySQL Certified developer and administrator who professionally manages design and deployment for a multi-million dollar enterprise. I also happen to be a J2EE developer. Professionally, I wouldn't hesitate to help you make this vision productive. I'm sure I'm not the only one on this very board. All the while a host, or home, for your project has not been found. When it's complete and functional it has no place to go.

Stop trying to do the tech stuff. PM me, drop your developer's email, and I'll be more than happy to come up with a deployment plan. Meanwhile work on a hosting solution. Hardware, bandwidth, and cost should be your worries right now. Web software does no good if it's not on the web.

P.S. The company that I work for owns CaveCreek WebHosting, so if you can secure hardware, I can host it and supply bandwidth free of charge until it gets out of control. (My employer doesn't give me a definition of what "out of control" means, so your guess is as good as mine. I just know that no employees server has ever been disconnected due to "out of controlness."

Petar
11-28-2007, 10:08 AM
You know, there was a point where I was trying to do the impossible on my own, and basically figure out how to program the webapp myself, but while scrambling to do so, I did end up finding an actual software engineer to build the site, so things are on track now. It's just that as of now, I'm trying to be able to open the project in Eclipse again, so that I can see exactly whats being done, so that I can manage it exactly. Hopefully once I get these MySQL configurations done, then I'll just be able to view the rest of the SVN updates without any further reconfiguring, I'm not sure. Right now, the only way that I can use another programmers help, is if they help me with completing my part of the process, so that I don't have to tax my main developers time any further. I tried adding an additional developer before, despite my main developers advice that it would complicate things, and when it quickly did, then I ended up having to apologize to everyone. Also, I'm holding up on the server rental until my developer gives the green light. So once more, if anyone has any tips for how I should perhaps configure that MySQL admin window, then that would be very helpful and much appreciated. Thank you very much, I'll be working on this later today.

Arklatex
11-28-2007, 10:16 AM
social engineer, I'm not familiar with MySQL but it sounds like you must set a server up, your local box can do it. What are you trying to do btw? I program mainframe SQL all the time.

Petar
11-28-2007, 10:27 AM
social engineer, I'm not familiar with MySQL but it sounds like you must set a server up, your local box can do it. What are you trying to do btw? I program mainframe SQL all the time.

Just want to open this project on my computer so that I can see the work being done, and coordinate closely with my developer, while we move towards launch. Sorry, I can't explain it very well, I guess if you follow the whole thread it's more clear.

Petar
11-28-2007, 11:44 AM
use phpmyadmin

Sorry Korey, I forgot to mention that I found phpMyAdim difficult to understand how to use...I ended up installing MySQL Administrator. Thanks for the tip anyways though. Could someone help me figure out what exactly I have to do with it now? Thanks.

Petar
11-28-2007, 12:04 PM
The applicationContext.properties file within the project contains the following information:

db.dialect=org.hibernate.dialect.MySQLDialect
db.driver=com.mysql.jdbc.Driver
db.prefix=jdbc:mysql://localhost
db.name=emailblast
db.userid=admin
db.passwd=letmein

I went into MySQL Adinistrator>Accounts and created the new account/password "admin/letmein"

I hope that was the right thing to do, and now I guess that I have to go about setting up the database "emailblast" I guess that I have to do this from the "directories" part of the options. Could someone maybe take a look at the image that I provided and tell me if I'm on the right track?

http://img150.imageshack.us/my.php?image=optionsrq1.png

Petar
11-28-2007, 12:27 PM
delete

Petar
11-28-2007, 12:46 PM
Is there another perhaps easier way for me to try to run this app, besides using Eclipse? I don't actually need to change anything in the project myself, I just need to see what is being built.

margomaps
11-28-2007, 01:46 PM
the project also contains a file called createdb.sql within it. The file contains the following information:

create database if not exists emailblast;
grant all privileges on emailblast.* to admin@localhost identified by "letmein";

Is this is a script? If so how do I run it? will it create the database and tables that I need to run this app?

Those two lines are SQL commands.

The first does exactly what it sounds like: creates a new database called 'emailblast' if it doesn't already exist.

The second also does exactly what it sounds like: gives all privileges (i.e., to access and modify) on the emailblast tables (.*) to a user named 'admin' logging on from your machine (localhost), using the password 'letmein'.

Those commands do NOT set up any tables in the database -- they just create the empty database and give privileges to the 'admin' user. There must be some other part of your application that actually creates and populates the tables within the 'emailblast' database.

margomaps
11-28-2007, 02:10 PM
FYI, you can just log into your mysql command line and paste those commands in, or type the following at your bash prompt:

mysql -u root -p < createdb.sql

It will prompt you for the password you created earlier, execute the commands, and return you to your command prompt.

Petar
11-28-2007, 02:32 PM
thank you so much, I was trying to input those commands manually, but that did the trick, and now I can run the app, thank you so much

margomaps
11-28-2007, 02:38 PM
thank you so much, I was trying to input those commands manually, but that did the trick, and now I can run the app, thank you so much

My pleasure.