w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Excel: Display value from list of options if numbers begin with value from options
VLOOKUP() I believe is the right function for this. Assuming that you want the area names in column E in Sheet1 as from row 2, the phone numbers are in columnB of that same sheet and the table with prefix and area code in Sheet2 columns A and B, you can use: =VLOOKUP(LEFT(B2,5), Sheet2!A:B, 2, FALSE) LEFT(B2,5) extracts the first 5 characters from the phone number stored in B2. If there are area codes of different lengths, then the formula will have to be revised and it will be much more complex. Sheet2!A:B is the table to lookup the data 2 is the index of the column containing the values you want to get (the first index is the column containing the area codes) FALSE means exact match. I don't think you'd like to get the area code immediately smaller than the one you're looking for,

Categories : Excel

How can I use VBA to add a Connection (to an External Data Source) in Excel and Save it to that Excel spreadsheet's list of Connections
You can use a macro recorder to generate a VBA code that will add a connection to your excel instance. I have added the code at the end of this answer, however you can generate your own if you follow the below steps: 1) Start a macro recorder 2) On the ribbon, click on Data tab. Click on the Connections and then choose the Add button like shown in the below screenshot 3) On the next screen, choose your existing DB connection, and follow the steps on the next 2 or 3 screens to configure your connection. 4) Once your connection is established and appears in the connections list, click on the Properties button and on the next screen Export Connection File 5) Stop your macro recorder and open VBE (alt+F11) and edit the code in your Module1 6) Remove these lines from your macro code .Serv

Categories : Excel

how to store data from excel sheet into mysql database using jdbc connection
As you have an ArrayList in which you're adding cell values, you can proceed as follows: public void insertRowInDB(List cellValues){ Connection con = null; PreparedStatement preparedStatement = null; try{ Class.forName("com.mysql.jdbc.Driver"); con = DriverManager.getConnection("jdbc:mysql://localhost/databaseName?" + "user=sqlUser&password=sqlPassword"); String sql = "INSERT INTO tableName(field1, field2, ..., fieldN) VALUES (?,?,...,?)"; preparedStatement = con.prepareStatement(sql); int paramIndex = 1; for(Object cell : cellValues){ preparedStatement.setObject(paramIndex, cell); paramIndex++; } int status = preparedStatement.e

Categories : Java

Array formula in excel suddenly not working... troubleshooting
Your second formula is, itself, returning an array. You are only viewing the top left element in that return array - which happens to be FALSE. Your first formula returns a scalar value; that is the difference. If you want to sum the '1' values then your second formula could be amended to {=SUM(IF('Data Input'!$L$3:$L$15000=$B10,1,0))} which is also a scalar return.

Categories : Arrays

html select control click not showing options list until mouse is hovered towards the options
it seems IE9 is blocking javascript...i hope this helps http://answers.microsoft.com/en-us/ie/forum/ie9-windows_vista/internet-explorer-9-drop-down-menus-do-not-pull-up/954c5c71-5878-40a4-b9f8-68991922e85a

Categories : Javascript

Java PostgreSQL connection over VPN
I'm not sure if this might be the problem, but I've experienced similar problems in the past trying to connect to a database with VPN turned on. Try running your application with this JVM argument passed at application launch time: -Djava.net.preferIPv4Stack=true See also this answer for a more permanent solution.

Categories : Java

PostgreSQL Database connection error
by default, postgresql deny all connexion if it's not from "localhost" here is a link for you : https://wiki.debian.org/PhpPgAdmin

Categories : Postgresql

Zend framework - connection to postgresql
localhost on your machine is (most likely) resolving to the IPv6 address of localhost (::1), but since the protocol/module used does not support IPv6 connections, your connection fails. You could either; Use as a host instead, that will force a connection to the IPv4 localhost. Remove the host line completely, that will force a connection via UNIX sockets.

Categories : Postgresql

JRuby / basic PostgreSQL connection
The docs suggest something along the lines of: # connection setup ActiveRecord::Base.establish_connection( :adapter => 'jdbc', :driver => 'org.postgresql.Driver', :url => 'jdbc:postgresql:sample_db;create=true' ) Or ActiveRecord::Base.establish_connection( adapter: 'postgresql', database: 'db/my-database' ) This is assuming you're using JDBC and the appropriate configuration. For this, I suggest taking a look at Postgres' documentation. Sample provided over there is written in Java: String url = "jdbc:postgresql://localhost/test"; Properties props = new Properties(); props.setProperty("user","fred"); props.setProperty("password","secret"); props.setProperty("ssl","true"); Connection conn = DriverManager.getConnection(url, props); String url = "jdbc:postgresql://

