My question is: does executeUpdate() return the number of rows that matched or the number of rows that were actually ...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 |
|
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? |
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 ... |
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 ... |
|
|
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 ... |
|
|
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 |
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 ... |
|
20. MySQL coderanch.comHowdy, 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 ... |
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 ... |
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 ... |
|
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 ... |
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 ... |
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 ... |
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 -------------------------------------------------------------------------------- ... |
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"); ... |
|
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 ... |
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. ... |
|
|
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 ... |
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 ... |
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 | ... |
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.comhi 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 ... |
|
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. |
|
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 ... |
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 ... |
|
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 |
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) { ... |
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\ \ |
|
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 | | ... |
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 | % | ... |
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? |
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 ... |
|
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 |
|
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. |
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 ... |
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 ... |
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 -- ... |
|
|
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. ... |
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. ... |
|
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 ... |
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.comhai, 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. |
|
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, ... |
|
|
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 ... |
|
|
|
|
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 = ... |
|
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 |