mysql 5 « mysql « Java Database Q&A





1. MySQL indexing - is it a tree?    coderanch.com

I have a table, CREATE TABLE account_attributes( accID INT NOT NULL, name VARCHAR(255) NOT NULL, value VARCHAR(255) NOT NULL, INDEX(accID), INDEX(name) ); which will store account stuff, such as address email, name, phone, and whatever the hell I come up with. So you get the idea, the table will be huge. For every account there will be like 10 different rows. ...

2. Connector/j and MySql    coderanch.com

I have connector/j and i want to use it to connect to my mysql database. my question is how and where do i extract the files inside the connector/j.zip that ive downloaded from the net ??? i has a lot of files in it but i dont know which goes where.. thnx...

3. A question of accessing mysql in java    coderanch.com

Hello Everyone, I use JBuilder X to write a program that fetch the data in mysql database. in the compile phase, JBuilder told me a error. I write lots of System.out.println() sentence try to find what was going on. But except I know the error is due to statement create failed, I can't find why. Here is my code: package simulator; ...

4. JDBC MYSQL    coderanch.com

5. JDBC MySql    coderanch.com

6. Java, mysql, xml related problem    coderanch.com

I have created project management software with Java and MySql and it works fine. This applet gets and writes information directly to MySql database. Problem is that those sqlClauses below(update and insert) should go "through" xml "document" and i havent got idea how to do that. If someone could give me advices or even tell me how I must modify my ...

7. Problem while configuring mysql    coderanch.com

8. Question about executeUpdate and MySQL    coderanch.com

I just started using MySQL and connected it to a Java front-end using MyConnector/J & JDBC. In my front-end, I save all the data in the table by calling executeUpdate with (UPDATE

SET =, = etc. WHERE = My question is: does executeUpdate() return the number of rows that matched or the number of rows that were actually ...

9. Jdbc j2ee MySQL    coderanch.com

Since your applet runs on the client machine it doesn't have access to the JNDI config info (e.g. java.naming.factory.initial) unless you supply it as an applet parameter. I'm not sure it will work even then, but you can try it. If you need immediate help, I suggest you read the manual - immediately. Jules





10. MySQL learning resources    coderanch.com

I plan on trying MySQL out, for personal use. I'm familiar with SQL, but largley unfamiliar with running a database program (I am at the point where MySQL is installed and running properly). Does anyone know of any particularily good resources for learning how to work with MySQL? What are your thoughts on MySQL as an application?

11. Group by in mysql    coderanch.com

Hi, I have this problem with MySQL. sql = "select rd.unitcost, rd.quantity, rd.supplier, rh.description from requestdetail rd, requestheader rh where rd.requestNo= rh.requestNo AND rh.requestNo ='"+requestNo+"'order by rh.id asc;"; but when I retrieved, it will be like this: unitcost quantity supplier description 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 ...

12. Cannot acces Mysql database    coderanch.com

Hello, I am writing a program to access a Mysql database. the database is located on a dedicated server (say server1). When i run my program from that pc (server1), setting the address to "localhost", everything is fine. but if i try to run the program from an other pc (say pc1) and set the address to server1, then is fails ...

13. types bettween mysql and java    coderanch.com

14. Using Commons dbcp with MySQL    coderanch.com

15. mysql - get time interval    coderanch.com

hello - this is probably pretty simple, but i was wondering if anyone had seen any examples of how to select something from a database based on a time interval. for example, i have a number of records in a database, and I want to be able to pull all the ones out that have been created, say, less than one ...

16. Mysql    coderanch.com





17. MySQL is driving me nuts    coderanch.com

How did you set up the 'register' database? Describe that in detail please. What OS are you using, Windows or Unix? -If Windows, make sure the Mysql NT service is started (control panel ...-> services) -If Unix, make sure the Mysql daemons is up. Check it by: ps -wf | grep -i mysql Guy

18. newbie to MySql how to visualize?    coderanch.com

All, Well, I've been using MS access as my db and had great experience with it. Its very straight fw and easy to use (constructing tables changing attributes). Now, I have to use MySql (I understood its more robust). I downloaded MySql and realized that most of the constructions (building a table eg) are done with a DOS window. I wonder ...

19. Mysql support rollback or not    coderanch.com

20. MySQL    coderanch.com

Howdy, I'm writing a bare-bones java-struts app in WebSphere using MySQL just to prove to myself that I can do it. For the sake of complexity, I created an enterprise app with a web-app in it (which is where I'm attempting to connect to the db). Without going into painful detail, what I have so far worked fine until I added ...

21. MySQL & JDBC    coderanch.com