Categories : Ruby On Rails

How to properly handle connection persistent things within node-mysql connection pooling
All transactions will happen in the context of a single connection. After you end or terminate the connection, you can no longer operate on that transaction. The general pattern is to open, query, close and unless you have a long running transaction, you won't have any problems of queries or variables bleeding over into other connections. In the event of a long running transaction, you will have to manage that connection object to make sure it exists and is only used by code that operates within that transaction.

Categories : Mysql

Heroku and NodeJs - MySql Connection lost: The server closed the connection
You already seem to know what is happening; the MySQL server is closing the connection. Many database services, including ClearDB, to do this (ie, close inactive connections). You're going to have to detect the disconnect event, and recreate the connection. There are instructions in the node-mysql documentation for doing this.

Categories : Mysql

When testing external Mysql connection, I get the CDbConnection failed to open the DB connection
To connect remotely to a database, you must create a database and enable direct database access. If a database was created without this option selected, you will not be able to connect remotely. Direct Database Access is not available on free ad-supported hosting accounts.

Categories : PHP

Does the PG Ruby Gem use pgpass when setting up PostgreSQL connection?
Yes, it will use ~/.pgpass just like any interface based on libpq, the C PostgreSQL client library. However, a good alternative for not having the password in a file is to have it in the PGPASSWORD environment variable. If you set this in a script, it will be inherited by every program it calls. PGPASSWORD when set will be used as the password for any libpq connection, which means the majority of programs that connect to PostgreSQL.

Categories : Ruby

Any way to use >1 Core in PostgreSQL for a single Connection/Query?
PostgreSQL does not currently support executing a single query across multiple CPU cores (minus background things like background writing and wal writing if you're doing a write query, but that doesn't really count). It's work that's in progress, but it's a long-term project, and is not in any current version of PostgreSQL. This is the same on all platforms and architectures. It is definitely an issue, but since PostgreSQL is, as you say, focused on multi user scenarios, it's not bubbled to the top of the priority queue until recently. But there are definitely people realizing it's an issue, and working on solving it for future versions, it's just not done yet.

Categories : Performance

Postgresql - Run trigger with variable supplied by connection
I managed to solve this issue using temporary tables. What I ended up doing is the following. Note that this was written using python and psycopg2. First, I set up my python code to use the with construct to obtain a database cursor from the psycopg2 connection pool. This has the added benefit of automatically returning the connection to the pool, regardless of how the code block exits. I then modified the class used in the with construct to create a temporary table containing whatever data I deem useful, specifically the username, before returning the cursor. This table is created with the ON COMMIT DROP option so I know that when I return the connection to the pool the table will be dropped, preventing any conflict with future usage of the connection. I then wrote my ON UPDATE trigger

Categories : Python

PostgreSql Connection in Custom Mediator WSO2
i think it is better if you use dataservice server to handle DB logic, and call that from your proxies. In the DS you can provide connection settings Or have the logic to handle DifferentFileURIs in the custom mediator. Then you can use the connection pool to handle

Categories : Postgresql

postgresql connection error with qt creator in windows
If you are missing the driver (as the comments suggest) then you should look at getting it. On Debian, for example you would: apt-get install libqt4-sql-psql On Fedora you would use a similar yum command However without knowing your platform, I can't suggest specific steps.

Categories : Database

Connection refused (PGError) (postgresql and rails)
The error message is instrumental: could not connect to server: Connection refused Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5433? port You may be trying to connect to the wrong port. Standard port is 5432. Check how (and whether at all) you started your postgres server: postgres@db:~$ ps -auxww | grep ^postgres ... <stripped more lines> postgres 1274 0.0 0.3 1437240 57308 ? S May27 5:01 /usr/lib/postgresql/9.1/bin/postgres -D /var/lib/postgresql/9.1/main -c config_file=/etc/postgresql/9.1/main/postgresql.conf The manual has related information here. In my example, settings from /etc/postgresql/9.1/main/postgresql.conf got used, which says (among many other settings): port = 5432 Or run netstat -nlp | grep po

Categories : Ruby On Rails