Hello people Problem is as follows- I have a demo java programme that connects me to a MYSQL server. Except it doesn't ! I always am returned a message stating that no SQL server can be found (the standard error message in the code). Now there is a mySQL server with the same name on the same port number I have ...

22. How to read and write binary Bytes in MySQL ?    coderanch.com

Hello, I am working on a Java-MySQL project to compute the hash value of a document using Java MessageDigest. The output is 16 bytes of type Java 'byte'. I store the value in MySQL CHAR types(using Jdbc). When I read back the stored value from MySQL using resultSet.getBytes(); the read hash value is not the same as the stored value. Some ...

24. mysql- auto increment    coderanch.com

Hi, im currently having some probs with an auto incrementing table in mysql. my sql scheme for the table is as follows: create table 'products'( idnumber int(11) not null auto_increment, title varchar(255)): when i try inserting something..such as insert into products values ('Shrek'); i get an Error Message saying: 'column count doesnt match values count at row 1' what does this ...

25. Lock Mechanism in mySql. any idea?    coderanch.com

Here is the deal: I have a list of clients and they are listed in a nice GUI. When you double click the name you can access and see all information related to them. You can also update some of the information and add new ones. The system is on a network so everyone can access the list. Now, consider ...

26. How to generated unique value by Java and mysql    coderanch.com

I need to generate a unique no. in the format like yyyymmddxxxxxx (xxxxxx 6-digitl running number) I think of create a table with two columns date value 20050405 120 20050406 99 Everytime, the application will increase the value+1 based on the same date. If not date found, create one record and value = 1 The problem is that since there's no ...

27. MySql problem    coderanch.com

When i try to create a new database in mysql using the mysqladmin i encounter the following error the command typed by me is mysql>mysqladmin create petstore; ERROR 1064: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysqladmin create petstore' at line 1or -------------------------------------------------------------------------------- ...

28. Writing to MySql Database    coderanch.com

Hello again! Thanks for all your help in the last topic, i got Tomcat setup ok! I could really use your help on this one guys! My problem is how to write to the database! I have a schema called broadband and my table that i am trying to write to is called member. I have the following code: <% Class.forName("com.mysql.jdbc.Driver"); ...

29. auto_increment in mySql    coderanch.com

30. reworking Access to mySQL    coderanch.com

Hi, All. I have a working project - a simulator of Web auction. Currently it pulls all data from a small 4-table Access DB. My question is: is it possible to change the format of the database from Access to mySQL, and what steps should I take to do that? I'm a very, very lightweight in JDBC\Java.. So any help is ...

31. MySQL Corruption Problem    coderanch.com

Hi all, I have a Web Service that uses a MySQL Database as its storage mechanism. However, I'm seeing some kind of corruption problem with the database. After not sending anything to the database overnight, I cannot seem to get any data out from the database. However, I am able to write as much data as I want to the database. ...

32. MySQL: delete all contents in the db    coderanch.com

33. MySQL help    coderanch.com

34. MySQL - clear screen command    coderanch.com

Brian, Are you sure there *is* one? I just did some looking in the manual, and all that I can find is "clear", but I'm unsure what that does. It doesn't clear the screen, nor does it clear the command buffer. One thing you can do is just hit return a bunch of times and push whatever is on the screen ...

35. Connnecting Java programs to Mysql    coderanch.com

Hi all I have had this problem for a while now! I have the native drivers downloaded i just dont seem to know how to do the connection! I place the uncompressed file in my classpath as instructed in the README, it just doesnt seem to work! I use the Connect.java that came with a sample of the connector driver and ...

36. mysql intersect    coderanch.com

Hi, I have a table candidateSkills where I store the skillName and skillDuration. The table looks like: skillid | ReumeId| skillName | skillDuration | --------------------------------------------- 1. | 1 | java | 32 | 2. | 1 | jsp | 43 | 3. | 1 | oracle | 34 | 4. | 2 | jsp | 48 | 5. | 2 | ...

37. UTF-8 problem with MySQL 4.0.17    coderanch.com

Hi Ranchers, I have a web application which uses MySQL database. Earlier I was using the charset ISO-8859-1 on the jsp pages and all characters ( including special characters such as bullets etc) were being displayed properly. However I had to change the charset encoding on the jsp pages to utf-8 due to some other requirements. Now all special characters from ...

38. Mysql    coderanch.com

hi this rahul I have a problem releted to Mysql I try to connect Mysql through Java, when i get connected it shows message no sutabile Driver Error no 08001; i currently instal Myodbc,jconnector according to mysql.com: may have path not set? yes ture I'ven't set path i try but couldn't get success kindly suggest me! how i over come this ...

39. jdbc+mysql    coderanch.com

40. Auto fill in mysql    coderanch.com

say i've two tables. they both have 2 columns in common. Is there anyway, that each time i update those two columns in table one, table two gets updated as well? how about updating with different informatin such as lengh of table 1 column 1 goes to table2 column 1. thanks in advanced.

41. JDBC MySql Examples    coderanch.com

42. Check status of MySQL replication with JDBC    coderanch.com

I have written a system check application in Java that among other things check if the database replication in MySQL is running. Currently it checks a timestamp in a transaction table and that it's not to old on the slave side. The problem is that big reports lock the transaction table that I'm checking on the slave and therefore prevents the ...

43. MySQL resetting auto-increment    coderanch.com

As a newbie, I had failed to realize that when using auto-increment on the Primary Key field I didn't need to enter a value in that field as I populated my database manually one row at a time. Subsequently, using phpMyadmin, I deleted rows and added rows and in between I un-set and reset the auto-increment function on the Primary Key ...

44. How to automate import in MYSQL ?    coderanch.com

45. porting database in MySQL to MaxDB    coderanch.com

Sir, I want to migrate my existing database which is in MySQL 4 tp MaxDB. How can it be possible? I started the SAP server and select the DB from SAP Management Console. But didn't find any option for migration. What is the steps to do the same? Your help and suggestions solicited.. Sudheesh K S

46. Mysql JDBC Cant load.....    coderanch.com

Here the code: //------------------------------ import java.sql.*; public class getmySQLConnection { public static void main(String[] args) { DB db = new DB(); Connection conn=db.dbConnect( "jdbc:mysql://localhost:3306/test", "root", ""); } } class DB { public DB() {} public Connection dbConnect(String db_connect_string, String db_userid, String db_password) { try { Class.forName("com.mysql.jdbc.Driver").newInstance(); Connection conn = DriverManager.getConnection( db_connect_string, db_userid, db_password); System.out.println("connected"); return conn; } catch (Exception e) { ...

47. MySQL and foreign languages    coderanch.com

the tables that i have on my dayabase are mostly with greek written data. sow when i use them in my jsp pages they are showed as $%#%^$@#$. do i have to setup my database as greek or my tables individualy??? and how because i cant find anything on the manuals i use mysql 4.1 .... thxs\ \

48. MySQL problem,language    coderanch.com

49. Three problems with mysql...    coderanch.com

1. You can see the error coming up when I try to delete the column which is a primary key. mysql> describe student_tbl; +-------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------+-------------+------+-----+---------+----------------+ | id | int(11) | | PRI | NULL | auto_increment | | name | varchar(35) | YES | | NULL | | ...

50. Unable to drop user in mysql    coderanch.com

I am unable to drop users from root account sql> show grants for root@localhost; ------------------------------------------------------------------------------------------------------ -------------------------------+ Grants for root@localhost | ------------------------------------------------------------------------------------------------------ -------------------------------+ GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*9BC01A49104D6960C8C288548AD 884E0B580D8' WITH GRANT OPTION | ------------------------------------------------------------------------------------------------------ -------------------------------+ row in set (0.02 sec) sql> select user, host from mysql.user; --------------+--------------+ user | host | --------------+--------------+ root | % | ...

51. create mysql db for web application    coderanch.com

When you connect to a MySQL database you connect to a server not the files directly. So the location of the actual files is not relevent. It only matters to your application that you can reach the mysql server through a socket from wherever you are running. Are you confused about where to have the driver jar?

52. Looking for a good tool for MYSQL    coderanch.com

Hi All, I am using a mySQL database and would like to download a nice tool that could provide a visual diagram that I can print out, one that would show the tables as well as the relationships between the tables. I have downloaded something called HappyFIsh, but can't seem to figure out how to connect to the database from this ...

53. primary generator using MySQL    coderanch.com

54. mysql setup    coderanch.com

i want to install mysql(latest version) on my computer.and also mysql control center on my computer. but the thing is that after installation all these softwares on my computer an error is showing on my computer. the error is [root@localhost:3306] ERROR 1045: Access denied for user 'root'@'localhost' (using password: NO) plz help me in this regard

55. Problem with MySQL syntax    coderanch.com

56. Setting MySQL variables    coderanch.com