Can SQL Server Connection String Contain Options like XACT_ABORT?
No, that is not possible. The possible options are documented here: http://msdn.microsoft.com/en-us/library/ms130822.aspx http://www.connectionstrings.com/all-sql-server-connection-string-keywords I also advise you to stick to the default options because that is what everyone uses. The product works best one you are close to the defaults. Also, help on the web will be easier to obtain.

Categories : Dotnet

Connection lost after query runs for few minutes in PostgreSQL
My guess, reading your problem, is that you are hitting out of memory issues. Craig's suggestion to turn off overcommit is a good one. You may also need to reduce work_mem if this is a big query. This may slow down your query but it will free up memory. work_mem is per operation so a query can use many times that setting. Another possibility is you are hitting some sort of bug in a C-language module in PostgreSQL. If this is the case, try updating to the latest version of PostGIS etc.

Categories : Postgresql

show connection drop options in jsPlumb chart
I quite sure I tried this, but now I got it working: add CSS: .dragActive { border: 2px dotted orange; } a var like: var exampleDropOptions = { tolerance:"touch", hoverClass:"dropHover", activeClass:"dragActive" }; and change the endpointOptions accordingly: var endpointOptions = { // .... dropOptions: exampleDropOptions } here's the updated JS-fiddle. Works! http://jsfiddle.net/SCSaf/1/

Categories : Javascript

excel to postgresql using spring
This is a very general question so it's difficult to give a specific answer, you might want to consider the following as guidance though: Design a domain object/model to hold whatever data you are reading from the xls file. Your read method should return a list of this object. Create a Spring manager class to act as your service layer, this might have a method called save which takes a list of objects from step one. Create a data access object which handles the mapping of objects passed through from step two. You might consider using an ORM tool (Hibernate for example) for this step. I hope this points you in the right direction.

Categories : Spring

User Login Page using Spring MVC + Hibernate + PostGreSQL connection
There are several things. @Transactional @Repository("LoginDao") public class LoginDao { public void findByUname(Users loginForm) { System.out.println("Hi Dao" + loginForm.getUname()); Session session = my_sessionfactory.getCurrentSession(); Query query = session.getNamedQuery("loginUser.findByUname").setString("userid", loginForm.getUname()); Users loginObj = (Users)session.getNamedQuery("Users.findByUname").setParameter("id", loginForm.getUname()); // getNamedQuery("loginUser.findByUname").setParameter("id", loginForm.getUname()).uniqueResult(); } First your LoginDao has no field named my_sessionfactory at least not in the code you show. Next there is no named query with the name loginUser.findByUname, there is a Users.findByUname query. Finally you are try

Categories : Hibernate

tsung postgresql ssh: connect to host localhost port 22: Connection refused
You are using server monitoring and your SSH is not setup.. <monitoring> <monitor host="localhost"/> </monitoring> Do you really want to monitor server? If not then you can comment the code and it should work fine.. If yes then you will have to set up a password less SSH to your server...

Categories : Misc

Jtable options array for drop down list or select list
After much trial and error, and debugger stops in the jtable scripting files, I learned that in order to use an object for the 'options' property of a field in jtable, the object must be in the following format var optionsObject = new Object(); optionsObject[Value] = DisplayText;

Categories : List

Options for Parsing Excel Files in ExtJS
Number two is going to be the better option IMO. You can take a look at the FileUploadField control - there is a good example on submitting the Form that will upload the file to the server: http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.form.field.File From there you can parse and return the json.

Categories : Node Js

Export HTML table to Excel - options?
You could try using SQL Reporting Services. It's a bit heavy, but you could create the HTML tables as a report. Using Reporting Services you could then render out the report as an Excel document (or PDF, or an image, etc.). I've found it to be the easiest way to get a consistent output into documents like that. I've not tried calling Reporting Services from PHP, but I'm sure it can be done. There's a blog article by Brian Swan of MS that explains it - http://blogs.msdn.com/b/brian_swan/archive/2010/09/23/rendering-sql-server-reports-as-excel-documents-with-php.aspx I've not tried it myself though, so I can't vouch for it, but may be helpful for a starting point.

Categories : HTML

MySQL Trigger Error #2013 - Lost connection to MySQL server during query
Change SET cmd=CONCAT('/home/lab/Dropbox/simulator/version_unified/./simulator'); to SET cmd=CONCAT('/home/lab/Dropbox/simulator/version_unified/simulator'); ./ is used when the file is in the current working directory.

Categories : C++

How to prevent mysql connection using hibernate from mysql wait_timeout?
Most connectors provide something like ValidationQuery to prevent loosing the database connection. For mysql the ValidationQuery would be "SELECT 1". Check this page for some examples (eg. with c3po, jdbc or directly on datasource). I normally configure the ValidationQuery as part of a DatasourceProvider.

Categories : Java

Fluent NHibernate connection to MySql without MySql.Data in GAC
MySql.data.dll must reside beside the assembly containing the code you posted. Also .Provider("MySql.Data.MySqlClient") and .Driver<NHibernate.Driver.MySqlDataDriver>() are redundant since you already specified MySQLConfiguration.Standard which already does set driver and Provider.

Categories : C#

MySQL connection from my desktop to remote MySQL not working
Below is the excerpt from the mySql Docs If the following error occurs when you try to connect from a host other than the one on which the MySQL server is running, it means that there is no row in the user table with a Host value that matches the client host: Host ... is not allowed to connect to this MySQL server You can fix this by setting up an account for the combination of client host name and user name that you are using when trying to connect. If the following error occurs when you try to connect from a host other than the one on which the MySQL server is running, it means that there is no row in the user table with a Host value that matches the client host: Host ... is not allowed to connect to this MySQL server You can fix this by setting up an

Categories : Mysql

Creating a connection using excel-vba
There is a similar question here at social-msdn. The step that you are missing is to use QueryTables.Add to get the data into a worksheet (although your question is not entirely clear).

Categories : Sql Server

Excel VBA remove right button click 'Paste Options' menu group when editing within a cell
using the customui editor you can add this to the customui14 part <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui"> <commands> <command idMso="Paste" enabled="false"/> <command idMso="PasteGallery" enabled="false"/> <command idMso="PasteGalleryMini" enabled="false"/> <command idMso="PasteMenu" enabled="false"/> <command idMso="PasteLink" enabled="false"/> <command idMso="PasteAsHyperlink" enabled="false"/> <command idMso="PasteSpecialDialog" enabled="false"/> <command idMso="PasteFormatting" enabled="false"/> <command idMso="PasteFormulas" enabled="false"/> <command idMso="PasteValues" enabled="false"/> &l

Categories : Excel

ReplaceMent for Jet Excel Database Connection?
You can try ACE.OLEDB private static readonly string CONNECTION_STRING_TEMPL = "Provider=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + FilePath + ";" + "Extended Properties='Excel 12.0;HDR=Yes;IMEX=1' ";

Categories : C#

MySQL connection over SSH tunnel - how to specify other MySQL server?
Solved it! The thing was to connect to the correct server when creating the tunnel itself - should've seen that one coming. ssh -f user@ssh.example.com -L 3307:mysql1.example.com:3306 -N Then mysql -h -P 3307 worked as intended. :)

Categories : Mysql

File is Read only using VBA Excel with ADO connection to Access
Yes, you receive this message because the file is open. You could: Copy the worksheet to a new workbook, close and save this, transfer the data then delete this (temporary) file using Kill Create an ADO recordset and loop through the worksheet data, inserting it (AddNew) it the Access table. There are a number of examples of this to be found on the internet.

Categories : Excel

Extracting Excel data using Sql connection string
This suggests "changing the Platform target project setting from Any CPU to x86." will help. The root cause is, as the error says, a mismatch between the database driver and your application. These docs say If you use the 64-bit odbcad32.exe to configure or remove a DSN that connects to a 32-bit driver, for example, Driver do Microsoft Access (*.mdb), you will receive the following error message: The specified DSN contains an architecture mismatch between the Driver and Application To resolve this error, use the 32-bit odbcad32.exe to configure or remove the DSN.

Categories : SQL

OLEDB connection string for excel 2013
Have You Tried this one... string.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties='Excel 12.0 Xml;HDR=Yes;IMEX=1;TypeGuessRows=0;ImportMixedTypes=Text'", arq)

Categories : C#

How to insert query to Excel by ODBC connection in ASP.NET?
Per http://support.microsoft.com/kb/316475 make sure you add "ReadOnly=0" string conStr = @"Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};"+ @"DBQ=|DataDirectory|q.xlsx;ReadOnly=0;";

Categories : C#

Compare queries on PostgreSQL and MySQL
The repeated query hit the MySQL query cache, a feature which, I believe, does not exist in PostgreSQL. Repeat the test after disabling the query cache, or add the SQL_NO_CACHE directive to your query to MySQL (SELECT SQL_NO_CACHE * FROM test...).

Categories : Mysql

© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.