I have below lines in my my.cnf file: [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock old_passwords=1 set-variable = table_cache=1200 set-variable = connect_timeout=12 set-variable = wait_timeout=7200 .... When I re-start MySQL, it picks up all the variables correctly, except wait_timeout. MySQL version is 4.1 and running on Linux. Cannot figure why it is not picking up the wait_timeout.

57. Dumping MySql database    coderanch.com

Hi Friends.. I am developing an application which is used crete a dump file for specified tables in a database. I am writing a java program to implement that by using "mysqldump" command provided by the MySql. Please See the code : mysqldump -uroot -p accessory accessory_text customer instocknotification orderline orders ordershippingdetail websiteorder user_language user_securityrole ids > "C:\projects\hitachidigitalmediav2\hitachidigitalmediaV2_01-Mar-2006_13-29.dmp" Note:here my database ...

58. access denied for user ' '@ipaddress in MYSQL    coderanch.com

I am getting the following error while connecting to mysql server 4.1 from tomcat 5.0.3 .Tomcat is running in linux and mysql is in a different windows machine. The problem is the linux IP '172.19.63.57' is shown in the error message instead of the windows IP which is specified in the datasource of struts-config.xml of tomcat in linux.A part of the ...

59. mysql database restore    coderanch.com

my try block looks like: the next sql 2 commands tried: mysql -hhost -uuse -ppassword database < sqlFlie and musqlimport -hhost -uuser -ppassword database sqlFile I also find it strange because no error or exception is found or thrown. so it executes it, but nothing happens (no restore is happened)... my sql file looks like: -- Host: 127.0.0.1 Database: mysouq3_db -- ...

60. mysql default idle time    coderanch.com

61. How to a database in MySQL using JNDI    coderanch.com

62. How to a database in MySQL using JNDI    coderanch.com

sandilyan xyz: Welcome to the JavaRanch! Please adjust your displayed name to match the JavaRanch Naming Policy. You can change it here. (We are looking for a first and last name that are not obviously fictitous -- unfortunatley, "xyz" does not qualify) Now, as far as your question goes, I'm afraid that you will have to be a little more specific. ...

63. JDBC and MySQL Problem    coderanch.com

I'm not sure why it isn't found, are you running a web application (eg Tomcat)? One way which may fix it is to move the JAR up one directory to C:\Program Files\Java\jdk1.5.0_05\jre\lib\ext rather than in the mysql-connector-java-3.1.12 directory. This will add the classes as an extension to the JRE and it is an incredibly brute force way to go about things. ...

64. Configuring MySQL Server5    coderanch.com

65. MySql Random Alphanumeric number    coderanch.com

Lol, I'm not sure what question I'd be responding to but here goes... Many random number generators generate a float from 0 to 1. Java is friendly in that it gives you some other features like random generating integers, longs, etc, but all you really need is a float from 0 to 1. Lets call this number SuperR. Let's say you ...

66. MySQL Deployment Problem    coderanch.com

Hi guys, I'm facing this problem where I get no clue what is happening. I could access the database the first time, and then... For any succeeding transactions, I get this error... changePassword: 0 com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.net.SocketException MESSAGE: Broken pipe STACKTRACE: java.net.SocketException: Broken pipe at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92) at ...

67. mysql    coderanch.com

hai, i am using mysql database.i have a table with primary key as auto_increment.when i remove all the records from the table, and try to insert a new record it inserts the primary key column after the last removed value. i want to know how to insert from 1. can you tell me the ways. thank for suggestions.

69. classnotfound Java->mysql jdbc problem!    coderanch.com

Hi, I wnat to connect to mySQL fromo Java, I followed all the instructions from the mySql web page, yet I havent been able to do it, when I compile the java progrm I keep getting class not found exceptions, I am using Fedora Core and Java was already installed-well I chose to install it when I installed the operating system, ...

70. Jboss & mysql    coderanch.com

71. Best MySQL Client    coderanch.com

72. How to deploy a MySQL application    coderanch.com

I developed a simple J2SE app that connects to MySQL using Connector/J. It works. Now, the problem is how to deploy the application to another pc where there is no MySQL installed. I read on the MySQL documentation that Connector/MXJ is the solution for deploying the MySQL database engine from within a Java package. As I get errors in using Connector/MXJ ...

73. about mySQL    coderanch.com

74. how to mysql database?    coderanch.com

75. Mysql    coderanch.com

76. save jpeg in mysql    coderanch.com

77. MySQL, JNDI refactoring    coderanch.com

Hi guys, I'm trying to engineer my web application. Hence any repeating code I'm trying to filter out. My database code I have filtered out to a different class, which can then be invoked as and when the application needs to connect the database. Context ctx = new InitialContext(); if (ctx == null) throw new Exception("Boom - No Context"); ds = ...

79. Very slow to hook up to MySQL db    coderanch.com

Hi all, I have a java web app which connects to a MySQL database, using a datasource which i have defined in tomcat's server.xml, DefaultContext tag, as follows: factory org.apache.commons.dbcp.BasicDataSourceFactory